6 ms·
> Rust has a lot of problems for serious low level work Could expand on where it suffers? I've been playing around with Rust in the embedded space (nothing ser
by bluejekyll 9y ago
> Rust has a lot of problems for serious low level work
Could expand on where it suffers? I've been playing around with Rust in the embedded space (nothing serious at all); I find it to be as elegant in a nonstd situation as it is in standard high level app development.
> and suffers from a lot of the same classes of problems C++ does,
What are those classes of problems? C++ never offered a safe alternative to C, but did offer some eases of use and stronger typing over C.
Rust on the other hand has a huge amount to offer over C. At no point in my Rust work do I ever wish I was working with C, quite the contrary. But I like strongly typed languages, Rust is definitely not for those that dislike types.
- Sir_Cmpwn 9y ago>Could expand on where it suffers? I've been playing around with Rust in the embedded space (nothing serious at all); I find it to be as elegant in a nonstd situation as it is in standard high level app development. By "the embedded space" do you mean "devices running Linux with Rust in userspace?" Because that's much higher level than what I'm talking about, and has very different design concerns from those of a general purpose operating system. My main beef with Rust for low level development is that Rust is way more complicated than it should be. IMO for serious low level programming Rust should have 1/10th the featureset. It also has issues dealing with the weird data structures that tend to come up in low level contexts in my experience. Rust also has the shiny fad status working against it IMO. If, say, 5% of C hackers understand low level programming and/or kernel hacking, then maybe 0.5% of Rust hackers do (if that). >What are those classes of problems? C++ never offered a safe alternative to C, but did offer some eases of use and stronger typing over C. It comes back to complexity and typing. There's nothing wrong with strongly typed languages (of which C is a member), but I strongly dislike object oriented languages and paradigms. Especially in low level contexts it's like forcing a square peg into a round hole. Other features C++ brings to the table like operator overloading and templates are antifeatures, doubly so in a kernel hacking context. Many of the same patterns of unnecessary complexity introduced by C++ are also present in Rust. C is boring, but it's also transparent and straightforward. Ergonomics takes a backseat to simplicity in C, which is a compromise I'd take any day.
- aeleos 9y agoI have been working on writing my own OS in rust for the past few months, and the main thing I have had the most difficulty with is Rust itself. The package management is so much better than C, dependencies are easier, and it was honestly easier to get working compared to C++. The fact that they nicely have separated rust core and std so that I don't have to deal with things randomly breaking because of something I haven't implemented. The abstractions that Rust offers I don't feel suffer the same problems as C++ because they are much more straightforward to use and just make sense from an object oriented programming perspective. Rust itself is so inherently different from other a language like C that it takes a long time to truly understanding lifetimes and the borrow checker to the point where you are actually making use of the languages features. The straightforwardness of C is really where it shines, and for me at least Rusts biggest upside is also its biggest downside, because learning to write good Rust is not an easy process.
- Ar-Curunir 9y agoJust FYI, RUst is not an OOPy language. The type system is much cleaner and actually works to ensure things are guaranteed at compile-time.
- bluejekyll 9y ago> By "the embedded space" do you mean "devices running Linux with Rust in userspace?" No, I mean TockOS with the Hail dev board: https://www.tockos.org/blog/2017/introducing-hail/ https://www.tockos.org/blog/2017/introducing-hail/ > Rust is way more complicated than it should be People often make this statement, but I don't know exactly what it means. The type system is great for writing finite state machines, which I'm finding to be a nice quality for the toy programs I've written on Tock. > Rust also has the shiny fad status working against it IMO. Rust is 2 years into it's stable life. It's young, will it ever exceed the number of lines written than C or C++, almost definitely not, but I wouldn't dismiss it off-hand because people like it, there might be a good reason for that. > If, say, 5% of C hackers understand low level programming and/or kernel hacking, then maybe 0.5% of Rust hackers do (if that). I wonder about this statement. I've noticed quite a large number of people in the community working with Rust in the embedded space. According to the people who responded to the Rust survey this year, https://blog.rust-lang.org/2017/09/05/Rust-2017-Survey-Results.html https://blog.rust-lang.org/2017/09/05/Rust-2017-Survey-Resul..., it was nearly 17%. > C is boring I've met more undefined behavior that makes me not agree. > and straightforward. :/