by lmilcin · 5y ago · 0 comments
I have distinct feeling this would benefit from waiting a little bit more to have various kinks straightened out.
> Like it was mentioned in the RFC, the Rust support is still to be considered experimental. However, as noted back in April, support is good enough that kernel developers can start working on the Rust abstractions for subsystems and write drivers and other modules.
From my point of view what counts is actual kernel development. If you are going to develop kernel because it uses cool new language but you would not if it was still C, you are probably not the right person.
Now, I think Rust has potential to be good kernel language, I am mostly concerned with toolchain, ability for people to read the code with comprehension, ensure correct code, etc.
You are taking this the wrong way around. It's not about people contributing to $PROJECT because it uses $COOL_TECH, it's about people being turned off from contributing to $PROJECT because of $MEH_TECH.
If Linux was written entirely in assembly, we'd be having the same argument about the introduction of C.
Also BCPL, the basis for B intepreter, was originally designed to Bootstrap CPL, not really as a daily use language.
Also, simply by having god damn namespaces more readable names could be used at no downside.
Why's that? C is a tedious language that makes you do so much manual bookkeeping, I don't think I'd ever write it again (if I needed C for some reason I'd write a program to generate it for me rather than doing it myself). I think any decent developer would be put off by C to some extent. Sure, the people who really want to make a kernel may put up with it, but an arbitrary enthusiasm barrier is not the way to attract good contributors.
Any decent developer would be put off by any language to some extent.
Personally, I'm more put off by Rust than C (they put me off for different reasons). Currently, the one puts me off the least is Zig, but it still has many details that I don't like.
C is tedious but kernel programming isn't about spewing vast amount of code anyway. It is more important to be able to read it, understand it and ascertain it is correct. This is one of main reasons for why C++ is not there.
Call me indecent. I use C for firmware development running on small microcontrollers and consider it perfect for this particular task. Not put off by C for this task at all.
1. rust is easier to read than c/c++
2. The toolchain is llvm based and much nicer to use than c/c++. Hell your build scripts are also rust
3. Given the choice to develop in c or rust I would choose rust
4. In my own experience I have found rust to be simpler to Deal with correctness than c/c++
(I have been both a rust and c++ developer)
Rust may or may not be easier to read than C++, depends on your experience.
But it is not true it is easier to read than C. C is objectively much smaller, simpler language than Rust.
> 4. In my own experience I have found rust to be simpler to Deal with correctness than c/c++
That is the whole point of Rust. And also to do this with minimum runtime overhead.
https://github.com/rust-lang/rust
The git repo has over 150,000 commits, 3,000 contributors, and 9 years of release history. The last 6 years of which have been post 1.0.
Also, Mozilla has been writing large parts of firefox in Rust since ~2017. There's some interesting writeups on hacks.mozilla, including this one on reducing CVEs with Rust
https://hacks.mozilla.org/2019/02/rewriting-a-browser-compon... https://research.mozilla.org/rust/
I do embedded development on ARM Cortex-M3 and while it is possible to do this in Rust, I have experienced a bunch of issues with the toolchain and I have decided to stay on C until toolchain improves.
Don't get me wrong, I like Rust. Just don't allow liking something get in the way of practicality.