Ask HN: Why are hacker news readers so obsessed with Rust?
could anyone explain why? is there a bias?
could anyone explain why? is there a bias?
Rust is a good solution to how to write software that is somewhat safer than C but rivals it in performance and doesn't require you to learn C++. But the problem itself is not something most programmers struggle with and hence Rust won't go anywhere (unless it gets the same kind of enterprise support Java has/had).
Node.js is a good solution to how to write single-threaded asynchronous programs in a scripting language. Not a problem most of us struggles with.
Erlang is a good solution to how to simulate thousands of message-passing processes. Also not a good problem.
MongoDB is (purportedly) a good solution to how to scale a database to tens of thousands of requests per second. A problem affecting perhaps 0.001% of all database developers. For the rest of us PostgreSQL works fine.
2^10 Javascript frameworks solves the problem on how to make web pages behave like desktop apps. Turns out users hate that.
Sooner or later, someone will release a database/web framework/programming language/whatever designed to be perfect for programmers working in the low-gravity environment on Mars. It will be hyped up as the best invention since sliced bread.
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/
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.
I'm not sufficiently proficient in Rust to fully appreciate these things yet, but it's also supposed to be nice for programming ergonomics and tooling.
I agree with this but I really would have 0 use cases for Rust. I am not a systems programmer or really want to be. I prefer product focus and user interfaces.
I would not want to do typical web back end programming with Rust. I think Rust is perfect for the hard work of lower level things but I'm a crazy sucker for a fast feedback cycle loop.
What I personally really want is faster Python/Ruby (Nim/Julia/Crystal) and they should be languages that allow for great interop with the newer lower level languages like Rust and Zig for when the 1% of speed matters.
By the way, have you tried PyPy?
It's an alternative Python interpreter with a JIT (so compiling in-memory to native code) that is much faster than the standard CPython for many Python tasks, especially those that are particularly compute-bound.
I was impressed at how fast some math-oriented Python programs that I wrote ran in PyPy. There are some extensive technical limitations, but it works out-of-the-box for many codebases.
It's an expressive, typed language with a powerful package manager.
Yes, you lose prototyping speed by thinking about memory and safety but the development experience is pretty neat.
I'm using it for writing web servers mainly because of the rich type system. The speed and low memory usage is a nice bonus.
My background: Military. No coding classes or jobs. Have worked mainly on projects myself (scheduling tools for work etc), or open source. Have used Python, Javascript/Typescript, Julia, a bit of C, and Rust.
Rust is just... a very nice language. It's versatile, has outstanding official tooling, is one of only a few choices for bare metal, and it's easy to find help from enthusiasts.
I'm using Rust mainly in embedded now (Cortex-M)- where, I believe, it's objectively the best language available. You can apply Rust to other domains (eg web servers) where it'll work, but I think it really shines for bare-metal programming. This is both due to the well-known memory safety advantages, and the overall tooling and language features.
I'm designing commercial projects. The firmware is in Rust, but the website is in Python and JS... It's about choosing the right tool for the job.
Unfortunately, Rust suffers from the same long build times as C++, so it's no longer as glamorous to me.
* 25x faster than Python on ML tasks
* Rust and WebAssembly can be 15x faster than compiled Scala
Source: https://www.secondstate.io/articles/performance-rust-wasm/
I think the last one (rust-wasm) is crucial. It's supported by Cloudflare Workers. Seems to be the platform of choice for many new Web3 projects ;)
Why are you so obsessed with Rust?