Announcement

Collapse
No announcement yet.

Linus Torvalds' Initial Comment On Rust Code Prospects Within The Linux Kernel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    Originally posted by Danny3 View Post
    Ok, but how is the code written in Rust compared to C at the performance level ?
    Is Rust adding any safety checks at runtime that makes the code slower based on the assumption that the code is badly written ?
    Rust's safety checks are statically analyzed. Compilation time is a bit slower, but there aren't runtime checks. Features involving dynamic casting are always expensive, whether written manually or supported by language.

    Leave a comment:


  • p91paul
    replied
    Originally posted by pal666 View Post
    and nothing works, that's why nothing but c++ is used as viable replacement for c
    i didn't say "call c code", i said "understand c headers". even perl can "call c code"
    A quick Google lookup will teach you that Rust bindgen *understands C headers* and generates Rust bindings from that.

    Leave a comment:


  • Danny3
    replied
    Ok, but how is the code written in Rust compared to C at the performance level ?
    Is Rust adding any safety checks at runtime that makes the code slower based on the assumption that the code is badly written ?

    Leave a comment:


  • pal666
    replied
    Originally posted by RahulSundaram View Post
    There are multiple solutions for this in many languages.
    and nothing works, that's why nothing but c++ is used as viable replacement for c
    Originally posted by RahulSundaram View Post
    In Rust, one could use bindgen to generate Rust FFI and you then call C code from that
    i didn't say "call c code", i said "understand c headers". even perl can "call c code"

    Leave a comment:


  • CommunityMember
    replied
    Originally posted by onicsis View Post
    As long it's not a requirement to have rust compiler installed, to be able to properly build mainline kernel, guessing it's OK.
    It seems likely any early usage of rust would be in specific use cases such as a new driver which might very well not be built by default (so no rustc requirements). But, remember, you are the frog (and the water is slowing getting hotter).

    Leave a comment:


  • onicsis
    replied
    As long it's not a requirement to have rust compiler installed, to be able to properly build mainline kernel, guessing it's OK.

    Leave a comment:


  • RahulSundaram
    replied
    Originally posted by pal666 View Post
    viable c replacement has to understand c headers
    Not necessarily but it does make it easier to replace incrementally. There are multiple solutions for this in many languages. In Rust, one could use bindgen to generate Rust FFI and you then call C code from that

    Leave a comment:


  • pal666
    replied
    Originally posted by 144Hz View Post
    It might evolve into a viable C replacement.
    viable c replacement has to understand c headers

    Leave a comment:


  • pal666
    replied
    well, it has to be disabled by default because gcc 4.9 doesn't support it

    Leave a comment:


  • dxin
    replied
    This is getting interesting. I guess it's finally time for me to learn a new language.

    Leave a comment:

Working...
X