Hacker News new | ask | show | jobs
by danrocks 1192 days ago
I am asking genuinely, without implying anything and/or being sarcastic: why is the HN community so obsessed with Rust? It seems to show up on every programming-related thread and most times mentioned as a Swiss knife of a language, suitable for every task, from UI to firmware development - a departure from the more traditional view of certain languages being best for certain tasks.

I get the benefits of the language and would like to see it succeed, but real-world adoption seems to be way below what's imagined here, and the "good for every task" posts give it kind of a cultish vibe that makes me look away.

7 comments

You're likely getting downvoted because there is a comment like this on every Rust-related thread and people are tired of it.

Frankly, people are excited about Rust. It promises C-like performance and utility while being more expressive and much safer. Cargo is awesome. The level of quality of its ecosystem is, in general, unlike that of most other programming languages. At the end of the day, people are just really enthusiastic about it and want its community and ecosystem to grow so they can use it for more things. Is it sometimes taken too far? Absolutely, but you could say the same thing about most popular languages at some point: JS, Python, Java, etc.

I love cargo. Its the most ergonomic dependency manager and build tool I've ever worked with. I completely understand why there'd be a cult around it.
I see what you did there.
If that was the only premise ("C-like performance, etc.") then I can understand. What I don't is that there seems to be no use case for which Rust isn't good. That is the part that bothers me.
I'm a big fan of Rust, but I have to admit its up-front development costs are not always worth the trouble.

Rust isn't great for rapid prototyping, where Python excels. Python is quicker for the first few hundred LoC, but I quickly find myself reaching for Rust enums (aka ADTs or sum types), match expressions, and the assurances of static typing.

It's also a bit annoying dealing with &str vs String. I frequently find myself writing things like "foo".to_string().

It's also difficult to build Rust with Bazel, and possibly other non-Cargo build systems.

It isn't fast (really as far as you can get from "zero cost abstractions") but you can have Rusty enums via sum types in Python, and a poor man's match expression. It's not even that bad, really. With Pylance (or possibly mypy, haven't tried) the experience of writing typed Python is quite good.
> the experience of writing typed Python is quite good.

Except for all the third-party libraries that don't have type information, which was most of them last time I checked. (Maybe this has gotten better recently? I admit I haven't used Python much in about two years.)

> ...then I can understand. What I don't is that there seems to be no use case for which Rust isn't good.

Without knowing what specific comments you've based this observation on, I can only speak in generics but I do think there's some nuance around "Rust is good for this use case" versus "Rust can be used for this use case".

And, from my perspective, it is cool that one can use Rust for everything from "systems" software down the stack to UEFI & embedded realms and up through applications & WASM browser-based projects. (Whilst also acknowledging that one could also say the same for C or C++ or Javascript to varying degrees of integration/complexity.)

My personal experience has been approaching Rust primarily as a replacement for C/C++ where I find it compelling. For me (based on my relative usage over the past year) it's less compelling as a replacement for Python/GDScript for small/quick/hacky projects (primarily due to its compilation & analysis time/overhead) but I can see why for people who have previously worked on larger Python/Javascript projects it might be an attractive option.

One other aspect that I think affects how people relate to/talk about Rust is that there seems to be an express acknowledgement about the humanity of software developers which I'm unaware of existing to the same degree in other programming language communities/culture/history previously.

Any language choice comes with trade-offs and my impression of what you might be seeing is not so much that people think Rust is necessarily the best for all use-cases but that the trade-offs required for each use case are (or have the potential to be) worth it ("good") in exchange for what is gained.

I also respect that the Rust language development community admit they don't always get everything right, and that there's acknowledgement that Rust is neither a perfect language nor the last language and that one thing that Rust does is identify what can improved for "the next language after Rust".

How is that different than C++? The places where you would pick something like Python instead for expediency still apply…

To be honest, I used to feel the same way that you do about Rust posts. Then I started using it, and I got enthusiastic as well.

> there seems to be no use case for which Rust isn't good

