4 ms·
Not knowing Rust but looking into its usefulness to me, could you share some of the issues you see? It’s always good to hear others experience.
by troglonoid 5y ago
Not knowing Rust but looking into its usefulness to me, could you share some of the issues you see?
It’s always good to hear others experience.
- junon 5y agoRust has so much syntax for similar semantics that reading rust code is insanely difficult. Even well written Rust can obfuscate intent or details about the implementation when read due to the syntax being terse and broad. Also, Rust doesn't let you do all of the same things C does without using "unsafe", even if they're perfectly safe. Even with all of that syntax, you're still incapable of telling the rust compiler enough information to allow you to compile certain programs. For example, in a single threaded Tokio application, shared state across coroutines still requires a 1) heal allocated 2) reference counted 3) mutex protected reference to the state, otherwise Rust won't let you compile even though it would be completely safe to pass around a single stack-allocated reference. Perhaps I was missing something simple but it was the only way the compiler was happy and seemed to be the only way anyone has gotten it to work.
- api 5y agoUnsafe doesn't mean unsafe. It means not provably safe by the compiler. That matters on large code bases, or as code ages and has multiple contributors. Keeping dangerous security bugs out of C is very difficult under those circumstances, but in Rust you can largely trust the compiler and can easily search for all uses of "unsafe" and audit them.
- sharikone 5y agoYes but if you do much low level it is annoying to use a language that constant treats you at best as a dark magic wizard, at worst as a dangerous risk seeker. All my point was that Rust is not a substitute for C, too heavy and complex and not enough liberating for low level "assembly-wrapping" stuff.
- pjmlp 5y agoThe concept of unsafe language constructs are about 10 years older than C's birthdate, written in different forms, lowercase, uppercase, special module to be imported, whatever, all ignored by C's authors. As for C being low level "assembly-wrapping" stuff, yeah when all you have is a PDP-11 clone. https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479