4 ms·
The Rust code you wrote seems to be extremely heavy on boilerplate. A couple of macros could have drastically reduced the line count. I don't think what Linus
by CDSlice 7y ago
The Rust code you wrote seems to be extremely heavy on boilerplate. A couple of macros could have drastically reduced the line count.
I don't think what Linus wrote in 2004 on C++ has much relevance for 2020 Rust, especially for a new kernel that doesn't have a ton of contributors. Most of his complaints seem to be on how C++ abstractions can make it hard to review unknown code and how 2004 C++ code bases often had extremely messy code. Rust IMO doesn't suffer from those problems near as much as 2004 C++ did.
Also, Google is using Rust for part of their new Fuchsia kernel so at least they think Rust has something good to offer kernel dev.
- roblabla 7y agoSmall nitpick: Google isn't using Rust for the Fuchsia kernel. The kernel, Zircon, is written entirely in C and is based on Little Kernel. Google is using Rust for some userspace drivers (Fuchsia being a micro-kernel).
- loeg 7y ago> The kernel, Zircon, is written entirely in C No, it's written in C++[1]. They're very different languages. That said, Google seems to think C++ has something to offer to all kinds of development. It seems to work for them, but they are a heavily C++ shop. I wouldn't read too much out of their use of C++ anywhere; it'd be more surprising and interesting to see them use anything else. [1]: https://fuchsia.googlesource.com/fuchsia/+/master/zircon/kernel/kernel/scheduler.cc https://fuchsia.googlesource.com/fuchsia/+/master/zircon/ker...
- roblabla 7y agoOh that's interesting. Zircon is based on LK[0] which is in C, which is why I thought it was still written in C. I wonder how much is left of the original LK code then. [0]: https://fuchsia.dev/fuchsia-src/concepts/kernel/zx_and_lk https://fuchsia.dev/fuchsia-src/concepts/kernel/zx_and_lk
- loeg 7y agoInteresting, I didn't know about LK. Thanks for sharing :-).