Hacker News new | ask | show | jobs
by danrocks 1190 days ago
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.
8 comments

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.