2 ms·
I think Rust is popular because the end product is nice: It's usually fast and safe. However, I'm not sure if it's reasonable to pick Rust for programs which c
by davidkunz 5y ago
I think Rust is popular because the end product is nice: It's usually fast and safe.
However, I'm not sure if it's reasonable to pick Rust for programs which contain a lot of 'business logic' compromised of complicated domain models. It's just really hard to model it with the enforcements of the borrow checker, even a doubly linked list is hard.
I wish more people would consider languages like Nim instead. Having tried both, Nim is just more pleasant to write and read as you can capture the intent without polluting your code base with technical artifacts like Box, Rc, Arc, .... When I write Rust, a week later I don't understand my code anymore. Without the (very helpful) error messages from the compiler, I couldn't write Rust without compile-time errors, ergo I've got a hard time understanding already written code. Give me two programs in Rust and Nim and I will be able to understand the Nim code in a fraction of the time... and I learned Rust for several months and Nim only for a week. And Rust is also very inflexible, library authors must take great care in designing their APIs as the degree of freedom is quite high and can quicky diminish certain use cases. Nim on the other hand is pretty straight forward, not many ways to shoot yourself in the foot.
And the final product is so similar in performance that it really doesn't matter for many use cases.
So I cannot explain the bias.
Try Nim: https://nim-lang.org/ https://nim-lang.org/
- jokethrowaway 5y agoYou're buying safety with those "technical artifacts". Also, not having GC. I find Rust code pretty easy to read, but writing it is a compiler driven process. It's similar to how I work with Haskell and I like that process: you write your intention, make it compile (and catch a few bugs and typos) and often times things work as expected. Zig is another language to consider if you like Nim; still the community in Rust is pretty rad and it will take time for those languages to catch up in terms of ecosystem.