7 ms·
Years ago, when I initially picked up Rust, I loved it. It does a lot of things right. At the same time, though, I knew there was a possibility of it going wron
by gorjusborg 10mo ago
Years ago, when I initially picked up Rust, I loved it. It does a lot of things right. At the same time, though, I knew there was a possibility of it going wrong in two opposite directions:
1. Developers balked at being required to take on the cognitive load required to allow GC-less memory management
2. Developers wore their ability to take on that cognitive load as a badge of honor, despite it not being in their best interest
I eventually came to the decision to stop developing in Rust, despite its popularity. It is really cool that its creators pulled it off. It was quite an achievement, given how different it was when it came out. I think that if I had to implement a critical library I would consider using Rust for it, but as a general programming language I want something that allows me to focus my mental facilities on the complexities of the actual problem domain, and I felt that it was too often too difficult to do that with Rust.
- azaras 10mo agoWhat are you developing in?
- gorjusborg 10mo agoDepends on the problem at hand. Zig where I used to use C/Rust (but admittedly I spent the least time here). Go where I used to use Java. Bun/Node for typescript/javascript, where each is appropriate, but I favor Bun for standalone application programming and local scripting.
- littlestymaar 10mo ago> Zig where I used to use C/Rust (but admittedly I spent the least time here). I really don't understand how that fit with the “I want something that allows me to focus my mental facilities on the complexities of the actual problem domain”. For low-level stuff, Rust allows to offload the cognitive load of maintaining the ownership requirements to the machine. On the opposite, Zig is exactly like C as it forces you to think about it all the time or you just shoot yourself in the foot at the first opportunity… For stuff that can be done with managed languages, then absolutely, the GC allows to completely ignore that aspect, at the cost of some performance you don't always care about because how fast the modern hardware is.
- zozbot234 10mo agoRust does not require GC-less memory management. It supports reference counting out of the box, and reference counting is a kind of GC. It's not inherently any harder to use than Swift (another memory-safe language) which plenty of average developers use to code for Apple platforms.
- pron 10mo agoI think it is significantly harder to use than Swift, and inherently so.
- simonask 10mo agoI don’t think it’s a useful observation. Lots of people come to Rust from OOP languages and try to make everything `Arc<dyn Interface>`, and it immediately fails, to their great frustration. Do not do this.
- moritzruth 10mo agoWhy would it fail?
- simonask 10mo agoIt's fine as long as the graph of references is immutable, or is unidirectional/acyclic with unique ownership. If you have backreferences or "parent pointers", you need `Arc<Mutex<...>>` or `Rc<RefCell<...>>`, and then you run into trouble as you encounter the same node multiple times while traversing the graph, because you cannot hold a mutex lock or mutably borrow `RefCell` twice in the same call stack. The solution with much less resistance in Rust is to go for a data-oriented representation. If you really need an actual graph of objects, separate the node data from the topology metadata, and refer to the nodes using an ID or index. (As an extra bonus, this also gives you much better cache locality.)
- K0nserv 10mo agoIt's not quite a fully formed argument, but I'm coming to the view that Rust mostly requires less cognitive load than other languages. I'm coming at this from the perspective of "cognitive load" meaning, roughly "the measure of the number of things you need to keep in working memory". Rust is no doubt difficult to learn, there are many concepts and a lot of syntax, but when you grasp it cognitive load is actually lower. Rust encodes so much more about the program in text than peer languages so there are fewer things to keep in your head. One good example of this is pointer lifetimes in Zig and C which you have to keep in your head, whereas in Rust you don't. My own appreciation for Rust is rooted in humility. I know I'm an overgrown monkey prone to all kinds of mistakes. I appreciate Rust for helping me avoid that side of me
- zozbot234 10mo ago> Rust is no doubt difficult to learn, there are many concepts and a lot of syntax People love to say this, but C++ is routinely taught as a first programming language to novice programmers (this used to be even more clearly the case before Java and Python largely took on that role) and Rust is undoubtedly simpler than C++.
- tehjoker 10mo agoThat's true, but as someone that doesn't do much rust, C++ is a language where there are fewer restrictions and you can use little parts of the language, whereas Rust is supposed to be a simpler language overall, but with more concepts to learn up-front to prevent things that happen where there are no rules....
- zozbot234 10mo agoYou can use "little parts of the language" in Rust too; the cleanest and most foundational part of Rust is pure value-based programming with no mutability or referencing at all, much like in a functional language (but with affine types!). Everything else is built quite cleanly on top of that foundation, even interior mutability which is often considered incredibly obscure. (It's called "interior" because the outer cell's identity doesn't really mutate, even though its content obviously does.)
- mountainriver 10mo agoI feel like vibe coding has completely changed this paradigm. Now all I care about is how fast and reliable the language is.
- DANmode 10mo agoProbably throw in a dash of “is my model trained on this language sufficiently to perform this task well”.
- pron 10mo ago> I eventually came to the decision to stop developing in Rust, despite its popularity It's also not popular for a language that old. It's roughly as popular as Ada was when it was the same age Rust is today (there may not have been as many projects written in Ada then, but there were certainly much bigger/more important projects being written in Ada then). It's not nearly as popular as C, or C++, or Java, or C#, or Go were at that age. The relatively small number of developers who program in Rust, and the smaller still number of them who use it at work, are certainly very enthusuastic about it, but an enthusiastic "base" and popularity are very different things.
- Klonoar 10mo agoIt has routinely topped lists and surveys of most popular languages for years now.
- pron 10mo agoThe only lists it's topped are for likeability by users, where it was followed by Elixir and Clojure. If we go by the meaning of popularity that suggests how many people use these languages, let alone professionally, their ratings are quite low (e.g. https://www.devjobsscanner.com/blog/top-8-most-demanded-programming-languages/ https://www.devjobsscanner.com/blog/top-8-most-demanded-prog...). Considering how old Rust is, the numbers are significantly lower than of any language that's become truly popular (as in widespread). An old language used by so few people can be many things, but "popular" isn't one of them.
- Klonoar 10mo agoYou're citing language demand as a result of incumbent industry usage. That's an inherently weighted metric because existing products are not (contrary to what some Rust zealots might want) going to be rewritten in Rust for no reason. i.e, it's not rocket science - languages with 10-20+ year history are embedded in the industry. News at 11. ;P Popularity - as the term is actually used - is one where Rust is fine.
- brainless 10mo agoMy experience has been the opposite. I came from Python and Typescript and the initial amount of reading and fighting with the compiler was very frustrating but I understood one thing that sets Rust apart - I write code with almost the same level of bugs as a seasoned Rust developer. That is a win for years to come as team grows and software gets old. I will bet on it again and again. Now I mostly generate code with coding agents and almost everything I create is Rust based - web backend to desktop app. Let the LLM/agent fight with the compiler.
- snthpy 10mo agoSo what do you use instead now?