Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] Why Is Rust Programming Language Becoming So Popular? (frolicorg.com)
29 points by arihantparsoya on Aug 13, 2023 | hide | past | favorite | 48 comments



Vocal minority is a good thing to keep in mind when reading about Rust


It also solves very hard problems, that:

a) need solving

b) are expensive to fail at

This in an age where the easy problems are increasingly pre-solved by free libs, or can be solved fast and cheap by AI.

Rust is increasingly the best tool for high-value spaces where cheap and dirty options are obviously unworkable.


Vocal minority might be one of them. But I think that is not the only reason. I think it also because a lot of very useful and performant tools are being written in it. Also, the fact that so many programs are being created likely suggests to newcomers (like me) is that it is not unreasonably difficult to write code in it.


This feels AI written.


I agree. Each paragraph is formatted in the same way GPT responds. Covering a whole lot of topics without going deeper into a single one. All just general summarizations. And the recap at the end.. so obvious.


Is this the future, all articles are AI. Wasted energy trying to find something that is real.


Is it? I don't see anything in this article establishing it. It may be true, but it would be nice to have a proof of it at least.


I wouldn't say it's popular yet, but it has surpassed most niche languages, and it is growing.

https://lib.rs/stats

https://redmonk.com/rstephens/2023/05/16/top20-jan2023/


If you only take the system programming languages, Rust seems to do pretty well.


This article reads like someone dumped a bunch of random Rust facts into ChatGPT and told it to generate a blog post.


It’s not. There are quite a few people who wish they could use it at work (me included) but very few actually do.


Why is this blog post becoming so popular?


They're good at X.ing* out press releases and SEO.

*or whatever the verb to replacing "tweeting" is.

PS: Elon now has a kid with a nonsense name that's the textual equivalent of a tramp stamp. I feel sorry for the kid having unreasonable and unwise parents.


The prevalence of a given language in job ads seems to be a good signal, at least for job seekers.

I don't have hard numbers, but my impression from HN Who's Hiring posts is that Rust is gaining popularity and C++ is receding.


Independent of fads, I remember a bottom-feeder tech recruiter dismissing another language, Go, as a "nothingburger" in 2012. Hubris is on them, as with any arrogant proclamation steeped in ignorance. The people closest to niche but useful tools are the best to see their trajectory, regardless of media characterization of hype or apparent obscurity. Around 2016 I exited the Go scene for Rust because it became crowded with noisy, low-skilled, needy users who were leading to time suck without contributing much in return.


It’s not used in industry. C++ still dominates everything rust claims to be good at, turns out people with money on the line will not use a language that simultaneously takes away power from the programmer while also being more difficult to write.


It's used in industry. Obviously it's not yet comparable to the scale on which C++ is used in industry, but it absolutely is used.

* Amazon S3, Lambda and Fargate backends are written in Rust

* Microsoft Windows is actively shipping Rust code in both the kernel and userspace

* Android also ships Rust, and Google is writing some new components / has rewritten some older components in Rust

* The Linux kernel is getting new drivers written in Rust

* Much of the core infrastructure at Discord and Dropbox is written in Rust

* Cloudflare and Facebook have adopted / are adopting Rust in some of their critical systems

* The Disney+ client application is written in Rust

* Volvo is using Rust in their entertainment system

It's beyond the point where you can consider it an irrelevant internet fad language, or a self-contained bubble. There's shallow but meaningful penetration across a pretty wide swath of industries, including some fairly conservative ones, in places where it is very likely to "stick" for a good long while.

Surely you're not going to argue that Amazon, Microsoft, Google, Facebook, Cloudflare, Disney and Volvo don't have money on the line.


Full on the spot, yet some reality check is also required when talking about Rust.

Most language runtimes and compiler development frameworks aren't going to migrate from C++ into Rust anytime soon.

When I feel like contributing to JVM, CLR, node, GCC, LLVM, I need to provide my contribution in C++.

Same applies to anything related to GPU programming, AI frameworks, HPC, HFT, game console SDKs and major commercial engines.

Eventually it might be relevant enough that we can finally reach out for Rust in such domains, maybe even the reference compiler will be bootstrapped and no longer depend on C++, it will take some time though.


Sure, I don't dispute any of that. C++ isn't going anywhere anytime soon.

I only dispute OP's suggestion that "industry" has judged Rust to be unworthy of being used for anything important, because "it's too hard" or something. That's total nonsense.


And that I agree with.


But contributing to the Linux kernel in C++ is gonna get you laughed out of the room. For that, you famously must go back to C — and for good reason!


