Re:A review after using Rust on embedded in production for o...
by ramon156 on Monday October 14, 2024 @06:04AM
(#41835986)
These comments make it seem like it's impossible for people to learn Rust. I have to admit that it takes a fair bit longer than other languages, but so is c/c++. Is there a bias towards not using Rust by other devs? Is it a scary language?
[ Parent
| on HN ]
Re:A review after using Rust on embedded in production for o...
by realusername on Monday October 14, 2024 @06:39AM
(#41836204)
I'd put the same concerns for C and C++ to be fair. The learning curve just isn't the same as most other mainstream languages.
Re:A review after using Rust on embedded in production for o...
by ttfkam on Monday October 14, 2024 @09:44AM
(#41837462)
I'd put even more concerns on C++. All the same concerns plus all the concerns that arise from the compiler not helping you nearly as much. It's easy with C++ to be lulled into a false sense of security because it compiles, and your trivial happy path works. Under load or with unforeseen input, the chance for memory corruption is massive even for experts let alone beginners because it only takes one to bring down a whole process.
C++ is better than it used to be, but it was truly atrocious in that regard for decades. It was simply the least worst option for those decades.
I do not consider it the least worst option anymore.
Re:A review after using Rust on embedded in production for o...
by ttfkam on Monday October 14, 2024 @09:38AM
(#41837421)
A garbage collector really takes away a huge amount of cognitive overhead. In doing away with it, Rust requires that you understand the borrow checker and lifetimes, even if minimally due to extensive use of .clone() in your early code. This ties into all of the different kinds of strings in Rust from str to string to vec[u8], etc.
Unlike Go that only really requires experience in general programming to become rapidly productive, Rust basically requires that you read The Book in its entirety before you even think about applying that knowledge in production. There are just to many interdependent concepts to hand wave away the prep time. It all (mostly) makes sense once you've familiarized yourself with the basic concepts, but it's a training step you simply cannot skip without inflicting a fair amount of pain on yourself and others.