4 ms·
What is the complexity, and what are its costs? As an active user of Rust, I haven't seen the (adverse) complexity or its costs yet. It's worth pointing out th
by mcqueenjordan 7y ago
What is the complexity, and what are its costs? As an active user of Rust, I haven't seen the (adverse) complexity or its costs yet.
It's worth pointing out that Rust combats more than undefined behavior. Undefined behavior is a category of bad things that Rust works to eliminate, but Ownership goes beyond eliminating UB, and eliminates a large swath of potential logic bugs.
- Thaxll 7y agoProgramming in Rust is complex, I'm not sure how can argue against that, it is not straight forward to do simple tasks because of how you need to organise your architecture with the borrow checker. Most people that starts using Rust get stuck on issues that you woudn't have with other languages.
- steveklabnik 7y agoIt’s not that simple. Rust’s rules also make more complex tasks specifically easier, at least for me. YMMV.
- adamnemecek 7y ago> Programming in Rust is complex Make a distinction between programming and the overall programmer experience. C++ is not a simple language and it feels like some of the the rules are arbitrary, vendor dependent, or for the same of backwards compatibility. When programming C++ at scale you start dealing with manifest files. Different understanding of C++ (templates/precompiler? exceptions? std? the list goes on). Rust on the other hand is mostly pleasant. Sometimes I have problems with cargo. However like C++ build systems made life legitimately miserable sometimes. I'm really excited for Rust. I think that at some point it might replace large parts of the OS. I can imagine important parts of the internet (DNS servers, caching servers etc) running on raw hardware. Your OS eats too much of your perf. You are right, some parts of Rust are tricky (still working out proc_macros) however you get a lot of power from these. It also feels like the Rust team really thinks ahead. Like C++ is still working on the Range type. Originally, it was supposed to be in C++03 but that didn't happen and here we are 17 years later still waiting. You can say things like that the type system doesn't support higher kinded types and such. You are right and I think that at some point, Rust will get them, right now there are more important battles. Whoever manages to implement them will be crowned the king of Rust I'm sure.
- estebank 7y agoIn my experience the difficulty of picking up Rust is most pronounced for people experienced in other languages that have common design patterns that are discouraged or made impossible by Rust. It's harder to unlearn something that from your point of view works (even if it had hidden or clear drawbacks) when you're also having to learn other things simultaneously. Also, I feel the biggest hurdle Rust has for experienced developers from other languages is that Rust makes some ineficient code visible, but the way of optimizing it requires delving into more advanced parts of the language, frustrating people when they are most "vulnerable". This is where the common piece of advice for people starting with rust "just clone for now and don't think about it" comes from: get used to the language first and deal with borrowing on its own at a later time. But all of this frustrating learning curve comes to fruition later in when writing code because the experience is closer to pair programming with the compiler rather than trying things in a vacuum on your own.
- zozbot234 7y agoThe "rules" that the borrow checker enforces are the rules of functional programming, except in an extended form that adds flexibility to many tasks as opposed to removing it. The main point is to not share and mutate objects at the same time, because that comes with inherently unclear semantics and a high potential for bugs. (Rust has mechanisms for shared mutability, but even those trigger runtime checks to ensure you aren't actually doing anything that would be bug-prone in that way.)