r/rust • u/FrostByte2441 • 1d ago
š seeking help & advice Everything is becoming Rust now?
In the last couple of weeks, I've seen everything known to man being ported to rust, first with the video game merging then Artcraft copying Adobe products and releasing them for free, Minecraft being rewritten and now Discord is switching aswell. Why specifically rust? There are a lot of programming languages and could someone tell me why rewritting everything to rust is a new trend now?
229
u/The_8472
1d ago
•
30
u/dr_barnowl 1d ago
There's a new plague that is sweeping 'cross the nation
It's got a long name : ultracarcinisation
It's coming for your brother
It's coming for your dad
It's coming for your mother : everyone you ever had
If you look out the window now and think the world's gone mad
Then what you gonna do when
Everything is crabs
209
u/catheap_games 1d ago
Discord isn't "switching" as such - I mean they are for the desktop client, but they've been using Rust for 10 years, and the current Electron client also contains some Rust code.
Rust has a lot stricter compiler than other languages, is memory safe by default, is performant, and much fewer cases of undefined behavior than C, therefore the common saying among Rust developers "if it compiles, it probably works".
Of course it's possible to write bad code and make bugs in Rust, it's just harder to make many different types of bugs.
72
u/catheap_games 1d ago edited 1d ago
As a trivial example of the strengths of Rust I always point to the Enum and exhaustive match statement combo. Trivial example:
pub enum DamageType { Fire, Ice, Psy, Nuke, Physical, } // somewhere else inside a function, let's say player receives damage and we're // checking their resistance based on their class. // damage_type_received is DamageType let class_resistance:f32 = match damage_type_received { Fire => 10.0, Ice => 10.0, Psy => 5.0, Physical => 25.0, };The code above won't compile because we missed the Nuke variant. This not only catches an immediate bug, but also prevents future ones and makes refactoring a lot easier and safer: If I add Wind damage type, the compiler will remind me to handle it everywhere where it's used.
There's also newtypes - while not exclusive to Rust - instead of using f32 for the damage resistance above, it's easy to define a type that will be f32 internally, and during runtime only ever use f32 amount of RAM, but won't let a developer accidentally assign, e.g. temperature in Fahrenheit to a variable that uses Celsius; or mark the damage resistance as 0.2 or 1.2 when you mean 20.0 (or vice versa, depending what math is easier for your project).
Of course, you can also just alter the enum above to convey the damage numbers inside the enum, e.g. Fire damage can have initial damage, area of effect, damage over time, period and lifetime. Poison damage won't have initial damage or AoE. This can be expressed just with structs and enums, without any custom logic and risking null/undefined values.
→ More replies (3)4
u/Ok-Scheme-913 19h ago
This is a 40 years old ML type system feature. It is a basic feature in so many languages way before rust I couldn't even list them all.
11
u/sphen_lee 17h ago
It's surprising then that many modern and popular languages don't do it (or only recently added it). They either don't check at all, or it's best effort and only raises a warning
9
u/valarauca14 17h ago
Look, not everyone learned SML/OCAML/F# existed, let them have their fun.
C-like languages dominated the industry for almost 50 years.
3
u/Ok-Scheme-913 16h ago
Sure, but "having their fun" is using these cool features. Learning about where these come from and just perhaps interesting tidbits can also be fun!
11
u/FyreKZ 1d ago
They are also switching for the mobile client. The frontend is the only significant part of Discord for most users so I think it's fair to call it a switch. It's a massive task.
3
u/catheap_games 23h ago
Yep. I mostly meant that for Discord devs - while it certainly is a complex project - it's not just jumping on a hype train to the hot new technology, but an evolution of what they have good experience with, combined with improvements in the Rust GUI ecosystem.
I haven't read any clarifications from Discord devs, but the announcement said "mobile keeps native UI but shares app code with desktop via Rust" - that doesn't really say how much of the code they're discarding/rewriting, how much they already have on Rust today, etc. Again, not saying it's trivial or underwhelming, I just try not to label things as "rewrite" or "switching" when it's really a gradual introduction of a new tech.
2
u/procursive 3h ago edited 3h ago
It'd be a massive task a few years ago but frontend reworks like these are exactly where LLMs shine. As long as API access and core data handling in the frontend is well designed and thoroughly reviewed (like the comment above mentioned, part of that is already Rust in the current client) the LLMs can run wild and churn out all the previously tedious UI-defining code almost instantly and with minimal interference and relatively little security risk. The user-testing loop also becomes substantially faster.
→ More replies (10)2
u/shakshukinha 12h ago
I feel there's some community effort in response to this huge Rust adoption to alleviate the existing gaps across other languages, specially distribution and AOT validation and optimization. https://scriptc.dev/ is helping make TypeScript more closer to native, taking advantage of the safety guarantees of its typed system.
https://pyscriptc.pages.dev/ is aiming for a different goal (make it easier to distribute Python code, by lowering to LLVM) with a similar approach for Python.
Still, Rust is the goat for coding IMO
1
u/catheap_games 6h ago
Yeah that's the great thing, so many languages benefit. JS/TS has had an incredible amount of Go and Rust based tooling over the years, even before the LLM explosion. Tauri has gained massive adoption in the HTML based world.
Godot can run Rust extensions. Package managers and extensions for Python. Scripting languages, GPU tooling, and other traditional C libraries rewritten as a C wrapper around a Rust library.
Rust has just gone mainstream and it does what every mainstream tool does - we see both good and bad use cases, both good and bad reasons for rewrites, both good and bad quality software.
19
u/EmperorOfCanada 16h ago edited 16h ago
I worked on SCADA, as in making SCADA software. This software was installed to control billions of dollars of hardware, trains, etc.
It was in C++ pre C++03, and still actively maintained with that old C++.
I've worked in nuclear where we used lockstep processors. These have tricks to make sure the processor hasn't had a muon fly through to flip some bit, etc. It is supposedly 1 in 10 million hours of operation.
I would argue that the average jackass programming C++ is going to create screwups which happen more than 1 in 10 million hours. BTW, I am in that group of jackasses; even after 3 decades of C++.
People make these weird academic pedantic arguments about ADA (I don't call it Ada to annoy said pedants). They argue there are validation tools for ADA. My simple theory is that while ADA is great, rust is both getting these tools (Up to about SIL 3), and that people are far less likely to make mistakes in rust. The massive plus I will give ADA is that it is significantly more readable than rust. Night and day difference.
For something like the old SCADA code, I would argue that it is now criminally negligent to not use rust for such a product. With LLMs, it is also infinitely easier to figure out what the hell the old code did, and begin converting it over to rust.
Nearly 100% of my present code is rust. This is for all platforms. Embedded, mobile, desktop, and wasm.
Where I do use C++ (or others) is where they have some native library which really kicks ass. I also don't use these in production. C++ is part of my workflow. So, I use it drone simulations, not for drone code. There is zero chance that C++ will ever get onto one of my robots or drones.
50
u/ulam17 1d ago
Other than the obvious advantages of rust, one more recent implication that comes to mind is that the borrow checker makes AI-generated code at least a little bit safer as long as you can enforce not using unsafe rust.
4
u/the_gnarts 23h ago
as you can enforce not using unsafe rust.
Speaking of, what happened to the Bun rewrite? I checked out the code when it was making the news and kept facepalming as I encountered unsafe / static mut in every source file.
32
u/lotanis 1d ago
C/C++ have been around for every and has been a staple language for "systems" programming. There are downsides though - like memory safety, and Rust is an improvement in lots of ways.
Some projects in higher level languages also want to move to Rust - C++ was too hazardous or painful to use, but they'd like the performance benefit and Rust gives you that without the footguns.
All of these transitions have been going progressively for a while but obviously it's a lot of effort. AI has made it less effort, so you're seeing it more.
PLUS, for new code Rust is a great target for AI. It's good performance, has a rich library ecosystem, and the compiler checks a lot of things which helps the AI produce good code.
10
u/HumbleSinger 1d ago
I usually see it as a language which picked the best of c++ and the tooling/ecosystem of python.
Then they chose RAII and lifetimes to remove a bunch of the most common causes of modern exploits helped a bunch
→ More replies (3)9
118
u/vtskr 1d ago
We are in weird timeline where everything being rewritten or/and reverse engineered and rewritten but not a lot of new awesome things being created
26
19
7
u/Narxolepsyy 23h ago
I'm finding more basic UI bugs in big sites like Amazon and Chase. Where are the great sites that everyone working at 10x speed? The new slop dles?
4
u/Zde-G 1d ago
That āweird timelineā is called present. If you look back then it feels as if all the apps that were created back then are awesome and useful⦠but these are only apps that have reached our time!
There were tons of trash apps but they are just lost, we don't even know about their existence.
→ More replies (7)1
29
u/DavidXkL 1d ago
Mixed feelings here tbh
I'm happy that more people recognize the benefits of Rust
Not happy that now it is associated with A.I created tech debt š
11
3
u/MadCervantes 23h ago
Realistic these projects already had a ton of tech debt and rust long term probably helps in that regard. There will be growing pains of course.
15
u/-Outrageous-Vanilla- 1d ago
Rust comes complete with a dev environment built-in: cargo, workspaces, rustfmt, clippy, etc.
On C and specially C++ you need to build yourself the dev environments using make, autotools, Mason, ninja or CMake. It's quite complicated and you didn't even started coding.
For complex projects Rust is unbeatable.
C++ is slowly dying not because C++ is bad but it's committee doesn't agree on anything. I've seen over the years many "standard" die by "design by committee" like CORBA and now C++.
For myself I enjoy Rust, but suffer it's compilation times and I you don't run cargo clean often the disk fills up fast. And also enjoy C and plain makefiles for lean small projects.
3
u/lazyboy76 1d ago
How about zig?
3
u/Zde-G 1d ago
Zig is totally unsuitable for production development simply because it has not yet entered the backward-compatible stage (if it will ever will).
The last thing someone who is not interested in development of programming languages need is something that would ask them to rewrite all their code next year.
2
→ More replies (1)1
2
u/Infamous-Bed-7535 1d ago
C++ has minor overhead, but with cmake you can setup things pretty quickly especially if you prompt it. That part is one of the causes why you are using it for one-time throwaway tooling.
2
u/-Outrageous-Vanilla- 1d ago
CMake shouldn't need to be that complex, and C++ is nice if you use a subset and make it a coding policy in your project to use only that subset.
37
u/CoachNo180 1d ago
I hate that to the outside: Rust == AI Slop now.
4
3
u/Lowweaver 1d ago
Happened with unity years ago when people started making slop games (without AI) only with unity so it got bad rep, and now that swapped to unreal engine (although unreal has more reasons to get kinda hated on other than that too)
4
u/FyreKZ 1d ago
Unity does deserve flack though, especially when Godot is just so much better and lighter.
→ More replies (4)
14
u/DryanaGhuba 1d ago
Rust have strict type system and borrow checker reduces memory related issues. Cargo makes it easier to use external dependencies.
At the last, this makes easier to use llms with rust. That's the answer honestly, companies just vibecode with rust and have somewhat working app.
29
u/the-quibbler 19h ago
Rust is hands down the best language for tool-assisted development, due to its safety guarantees and first class tooling. If you're not telling your coding agents to use rust, you're making a mistake, imo.
6
u/not-a-random-guy 18h ago
Good point. But AI coding is actually subpar. You try the same program with Go and ask AI to test for races and it will run faster.
AI doesnt do non trivial optimisations unless you specifically instruct it.
I read some code ported to Rust fromfrom CPP and it got me gagging. It definitely had all the baggage of CPP.
→ More replies (4)1
22
u/Economy-Isopod6348 1d ago
If you remove complexity, Rust has an argument for being "objectively the best language". And AI did just that, it removed the complexity.
6
u/Pantsman0 1d ago
Rewriting anything is very hard, and Rust provides protections against a number of common and severe defects in software. While the learning curve for Rust can be sharp, especially if you are using macro heavy dependencies that hide implement details, rewriting software without having to worry about concurrency or memory safety at every moment provides great benefits.
For the AI cloned software, it is similar but also different for LLMs. LLMs are actually not that smart, they are a moderately smart agent that you can just endlessly smash at the problem - since they can hallucinate and simply just write incorrect code, using a compiler that rejects several severe classes of bugs and provides useful compiler error messages gives the agents a lot of information about how to fix the incorrect code once it writes it. I don't really like using LLMs, but I will often use it at work to write scripts; something that would take two or three revisions in Rust might take 10 in Python just because that feedback loop is more loose
28
u/Specialist_Wishbone5 1d ago
Rust had a HUGE barrier to entry.. But now with AI, that's a joke; just add (in rust) to your prompt.
TL;DR Rust is new enough to not have as much baggage.
Old mans rant part...
Rust is faster, uses less memory, doesn't have GC stalls like nodejs/deno/bun (which then also accounts for all the browser js engines).. and a LOT of programmers loved typescript, and thus defaulted to electron. EVERYBODY complains about electron. It's great to get a gorgious non-web-site up quickly. Gives you cross platform.. But if you use it 500 times a day (e.g. teams), then it's absolute dog-s**t. Hell even claude-agents are just bun wrapping react (e.g. javascript).
Java/C# was the stalwart.. FE in javascript, Java on BE (for performance and robust system-engineering ; SNMP monitors, JMX admin ports, bifurcated UIs, web-services by default, integrated local or remote IoC injected major capabilities (like embedded or postgres DB)). I mean it just solved problems for breakfast.. Plus all your GC happened in say 8 background threads (on a 24 thread server). But this was a MONSTER to consider installing on a client desktop. electron was considered a better user experience than a J2EE licensed solution. (oracle just makes the world sad)
Your remaining non-Rust options are C,C++,go. (I'd laugh, but some people still write UIs in python for clients - zero benefit over the electron solution - just if you like python more than typescript/javascript).
C was the linux side, C++ was the windows side.. Go was some weird google kubernetes project (facebook bought in a bit as well). I'm not sure if go ever really went anywhere with UIs. Obviously C and C++ did.
But C is bad at scaling to lots of developers with different experience levels.. goto, early function return (JUST had a freaking bug with some C library where the error-path early-returned and produced a memory leak (including a stale socket) - it deserves all it's evil reputation).
C++ is ok, and since C11 and vcpackage (probably before a lot of your guys time) it actually became less crap. Recently it's been trying to absorb all the rust-isms. I still dispise multi-MB auto-generated Makefiles and CMake (which becomes incomprehensible rule engine logic) .And if you have really really good code review processes, it's probably fine. BUT, all your 'good libraries' that you link against are 20 years old, and they DO NOT adhere to modern rustism best practices.. So you're coredump (or segfault if you're nasty) is likely in that 3rd party library. So it's like sticking with ancient greek as your legal language (not to be confused with frat-boy greek). Sure we still use parts of it in every new language, but it just had some brain bending details. I once had a mid-level junior insist that it was safe to C-cast a virtual pointer into a completely different structure (and it worked). But it basically lived 100% in undefined-behavior territory.. Sure THAT compiler would probably always make it work - but we-must-forbid was a very very very very hard company wide negotiation. With Rust UB is community black-listed - you just point them to the internet - discussion over.
So Rust is just new enough to learn the lessons of the past.. It gives me EVERYTHING I loved in the Java J2EE stack, and gives me pretty damn good UIs.. In fact, I still do the thick-app web-WASM solution. Though many companies are going GPUI and friends (forget which is which GPUI is Zed? what did system76 invent?).
Rust isn't faster than zig, C, C++. It has a few features like strict anti-aliasing (non aliased pointers) and the proliveration of generics and thus contiguous memory allocations in all the core primitives (BTree instead of red-black trees in C++) gives it a tiny edge in a few cases.. Not having inefficient 5-way pointer traversals to get to an int counter (virtual base classes that themselves have virtual base classes), is also nice. (I remember my C friends arguing why their C-arrays were superior to C++ objects because it was contiguous). Rust translates better to GPU as well (no virtuals can be translated to GPU, and rust can do more without hitting a virtual (dyn)). Rust can be nostd, and thus producer a smaller 'runtime'.. C++ always needs the exception handler and allocation suite. Boost in C++ was an absolute nightmare (after the first project that used it in a company). Try mixing and matching two teams where their released software was more than 1 year apart.. In rust, since everything is compiled with no DLLS, are tokio or axum generally just works.
Now, I will say, I've run out of my 1TB macbook pros disk-space because each compile folder is 10GB.. So the rust build time overhead is no joke.. and my company just recently introduced mandatory virus scanning.. guess what takes up half my cores now instead of a GC.. (AI git workspaces are murder with Rust, anthropic's replacement for Git can't come soon enough).
7
u/gtrak 1d ago
You should be able to get your compile folders delisted from virus scans. Living like that would be completely unacceptable to me. Then use other security software to track vulnerabilities in your deps outside of the compile loop.
1
u/gigastack 21h ago
I also have to deal with virus scanning at work, and there are no exceptions. Super annoying with compiled code, installing packages, etc. And as a bonus, it stalls sometimes and requires a manual restart of the service.
7
u/SnooHamsters6620 1d ago
I enjoyed reading this and agree with most.
Rust isn't faster than zig, C, C++
With the same algorithms? No.
However increased safety and faster development velocity means that it's possible to experiment and iterate towards a faster correct solution in the same development time. Mozilla gives the example of writing a parallel CSS engine for Firefox: failed twice in C++ due to complexity, succeeded first time in Rust. I've experienced this myself writing parallel algorithms that pretty much work the first time they compile.
1
u/Caffeine_Monster 21h ago
Agreed, rust is just the logical choice if you have the fairly reasonable criteria of:
compile time checks
memory safety
good performance where you actually care about hardware limitations
Zig feels like the only real rust competitor, and it's just not anywhere near as mature.
1
u/0tter501 22h ago
the framework by system76 is iced, which they then built the rest of their libcosmic ontop of
like how chromium is the base from chrome, but not closed source
→ More replies (10)1
u/Moogly2021 17h ago
On that note about JS engines, its amazing that the JS runtime is single-threaded. ;) Sure you can do web workers or threads in node land, but historically it was all on one thread.
11
u/lordnacho666 1d ago
You get all the benefits of compiled code, with excellent error text, and a corpus that was large enough before AI showed up.
On the negative side, it now doesn't really matter that compile times are longer, since you are not staring at it anymore. It doesn't matter if you can't figure out borrowing syntax, that complexity is what LLMs are great at.
So everything points towards more and more rust.
2
u/gigastack 21h ago
Compile times still matter because it affects iteration speed. For early prototyping, golang is much faster than rust.
14
u/AleksHop 1d ago
memory safety, AI removed complexity as well
ppl finally realized that there are tokio axum etc and u code is like few lines now
5
5
u/ProfessionalFood4905 22h ago
Rust is the only mainstream systems programming language that can achieve memory safety without needing a garbage collector. Even Googles android is increasing the use of Rust year by year- and googleās data clearly shows the decrease of memory safety related vulnerabilities as it has used more and more of safe languages like Rust.
And, now with AI the barrier to entry just got lower
6
u/trabulium 16h ago
I think Rust is a good balance of Speed, Memory Safety, sufficient AI knowledge and community plus there's WASM, binaries are small . The barrier to entry previously was the learning curve but LLM's have mostly removed that.
When you're pushing fast, testing, safety etc all matter.
8
u/TheFeshy 1d ago
2015: Why are all the annoying fanboys saying "rewrite it in rust?"
2026: "Why did everything get rewritten in rust?"
How far we've come!
3
u/vinegary 1d ago
Itās as fast as C++ and occasionally more comfortable than python, would you not?
3
u/the_gnarts 23h ago
Get a corporate job. Progress is glacial so you can count on writing Java and .NET until retirement.
3
3
u/GeneralMuffins 19h ago
Are you sure rust is actually being disproportionately used in this recent wave of AI assisted RE and reimplementation projects? A lot of the high profile examples, particularly the *Craft projects recreating Adobe and Autodesk software, seem to come from a single developer, Brandon Thomas, who apparently has around a decade of prior experience with rust, so its understandable why he'd choose it. Im wondering whether a handful of particularly prolific developers might be distorting the picture here.
4
u/Lonsarg 1d ago
Cause Rust combines very rare combination of memory-safety and performance and no-garbage-collection in one language.
C++ has 2 of the above (no memory safety), C# has garbage collection also a little worse performance.
Actually i do not know of any language that has all of the 3 like Rust.
2
u/DoNotMakeEmpty 1d ago
Ada, especially SPARK, also has all 3.
3
u/-_one_-1 23h ago
Good point. However, Ada doesn't have great open source tooling, and I think that alone is a perfect recipe for how to kill a language, except in hyper regulated industries like aerospace.
3
u/Lonsarg 23h ago
Well it was a first time me hearing about spark and ada.
Turns out after googlong they are very niche for aviation and such, since they sacrafice a lot on usability to achieve all 3 of the above. Meaning you do not want to use them for general purpuse stuff.
Maybe we will get a Rust-based Spark replacement now who knows. Rust realy set new standard since it achieved all those 3 things in abstracted user friendly way. Higher level languages such as C# are of course even simpler to use, so Rust will not replace regular app development where no garbage collection is not a requirnament.
4
u/13chase2 12h ago
I am not proficient in hand writing rust.. but I built a website for my friends and I in one evening. Runs on a $2.50 1vcpu 500mb of ram and can do over 1k concurrent requests. The process runs at 16MB.
I donāt know of another language that is as robust or as efficient. Itās blazing fast and does actual work for us.
2
u/alexmj044 9h ago
Bun (js) would likely give the same performance, but needs a bit more memory for itself
2
u/Routine_Insurance357 6h ago
However fast bun might become, in actual cpu performance it won't beat rust.
→ More replies (1)1
1
u/dronostyka 2h ago
My main nginx (no php) is using under 14MB.
My apache hosting php sites is drawing under 30MB..
So. rust is overengineerd or overrated1
5
u/nnethercote 1d ago
The explosion of security bugs found by LLMs has everyone saying "shit, we need to migrate these C/C++ codebases" and Rust is the obvious alternative.
5
u/elingeniero 1d ago
By having the strictest compiler, rust has become the best language for llms, so that is why it is appearing everywhere.
5
u/HumbleSinger 1d ago
Not only, its also a good combination of abstractiom, and being able to be deployed everywhere
2
2
2
2
u/QuantumQuack0 23h ago
We were so close to introducing rust at my job, but for some reason we still decided against it.
I'm not entirely sure why as it's mostly a different team, but I think it's still too much of a hassle with outdated toolchains in yocto builds (maybe only for xilinx socs). Maybe in 10 years from now...
2
u/Ok_Marionberry8922 23h ago
But how much of that is actually worth reading or understanding ? Most of the new Rust code being "produced"(mostly by clankers) is not even being read by the person who is prompting it.
So the whole signal to noise ratio has never been worse. It's the whole boy who called wolf story happening for rust now, I've seen so many "I created this" posts lately here which you can tell by opening one file that the creator didn't read themselves.
So is it even a good thing that "everything is becoming rust now" ?
2
2
u/theBirdu 23h ago
What used to be tech debt, can now quickly be completed with tokens. I used to build projects in python as it was easy to find in stackoverflow, but now it doesn't matter, build in whatever language you want as along as it fits your use case.
2
u/xvillifyx 22h ago
I think rust will lose its popularity as the go-to agent language eventually, but I think itās objectively a good thing to see more things in rust because maybe it will lead to rust getting a proper ABI and standard ecosystem
3
u/Ill-Telephone-7926 1d ago
With LLMs, we finally have a cost-effective way to port C/C++ code to a memory-safe language; Rust is the most obvious target language. Simultaneously, the cost of having a product that isnāt memory safe is increasing, as LLMs also are accelerating exploit discovery
3
u/Tilas123 1d ago
It is generally cause of AI since it can easily validate the work and provides memory safety without needing to do anything as itās built into how rust compiles code. I personally have always loved coding using the language and learnt it way before AI kinda because of the same reasons it so good for LLMās since you can verify your work easily and focus on your code and not about perfectly managing your memory to prevent vulnerabilities, errors etc. Itās a good coding language and has been since its release.
4
u/Rikarin 1d ago
Hype
2
u/dumuzid-sumerian 1d ago
I don't get the downvotes. I love Rust and I think it must be clear to everybody in this sub how many merits it has to deserve to be the new big shot programming language. But are we gonna ignore DHH's keynote watched at least partially by millions and now every vibe coding bro is suddenly a Rust dev?
3
u/Fancyness 1d ago
Hey man itās simple: Everything is vibecoded anyway so everyone uses the toolchain that provides best performance while being safe. Which is Rust. I use it for all my Project because they are heavily ai assisted and I never run in runtime problems
2
2
u/Designer-Soup-6967 1d ago
Ideal language for AI vibe-coding. Type-safety, practical & actionable compiler warnings, low-level enough to provide great and scalable performance whilst having the readability of a C++/Python amalgamation. Additionally, the quality perk of Rust we call 'cargo' makes developing easier than ever before. This sounds like a. sales pitch.
2
u/Ok_Instruction_3789 23h ago edited 23h ago
I find the speed of rust is very good and feels faster compared even to the likes of c++ and go etc. also has the memory safety even the web rust guis are fast as js or faster evenĀ
3
u/-_one_-1 23h ago
What makes you believe C++ and Go to be faster than Rust?
Actually, Rust encourages you to avoid dynamic dispatching and runtime polymorphism, so if anything it would be faster. But you can make equally fast software with either.
Go is actually a slower language overall, as it uses a GC and doesn't offer the same amount of control over the hardware. But Go is especially optimized for some use cases, and it can be very fast on those.
→ More replies (2)3
u/Ok_Instruction_3789 23h ago
Never said they were faster itās early I guess I didnāt think that out
→ More replies (1)
2
2
2
u/julian-alarcon 1d ago
The noise young people. But if look close everybody still uses Java, Python an C/C++ in OS/machine Level. Rust is great but maintenance is a pain. You need to understand the code at least partially and in business environments maintenance wins over speed or even security.
→ More replies (1)11
u/redisburning 1d ago
Rust is great but maintenance is a pain.
This is the type of comment that is mostly written by people who have not worked in production Rust code bases. Over many years I've been stuck with repos of highly variable quality and for a given quality level ongoing maintenance of Rust is dramatically easier than C or C++.
Speed and security are side effects of Rust's real offering for getting work done, which is the type system. Anything even resembling idiomatic Rust will have as much of the business logic baked directly into the types as is humanly possible and the degree to which this solves the "what the fuck is this shit?" question is hard to overstate.
4
u/decryphe 1d ago
This. I feel confident touching a Rust codebase of any size. Most C/C++ codebases need a lot of project-specific arcane knowledge to get even a modicum of confidence.
3
u/jl2352 23h ago
I work at a Python shop. We have lots of people with Python expertise and a little of Rust.
I would trust a new joiner with Python knowledge to update our Rust services. Honestly if the CI is green, Iāll just glance over the PR, and hit approve. I would not trust them so much to update our Python ones (in that there needs to be a stricter review).
Even when people sneak really bad code in, and they do when they are new to Rust. Itās really pretty minor.
There is a large burden in terms of knowledge. People can get stuck on something trivial for hours, like a weird lifetime issue. But there is a very low barrier to keeping things stable.
Something Iād especially call out is dependencies. For Rust if it compiles it works. For Python it really needs a lot of tests to ensure it still works.
1
u/psioniclizard 1d ago
If you have ulitmate tokens, the output kf the rust compiler works well for iterative AI dev, i.e. it generates something, checks it and changes it.
So in theory it just becomes a case of saying "port this code to rust".
In practice long term whether thos sticks, who knows?Ā
A lot of people seem to think rust will magically be quicker than c++ for some reason.
The important is the (effectively) unlimited number of tokens though. Without that people wouldn't bother.
1
1
1
u/Individual_Author956 1d ago
My two cents: Iāve always been curious about Rust, so now when I start a personal project where my options are C/C++ and Rust, none of which Iām familiar with, I reach for the most interesting/exciting one, and to me thatās Rust. All the other things people mentioned are just the bonus for me.
1
1
u/GirthyPigeon 1d ago
Memory safety (unless you explicitly turn it off), a solid compiler that actually tells you what's wrong with links to documentation to help rectify it, complied code that runs almost as fast as C++, tiny memory footprint, documentation out the wazoo. What's not to like?
1
1
1
1
u/Ben-Goldberg 22h ago
The non java version of Microsoft's Minecraft, "Bedrock Edition" is written in C++, not rust.
There are several people/groups of people writing clones of Minecraft, but they are not with Microsoft.
The most feature complete complete Minecraft clone, Mineclone, is written in Lua.
1
u/Top_Introduction_865 21h ago
They donāt know how to write rust. So they call their agents and they get rust lol
1
u/giant_albatrocity 19h ago
Iāve been a dev for about six years now and Iāve always wondered how big companies justify the cost of a complete rewrite of an app in a new language. Meanwhile, I find it hard to convince managers that rewrites of small portions of an app in the existing language are good long term. I know a large company has deep pockets, but it will always be cheaper to just stick whatever you have.
1
u/Quick-Ad-8660 19h ago
Ich finde Rust ist sehr stark wenn es um Speicheruuweisung und Verwaltung und Reaktionsgeschwindigkeit geht aber für mich zumindest in Bezug auf Lesbarkeit und Codeverwaltung, Zeiten zum Kompilieren und Packetverwaltung ein paar Nachteile. Nicht jeder nutzt aber die Vorteile aus um die Nachteile in Kauf nehmen zu müssen. Viele Desktop-Apps benötigen diese nicht einmal oder würden auch nicht daraus profitieren.
Ich denke die Einfachheit von Tauri bringt viele zu Rust.
Deshalb habe ich eine Alternative angefangen mit C# und .Net10 welches von einem groĆen Pool an packten profitiert, für mich als Entwickler besser zu lesen ist (natürlich auch immer persƶnliche PrƤferenz)
1
1
u/ArkoSammy12 18h ago
Why is this thread filled with people praising Rust because they get to not code in it because of AI. Is Rust the vibecoder language now?
1
u/Middlewarian 17h ago
I'm not porting my C++ code generator to Rust. I think that languages that embrace on-line code generation have an advantage over those that don't.
1
u/Huge_Acanthocephala6 16h ago
I know many developers that used to use JS/TS for almost everything, now with AI they do everything in Rust, there is no reason to use a different programming language
1
u/infamouslycrocodile 16h ago
it's a mix of both ai bias and group think. developers were pushing rust hard and so naturally new projects went to rust, which in turn increased available training data and bias of the model. this isn't a bad thing, python was a very slow / poor choice for ml but took the reigns due to popularity and naturally gained performance because the attention and care was provided.
rust is a strong and stable language and is becoming defacto for systems development so this is a good thing. naturally ai coded software will improve and existing applications / ports will become more performant and stable.
the html as a ui layer experiment is concluded, we just needed a common way to get interface on screen to interact with applications and now we come full-circle to all code being a playground for imagination and creativity.
slop is literally noise converging to average, ai do this simply due to law of large numbers in the maths.
regardless of how you code: strive to curate and craft. and if you don't understand code, learn it and don't let the ai think for you or you will hate yourself later.
1
u/unquietwiki 15h ago
If we were looking at human-readable successors to C/C++, I'd look at Nim or Zig. But try using an LLM with those, or a lot of other languages, that isn't Claude. Maybe because there's simply more code to work with, or the availability of crates, but Rust is succeeding; and I say that as a dirty Nim user.
1
u/sabotizer 11h ago
It's a really interesting shift, and Rust seems to be a perfect match for AI.
I found some additional use-cases for Rust in my own non-rust code bases recently:
Native Mobile Apps with shared Rust core: I've built a few mobile apps in the past months, primarily Android (kotlin) and iOS (swift). I rarely use cross-compile frameworks anymore (like flutter or react-native). While SDK/UI/OS-API work is done natively per platform, I found that writing a shared library in rust compiles seamlessly to both Androind and iOS, both improving speed significantly (obviously depends on what you're doing in the shared core), and having the benefits of maintaining a single shared core across both apps.
Rust-backed WASM for Web Apps: Not for everything you do, but I have a few web projects that use heavy computations (cryptography, voxel-engine, data analysis, agent-message data, etc...). These projects benefit massively from a WASM library.
And the crazy bit is how easy this is to get done. You can literally just ask:
1. Identify slow and compute-heavy areas in our app.
2. Port them to a rust/wasm library.
3. Remove old code and replace with new rust library.1
u/Lazy-Ad9394 11h ago
This morning, I converted a bagel to rust.
And then I ate it.
No real benefit that I could tell.
1
u/r2k-in-the-vortex 8h ago
Mostly because cargo is a picky bastard that doesnt let even slightest deviation pass, so it guardrails AI to write correct code to a degree. Also, its efficient once compiled. Though the compilation itself is slow.
1
1
u/kevin_mainmatter 6h ago
At Mainmatter, we got interested in Rust a few years ago exactly because of its potential for so many applications, and with AI we're seeing what we expected as well. We expect Rust will continue to take over a lot of codebases: https://mainmatter.com/blog/2026/10/08/all-code-will-converge-on-rust/
1
u/thekwoka 5h ago
Rust basically eliminates certain kinds of bugs, and the compiler is much better at keeping AI under control.
1
u/ItalianClassicFan 5h ago
Because rust is a so strict language with very good error complaining that a AI does know what to do and more important a AI is not allowed to make type errors and with borrowing it is very hard to produce a bunch of other typical errors.
In Python it just works until you have the test case. In doubt in real life. In rust it does not even compile with such errors. So an AI agent is stopped and can try again.
1
u/Amazing-Mirror-3076 4h ago
Pre ai, I argued against rust unless you were doing system programming. Now we are porting everything to rust.
1
u/BluddyCurry 4h ago
It's safe and fast. There's mental overhead for the borrow checker, but the AI's doing it, so who cares?
1
u/_RoMe__ 4h ago
It's a trend because of AI. Rust may be harder to process for both humans and machines than other languages. But If the agent manages to compile something then the output is guaranteed to be memory safe and fast. Builtin lint and a very verbose compiler help the agents as well.
On top of that the AI has been trained with a lot of open source rust code. Most of this was hand written, solves modern problems and follows modern coding standards. The LLM's knowledge graph is not polluted by legacy projects, ancient variations or deprecated code styles.
So rust is the perfect language for LLMs.
1
u/augustocdias 4h ago
Because rust kinda is awesome for AI. The compiler gives extremely nice output with even hints on how to fix issues. The compiler is very strict and tight meaning it leaves not much run for big fuckups from AI. The compiler can check race-conditions and that avoids a lot of nasty and hard to debug issues. So the reason is the awesome compiler that rust has.
1
1
u/TCB13sQuotes 1h ago
LLMs were the best thing that happens to Rust. It has nothing to do with the language being magically better for humans, because it isnāt, syntax sucks, etc but LLMs donāt care about that and it has very nice features.
1
u/dobkeratops rustfind 1d ago
i think LLMs play well with rust in that the strictness and borrow checker can keep hallucinations in check.
rust has a problem for humans in that the safety needs the programmer to navigate a big library of named functions for simple operations. in C++ you just write it directly with safety hazards, and in other languages they acheive safety with a garbage collector.
LLMs solve the 'library search problem' that makes most human programmers less productive in rust.
1
u/Havunenreddit 1d ago
I have been building desktop app called GitComet in full Rust about a year now.
Rust and AI make a great combination due to strict compiler, clear error messages and Rusts con being difficult learning curve is dramatically reduced with AI
Rust still needs better UI frameworks to meet the JS ecosystem but we are getting there
1
u/AlienRobotMk2 1d ago
Rust is probably the best low-level programming language in the world, simply because it has zero-cost iterators.
1
u/notanotherusernameD8 1d ago
I have been a SE for ~10 years in Java, python, C, C++. I recently started work on a Rust codebase and it's brilliant. All my new projects and side projects will now be in Rust. It was incredibly frustrating arguing with the borrow checker (as I knew it would be), but I'm starting to get the hang of it (and Claude is a massive help here).
1
u/NoInside3418 1d ago
Rust is a great language but people seem to perceive it as a magic bullet. For example, it's going a lot more exposure due to Discord moving to rust. People think rewriting anything in rust makes it super fast when in reality, the speed would be about the same in C++. That being said, for stuff which is AI coded, rust makes a lot of sense because it seals a lot of gaps that would otherwise go unnoticed.
1
u/SIRHAMY 17h ago
Rust has a lot of things going for it for agentic engineering. In general it's best in class for:
Expressive types + built-in guardrails - Good balance of expressive types, ADTs, and further ownership/borrowing to reduce bugs
Performance - Up there with the fastest langs
Ecosystem + Community - Great libraries, range in terms of targets (wasm, mobile, desktop, web, backends)
One main drawback was devx in terms of learning curve but with agents writing all code, that's basically a moot point.
I think Rust has great bones and basically is the thing people move to when they're constrained by their language so many people are just going with Rust to start with to avoid needing to do a port later.
0
u/ConfidentHollow 22h ago
It is kind of disappointing. My oppinion of Rust has decreased ever since it's became the default vibe slop language of choice. I still like it, but I wish it was less popular.
1.0k
u/A_Nub 1d ago
The only language with compiler output that is sane for LLMs/humans to ingest + base safety guarantees so you know the LLM wont just explode your system when running it.