Yeah, and that should be lesson to Rust folks, some domains are religiously against anything but C.

I am still surprised how Linus as accepted it, as his C++ rants can apply equally well to Rust code full of macros and derivation annotations.

Not sure if the amount of Linux CVE caused by C is such a good reason, but then again, contrary to other OSes, there is Linus to make happy.


Maybe it's too polarizing as GP phrased it, but my anecdotal experience with two of the items you mentioned is wait and see, and having some early investment to not miss anything. C++ is still the safer bet, esp if you factor in the long term non-technical aspects like reliably finding talent, onboarding, and so on.

My 2c: rust productivity seems to be behind that of C++ atm (which is not surprising given the different maturity).


Meanwhile game engines, embedded, spaceflight, aerospace, automotive, financial infrastructure and high frequency trading, medical software, scientific computing etc. continue to be dominated by c/c++ with strong opposition to rust. Almost all of the companies you’ve listed have more c++ than rust, and significantly more new c++ code added to their public repositories every day than rust. google is an especially hilarious example to use in favour of rust when they’re developing an entirely new language to replace c++ themselves rather than use rust.


>with strong opposition to rust

This isn't evident. There's some discussion that Rust isn't ready for certain applications yet for one reason or another, e.g. compiler certification, but I have not seen "strong opposition" to the idea of using Rust once the the necessary preconditions are in place. On the contrary, my understanding is that there are some automotive partners working with Ferrocene on a certified Rust compiler, to open up those possibilities.

All of the industries you mention are notoriously slow-moving, so much so that they're often stuck on C89 and C++03. That they're not jumping to adopt Rust ASAP is not evidence that they hate Rust. Obviously, if they take a decade to upgrade to newer versions of the same language, they're not going to be quick to adopt a language that's not even a decade old.

> they’re developing an entirely new language to replace c++ themselves rather than use rust.

The literal announcement FAQ of Carbon said, quote, "if you can use Rust, ignore Carbon". They're making Carbon because they have massive amounts of C++ code that they want to seamlessly interoperate with. If you don't have that constraint, the Carbon developers recommend using Rust instead. They're not adopting Carbon "instead" of using Rust, they're adopting it alongside using Rust. They announced they're going to start using Rust in Chromium FFS!

I don't feel that you're being very honest in your arguments.


There is strong evidence, by the opinions of developers working in those industries. Because rust imposes more work onto the developer, it takes less time to write C++ and debug any safety issues than it does to get anything working in rust. There are C++ game engines with far fewer man hours put into them than bevy that have produced much more spectacular results.

Stop taking that quote out of context.

“Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should. Unfortunately, the designs of these languages present significant barriers to adoption and migration from C++. These barriers range from changes in the idiomatic design of software to performance overhead.”

Their recommendation is to use a language that is available now, one of which is rust, instead of waiting on carbon. They didn’t imply any technical advantage of rust over carbon, because there aren’t any. Being less flexible isn’t an advantage.


>There is strong evidence, by the opinions of developers working in those industries.

citation needed. I've listened to plenty of CppCon talks and people in those industries don't seem averse to using Rust, just pragmatic on the timelines.

BTW, Airbus Space & Defense is looking for an intern to experiment with using Rust. That's totally something that a company that hates Rust and has already decided to never ever use it would do.

https://ag.wd3.myworkdayjobs.com/en-US/Airbus/job/Manching/I...


Rust is C++ done well.

>turns out people with money on the line will not use a language that simultaneously takes away power from the programmer while also being more difficult to write.

Rust reduces the number of Bugs by being harder to write. C++ is already an incredibly complex and incoherent language, like any language "vendor lock in" works against people choosing the right tools.


It's only harder in the sense that it's picky about what will compile. In c++ a lot of things will compile that really shouldn't, but that cost doesn't get counted in the "hard to write" reckoning. Somehow people don't add in the "oh crap it segfaulted, and I have no idea why" risk. IMO it's far better to have something that won't compile giving you a headache than something that compiles and costs you an unknown amount of time later.

I still haven't had my rust code segfault. To get to the same place with c++ I had to run a whole load of tools that aren't the compiler, but that are also more obscure and not normally mentioned in the coding tutorials.


Yes, I wrote that in another comment. You gain something for your effort, which almost always makes it worth it.


