HACKER Q&A
📣 ushakov

Why are hacker news readers so obsessed with Rust?


Currently, 5 out of 30 posts on the hackernews homepage contain the word "Rust"

could anyone explain why? is there a bias?


  👤 bjourne Accepted Answer ✓
My theory is that HN readers are obsessed with solutions. Good at identifying good solutions but oblivious to whether something is a good problem.

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.


👤 davidkunz
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/


👤 schoen
(This might not answer your question about people's social behavior.) I'm interested in Rust because it's a C-like language with similar use cases to C, with elaborate attention paid to making it easier to write correct programs and making it harder (sometimes impossible) to write large classes of bugs. It's giving a lot of programmers the experience of getting genuinely useful warnings and errors from the typechecker and other static analysis features in the compiler.

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.


👤 the__alchemist
Hi - this is a diverse group, so I suspect you'll find it's an averaging phenomenon vice a specific use.

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.


👤 infamouscow
This community is as susceptible to fashion trends as any other.

👤 solmag
There's always bias. And it's a nice language.

👤 lostdog
I work in a domain that requires C++-like performance, but I'd really like to stop hitting all the usual issues with C++. Rust can free me from difficult std::move rules, no global build and packaging system, incoherent error checking, and ridiculous templating error messages. I would love to switch to a language with a clear type system and tooling.

Unfortunately, Rust suffers from the same long build times as C++, so it's no longer as glamorous to me.


👤 ArtWomb
* Rust is 2x faster, but uses only 1% of memory of Java

* 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 ;)


👤 dcminter
An earlier discussion (4 months ago) in much the same vein: https://news.ycombinator.com/item?id=25742928

👤 iExploder
the real question is, why are they not obsessed with Zig

👤 dyingkneepad
And you just bumped it to 6 out of 30 :)

Why are you so obsessed with Rust?