You should read Why Not Rust (https://matklad.github.io/2020/09/20/why-not-rust.html). It was written by someone who has written a lost of Rust and likes the language, but acknowledges that it's not always the best tool.

It's a few years old, so not all of it holds up. For example, the author criticises the IDE tooling as immature. I don't think that's true in 2023. Coincidentally, the author created the official language server for Rust.

It's just the new hotness, that's all. When something comes down the pike and people get very excited about it, the tendency is to think it's the answer to All The Things.

This is particularly true with languages.

It will settle down, and Rust will become a respectable addition to the collection of useful languages. When that happens, it will have it's advocates and fans like any other language, but it all won't seem quite so over-the-top.

I've seen this same pattern play out many, many times over the years.

> What I don't is that there seems to be no use case for which Rust isn't good.

There are plenty of such cases and those raised constantly here and comment threads even slightly related to Rust.

I think there's a lot of it based in the fact that Rust was born at Mozilla and we want to see a modern language succeed that isn't tied to one of the big tech companies.
You can write games in C++ (Unreal Engine), C# (Unity and Godot), Java (LWJGL, as seen in Minecraft), Python (using PyGame), JavaScript (DOM/canvas or something fancier). Nobody is using PyGame for anything serious, and Minecraft is probably the only serious Java game, but you can still play around with those.

C++ is popular in the game industry, because it compiles to native code and can be fast. Rust can also do both of these things, and it’s also memory-safe and saner in general, so why not try writing games with it and improve the game stability and developer experience?

> and Minecraft is probably the only serious Java game

...and even Minecraft was ultimately re-written in C++ to bring it to mobile and consoles

I believe this is only true for the "Bedrock" version of the game, the "Java" edition is still written in Java.
As far as I know, Unity uses C# as scripting language and does the heavy lifting in C++. And the usual way for making mobile builds for Unity games is converting everything to C++ with IL2CPP and then compiling that to native binary.
As far as I know, web browsers use JavaScript as a scripting language and do the heavy lifting in C++.

Your average Unity game developer does not do anything in C++. The engine itself is implemented in C++, but the game logic written by game developers is in C#.

Rust is a genuinely interesting language but I think part of the problem is that a lot of the posts about it lately are just not. There's been a string of "we did generic boring thing everyone has been doing for a decade+ BUT IN RUST!!!!" articles lately that are not helping to dissuade the "cult vibes"

This link, for example, is... Boring? Like why is it here? What's to discuss? Should we just link to the PIP repository, too?

> Like why is it here?

I submitted the URL and enough people found it interesting, so it ended up on the frontpage. The same for every submission you find on the frontpage.

> What's to discuss?

The state of game development with Rust. Apparently there is a lot to discuss, as it's currently on the #1 spot on the frontpage, with 60 comments.

> Should we just link to the PIP repository, too?

You're welcome to submit whatever websites you want. If enough people find it interesting, there will discussion around then subject.

> Apparently there is a lot to discuss, as it's currently on the #1 spot on the frontpage, with 60 comments.

Half of which is "why/what is this" and "what's with the 'areweyet' thing?"

There's not a whole lot of discussion about game development in Rust going on, and less still about the actual content of the link.

I count 9 + 13 + 7 "AreWeXYet" comments while the rest of the 100 comments (129 - (9 + 13 + 7)) seems to be related to the subject. "Rust" is mentioned 137 times.

Unless you've manually counted all the comments, it seems like you're incorrect, most of the discussions are related to the subject at hand, compared to this thread you started here :)

Posts like this are for people interested in using Rust. It's advertising expanded functionality and access to more use cases. There are enough of those people on this site that it makes it to the front page. If you do not fall into the above class of people, then yes, this doesn't look interesting.

While I don't use or advocate for Rust in a professional capacity, I really like seeing the barrier to entry get lower and lower. In the same way that people fall back to Python for completely random tasks because it's familiar and the path forward is well mapped.

If adoption is below what one thinks is appropriate then one can take it upon herself to argue for it. So that it gains the kind of adoption that one thinks it deserves.

There’s nothing more to respond to your question beyond “agree to disagree”. You see the benefits of the language, want it to succeed, and get cultish vibes. Okay? There’s nothing to counter-argue here, beyond bickering about what is and what is not a cult.

Maybe criticize the language itself? That would be more fruitful.

(I see these kinds of comments on HN all the time: “I want to genuinely ask: why Thing? Why do you like Thing so much?.” And then there are a dozen replies giving stump speeches. I don’t get it.)

I’ve been working for 4 years in Rust codebases, the first 2 years were at Facebook. So from my point of view there’s a good chance I will continue to work with Rust for a very long time.

It’s simply a much nicer language to work with on many metrics, which are the ones that I consider important. Great developer experience, and great language.

Same reason they all hate blockchain and smart contracts, or many still believe that AI will be a net good for the world.

Groupthink.

I enjoy thinking and speaking based on fundamentals, regardless of what surface ideas people at large have. In fact, besides grounding me in facts and reality, it gives me a huge advantage as an entrepreneur, to be able to see possibilities people don’t.

Because of the zero-cost abstractions and memory safety.
Sure. Does that justify it being the best option for every development task? This is what I am puzzled by.
First you wrote:

> I am asking genuinely, without implying anything and/or being sarcastic:

Now you’ve written:

> Sure. Does that justify it being the best option for every development task? This is what I am puzzled by.

Your strawman hyperbole leads me to believe that your line of questioning is not genuine.

Isn't this a strawman? Are you sure somebody is making that point (I sure am not) or is an impression you get from reading isolated individuals using Rust for perfectly valid use cases.
Try it, enjoy it more than any other languages you’ve used before, want to use it everywhere you can