Rust reduces productivity by being less powerful. Just look at the amount of copy and pasting/diy name mangling in the implementations of Axum and serde that are used to overcome the lack of overloading and variadics. The horrible interface of polars, the sheer verbosity of bevy. Macros galore, the dozen levels of indirection you’re forced to add by a supposedly zero cost borrow checker. No placement new, no Constexpr, no specialization, nothing. You can write c++ like rust, you can’t write rust like c++. if it wasn’t for backwards compatibility, c++ would have added almost every single selling point from rust like pattern matching and procedural macros, the only unique thing about rust would be the decisions it forces onto you and not the ones it allows. And that would truly show that it has nothing to offer. In fact carbon is that very language, a c++ with the features of rust that isn’t going to be held back by backwards compatibility. We’ll see in a decade which one has better adoption.


I think is true that C++ is the most complex programming language and historically didn't came with batteries included (e.g. basic stable and secure libraries that really abstract the problem at hand).

But I don't think Rust is C++ done well. It is another programming language. The Err and Ok could seem weird, traits could really be confusing. This is not against Rust, just saying that it is another programming language.


>The Err and Ok could seem weird, traits could really be confusing.

C++ allows similar error handling with std::optional (Some()/None in Rust) or std::variant (Err()/Ok() in Rust). C++ also has something similar to traits (with really unreadable syntax).

C++ just has a worse syntax for Error handling, since variants aren't enums. If you are using C++ I suggest you still make use of these concepts.


I wasn't saying either C++ or Rust are better or worse, just saying that Rust is not C++ done well which I think it is a very exaggerated claim.


And I pointed out that C++ includes somewhat worse versions of those concepts.


And where do you think C++ is better than Rust?


For my use cases, modern C++ is clearly more powerful/expressive than Rust in a couple areas today: metaprogramming and software where object lifetimes/ownership are unknowable at compile-time. These have a large impact on development productivity and software quality, so I'd be reluctant to give them up.

Rust has a bunch of other odd gaps, e.g. lack of proper thread-local support, but I can live with that.


> Rust is C++ done well.

Then Zig is C done well :)


This isn't exactly praiseworthy. If a language is so hard to write you can never actually produce a line of code, of course you will write zero bugs.


Of course there is a ballance. But Rust isn't indecipherable nonsense which nobody can grasp.

The language forces stronger assumptions about the code (e.g. lifetimes), which allows the compiler to guarantee that certain bugs can not happen.


If you can learn to use C++ correctly then, with the right time investment and motivation, then you can learn rust without problems.

The compiler mostly complains about things you wouldn't do in C++ anyway because it would either crash right now or it would be brittle code that would be easy to break later.

I knew enough C++ when I learned rust that I never perceived the lifetimes to be something that gets in the way.

My major pain points were:

* Leaning a new standard library, the names of common functions and common tasks to do things like handling strings, iterators etc. Nothing weird, just lots of new stuff to learn

* figuring out which libraries outside the stdlib are actually a de-facto stdlib that it's ok to just use/build around (assert_matches, bytes, ...)

* endless despair of async rust. Anyway you need to compare apples to apples, with the total cesspool that c++ coroutines are


Seems you are not arguing in good faith. What you say is true, but totally irrelevant: language creators are not trying to make useless languages.


Reductio ad absurdum is a valid logical argument. There's nothing bad faith about it.


I wouldn't call it bad faith, that's more when someone is evading the actual point.

However I doubt anyone hits a wall with rust where they can't get anything written.


It is used in industry, with caveats. You often see both C++ and Rust in the same company as complementary languages.

In my experience, the biggest issue is that it is nearly impossible find experienced Rust developers who are also domain experts for systems software. A common pattern I see is that people with Rust experience have almost no real systems software or other systems language experience, so the Rust developer pool tends to be quite junior in terms of relevant domain experience where C++ is the dominant language. Ideally, you want someone who was doing systems development in C++ for many years -- it is the only way to realistically have the domain expertise -- that then became an expert in the Rust language. These exist but are very rare.

As a consequence of this, another pattern I've seen is that a lot of the Rust development is moving a bit further up the stack, where the JVM commonly lives, because it is a better match for the domain experience of Rust software devs in practice. Rust has significant advantages relative to Java in many regards. I think Rust is quite brilliant in this role but that isn't how it is commonly positioned.

My controversial view is that Rust is more likely to replace Java than C++, and is significantly more competitive against Java than C++.


Once I grasped it I found it easier to write than C++. It doesn’t actually take away power, just the power to blow your feet off. Besides you can access C-like freedom with the unsafe keyword while making it easy to search for that keyword and audit any unsafe code.


This article was flagged, but the comments are good.


Meh! The hype around it does not hold in real world. There is some momentum in a few niches. Other than that, not much getting build with Rust.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: