3 ms·
The issue here is that Rust presents itself as a systems language, i.e. a language where the programmer has control over how the system's resources get used. Ho
by gizmo 3y ago
The issue here is that Rust presents itself as a systems language, i.e. a language where the programmer has control over how the system's resources get used. However, Rust has safety mechanisms that will stop you from doing what you want, even when what you want to do is safe and sensible. There is a contradiction here that Rust enthusiasts endlessly make excuses for.
Rust is more like Go than C. Both Rust and Go can be used to write high performance services. Both Rust and Go have many modern convenience features. And both languages expect you to write code in a specific idiomatic way, wrt borrow checking and go channels respectively.
If you need shared memory and fine-grained locking for performance you're not going to have a good time. And that makes Go and Rust unsuitable for a large chunk of applications.
- cmrdporcupine 3y agoThis is simply false. Having written code like what you're talking about... There is always an escape-hatch. Rust just wants to make sure you really know what you're doing before letting you go there. The idea being to provide safety-minded well crafted but performant libraries where the hard thinking about atomics & locking and unsafe-bounded memory shenanigans are confined in well-tested locales. Also don't see why you're comparing with Go. Entirely different bowl of soup. Go is not a systems programming language.
- goku12 3y agoRust is used for writing entire OS (e.g Redox) or parts of the OS that needs precise management of resources (e.g Linux kernel, Windows). It is used to write parts of web browsers (servo and quantum parts of firefox), game engines and in embedded systems. It's used everywhere that traditionally used C, C++ or Ada. There really isn't a justification to dismiss Rust as a systems programming language. The limitations that you claim are not there. The reasons are there in the other reply to you.
- mike_hearn 3y agoThere is unsafe{} if you want to do something not normally allowed. But, well, it's unsafe. I was surprised to learn of a memory management vulnerability in a Rust serialization library the other day (for capn'proto). It was using unsafe. You'd think that serialization is the sort of library where Rust's guarantees are most valuable.