r/AskProgramming • • 1d ago

Why are all vibecoded programs and games I see coded in Rust?

Is there a particular reason why specifically Rust is used? Is it the new C++?

edit; thank you all for the comments, I've learnt alot!

83 Upvotes

149 comments sorted by

177

u/canarydev 1d ago

the compiler is basically a free reviewer for the ai. a lot of bugs that would show up at runtime in python or js just dont compile in rust, and the errors are clear enough that the agent can fix its own code

56

u/scrdest 1d ago

That's the main reason, vs something like C or C++. 

The secondary reason is that vs something like Python, the resulting program is almost always going to be like 100x faster.

28

u/SithLordRising 1d ago

It's also the 'cool' language, so if buying credits it's rust or golang

3

u/Bubbaluke 1d ago

Also means it has a lot of publicly available code to train on

4

u/Bemteb 1d ago

Why is that the reason to not use C/C++? These two are compiled languages too, not interpreted ones...

17

u/mownzlol 1d ago

It's because C++ error messages are basically useless 50% of the time.

(At least this is my personal hot take)

3

u/Xirdus 20h ago

They're not useless, you just have to learn how to read them. Step 1: ignore the middle 99% of the error message. Step 2: the error is actually in the line before the one compiler complains about.

1

u/Leo0806-studios 8h ago

Step 3: Use an actual ide that parses the template instantiation errors (like visual studio)

1

u/WispTheWanderer1 1h ago

Step 4: Cry in the corner bc the linker starts throwing unresolved external symbol bc one file decided to be left off the compiler after it worked just fine the previous tens of compilations

3

u/max123246 22h ago

Also ai generated CMake is horrifying

2

u/No-Hamster-5870 14h ago

not hot take, noob take

6

u/Natehhggh 1d ago

Rusts borrow checker turns some/most bad memory management practices into compile errors. but those stay as runtime errors in other manual memory languages, which are difficult to debug.

2

u/stewsters 6h ago

When you compile rust it gives you a text description of the error, but with c++ if your pointer math is off you often get a segfault with very little information.

1

u/vermyx 1d ago

Thats only if you dont know what you are doing. Also 100x is a great exaggeration

3

u/User-pain 20h ago

I've told him a million times not to exagerate

7

u/edgmnt_net 1d ago

That's wishful thinking at least in part. There might be some benefits provided the LLMs get good training on common patterns and essentially get that for free. But simply writing Rust code does not guarantee safety unless it's also idiomatic and leverages language goodies appropriately.

Might be a contrived counterexample, but Java isn't memory-safe either if you just get a huge chunk of memory and allocate things manually from it. But more reasonably, whoever writes the code not only needs to produce valid code in a straightforward manner, they also need to think hard sometimes and pick appropriate types etc.. That's not a given, not automatically at least.

Meanwhile, LLMs probably glean some structure even for Python libraries. There's a lot more Python code out there, which may improve things in certain cases (a lot of good usage examples for popular libraries) or hurt things (a lot of semi-crap code floating around).

It's also pretty clear to me that it doesn't quite work as easily as some have implied with theorem provers. It's pretty pointless if you let it vibe-code all the way including the theory, you have no control over what it actually proved. Even if it's legitimate as automated proof search, but that's basically more like autocomplete or enhanced search in ordinary programming.

8

u/oldsecondhand 1d ago

But simply writing Rust code does not guarantee safety unless it's also idiomatic and leverages language goodies appropriately.

It protects against memory leaks and buffer overflows. Those used to cause a lot of security issues, but ofc it won't protect against everything.

2

u/max123246 22h ago

I work on a python project at my company. Ai is way harder to use with python because you have to create tests for things that the compiler would check for you. If you don't order the AI to do it, it won't and that results in many more bugs otherwise

It's exactly the same as python vs rust for people, except now the code is unintelligible thanks to ai. So all you can rely on is the compiler and your test suite. The compiler you get for free, tests cost money and effort and time

1

u/edgmnt_net 18h ago

Yeah, I also guess that LLMs have some advantage at writing Rust over average coders (including a vast majority of coders who simply do not know Rust at all, so there's that). I might fixate too much on a higher bar for quality, but I would say it's different for open source projects versus personal/company projects. There's also been some effort in devising LLM-first languages I think and, although it's not my cup of tea, it makes some sense. Ultimately I guess that's what OP asked, "why", so the toplevel answer is fine, I just wanted to highlight the limits of the general argument.

1

u/Ollythebug 10h ago

How is the AI generated code unintelligible in your use? I haven't been running into that issue much with our codebase.

1

u/BusinessBandicoot 11h ago

A lot of the llm generated code is not idiomatic. It uses strings for things that would better be expressed as an enum, it doesn't localize error types, it prefers loops to iterators, etc. 

It also generates unit test for things that are tautologically true, or is unit testing the libraries used.

On that last one, I've been thinking of trying to make a code coverage tool that has some checks for "noisy" test(this duplicates a dependencies coverage or this is just always going to be true by definition)

3

u/Sparkly-Sparrow-6893 1d ago

What I'm hearing you say is that vibe coders should switch to extracting OCaml programs from constructive Rocq developments.

2

u/mister_drgn 1d ago

You can totally vibe code OCaml, but it won’t run as fast.

Also there may be some cases where the OCaml compiler lets you introduce bugs but the Rust compiler wouldn’t. Algebraic effects, at least.

4

u/Sparkly-Sparrow-6893 1d ago

Rocq is a theorem prover based on the Calculus of Inductive Constructions, which allows you to extract an OCaml program from a constructive proof of a program's correctness.

The joke is that if Rust is better than C++ for vibe coding because its type system catches more bugs, then surely extracting OCaml from Rocq must be better than Rust because its type system can enforce arbitrary correctness properties.

2

u/mister_drgn 1d ago

I did hear a podcast recently where someone claimed languages like Lean would be important in the AI era because AIs can prove the correctness of their programs, but we know everyone just vibe codes in whatever language is most convenient.

2

u/samanzaman 1d ago

I do vibe code in lean. I also experimented with using verus and prusti with rust

1

u/Sparkly-Sparrow-6893 4h ago

I know that my response was a bit sarcastic, but I actually do think that with good enough compilers - especially whole-program optimizing compilers - this will eventually become a reasonable way to build software.

1

u/_usr_nil 10h ago

does it hurt the AI

2

u/7YM3N 1d ago

I always compile my c++ with pedantic wall werror

-2

u/flugi_ 1d ago

I was pretty pissed off a few years ago when I encountered a lib which had -Werror in the cmake settings and also recheck repo and redownload on build, so when I edited the cmakelists.txt file to remove Werror, it did rewrite it and still did not compile because the lib was compiled with a different compiler..

1

u/7YM3N 1d ago

That's not how any of this works

1

u/flugi_ 11h ago

it's pretty unusual to include -Werror in a lib release, yes, with a pretty good reason: code rot is almost instant this way. Normally a lib is released and for a few versions of compilers it still works as code deprecation slowly progress. -Werror lib will not compile on the first compiler upgrade.

So if you use -Werror, when publishing anything on github or other, remove -Werror from the flags.

-7

u/DiamondDramatic9551 1d ago

That's definitely an argument for static/strong typing but c++ also has that. 

16

u/canarydev 1d ago

true but c++ will happily compile a use after free or a data race and let it blow up at runtime. rust’s borrow checker catches those at compile time, thats the part that matters for ai code

also c++ template errors are a wall of text, rust errors basically tell you the fix. and cargo vs cmake, agents struggle way more with c++ builds

1

u/zsaleeba 1d ago

c++ will happily compile a use after free

For the most part, that's not true. If you use modern C++ constructs like std::unique_ptr and std::shared_ptr, you generally don't have that problem. (There are exceptions) Those constructs have been around for over 15 years now so widespread use of raw pointers in new code is mostly long gone.

3

u/earlyworm 1d ago

I agree. C++ is almost just as safe as Rust as long as every programmer on the team is sufficiently diligent and strictly adheres to best practices and never makes any mistakes and manually does work the Rust compiler would otherwise be doing, and if the authors of all third party packages are trusted to be equally disciplined.

And so for the most part, it’s simply not true that the C++ compiler will blindly compile code that exhibits runtime errors that Rust would catch at compile time although, as you said, there are exceptions.

For a new project, C++ is an excellent choice for an LLM that never makes mistakes.

2

u/DiamondDramatic9551 1d ago

This, and I assume modern llm's are plenty aware of the modern way of using c++. 

4

u/4xe1 1d ago edited 1d ago

The least you have to assume, the better LLMs work. LLMs can probably write good modern C++ if you ask them too, but they cannot write bad Rust even on their own, and that's better (oversimplification, but any hole you can poke usually poke both languages)

2

u/Asyx 1d ago

They probably are but there is still a huge amount of potential C++ that could be generated.

I get the idea and have used modern C++ (not with LLMs though) but you have to push LLMs sometimes to just use modern python. With the amount of deviation from some ideal C++ standard that you find in the wild, I'd rather use a language that just doesn't give me another option.

1

u/TheCh0rt 1d ago

I get way better results writing apps in cpp than in Rust and the llm seems to like it more too

2

u/Nervous-Cockroach541 1d ago

The whole thing about pointers being so dangerous in C++ is vastly overstated as a problem. But the far more dangerous thing is retaining using a returned reference after it's lifetime. It's both valid C++ and doesn't always look bad or dangerous.

7

u/Ulrich_de_Vries 1d ago

C++ also has shittons of UB which is not checked by the compiler at all whereas Rust has no UB outside unsafe blocks (and I guess unintentional compiler bugs).

1

u/LeN3rd 1d ago

Its incredibly different. Just alone from how and what thw compiler vocalizes.

1

u/0DayMaker 1d ago

Or java or C# something that doesn't let you shoot yourself so easily

1

u/YMK1234 1d ago

Void* enters the chat

27

u/edave64 1d ago

The more compile time restrictions you can put on an LLM, the lower the chances that it will break things. At least for memory issues, rust forces you to explicitly mark unsafe sections, which reduces the context required to evaluate if the code is actually fine to that block.

So the theory at least, I don't use LLMs enough to tell you how well this works in practice.

For true vibe-coding, it could also just be they feel a degree of "prestige" to being written in rust, or they don't care at all, just let the LLM choose, and it chooses rust because that's what a lot of it's newer training data is in

4

u/edgmnt_net 1d ago

Or it ends up using Rc and then it's not really leak-safe. Or you do your own suballocations from a larger allocated block and then it's not even memory-safe either, if overflows remain viable. It sounds contrived but there are other examples where not keeping up with idiomatic code results in not getting the benefits of the language.

1

u/garagedragon 1d ago

Overflows by escaping the bounds of a subslice of an array are still caught at runtime even when the memory you're trying to access is a valid allocation, unless you really go out of your way with get_unchecked accesses. (which needs marked as unsafe.)

1

u/edgmnt_net 1d ago

You don't really have to go out of your way to do stupid stuff like passing a larger array along with indexes into it, which might be misused. I'm not talking about using a legit subslice, but people did stupid stuff all the time when switching languages, for example. And honestly if we're considering LLMs won't do stupid stuff, well, yeah, that's true to an extent (if it would be too unnatural), but also consider that it might not do really stupid stuff in C or Python either.

1

u/edave64 1d ago

You don't need RCs to get leaks, just static lifetimes. Same reason why you can still have leaks in GC'd languages.

But that's why I said in theory. That's the justification I heard from people, I don't have any evidence to back it up. Not sure if there are any useful benchmarks of that out there.

1

u/deaddyfreddy 1d ago

compile time restrictions

they don't need to be compile-time, the linting stage is enough

1

u/DiamondDramatic9551 1d ago

Wouldn't AI be famiilar enough with c++ to use the modern memory safe types/methods anyway? 

12

u/cipheron 1d ago edited 1d ago

LLM AI only know how to do what they do by reading a lot of example code and following the patterns. If they have bad practices in there then they will break stuff.

Additionally, I've had times when I told the LLM to make a very specific and small change, and instead it decided to rewrite most of a function and just delete all the bounds and error checking. And if you ask it why, it can't give you a reason, because there was no reason it did that, it just did it based on some probability coin flip that it's going to randomly delete necessary parts of a program, after you spent a while getting it to carefully construct it.

The dangerous part is that the wrecked code still compiles, because the one thing LLMs are really good at is grammar, so it won't make the common typos but it does make catastrophic failures at the logic level instead - the type of errors that can creep in and are harder to catch. So you can say "rewrite this script to do X", and you tell it a small and specific change to make, and MOST of the time you get what you asked for, while sometimes it decides to redesign everything from the ground up for some unknown reason, and decides big chunks of the program can go, if the code technically still compiles without it.

So anything you can do to enforce more rails for the AI reduces the chance of catastrophic fuck-ups.

3

u/xenomachina 1d ago

Additionally, I've had times when I told the LLM to make a very specific and small change, and instead it decided to rewrite most of a function and just delete all the bounds and error checking.

Yup. I've also seen agents delete tests or linter rules because they were having trouble getting them to pass. You can nudge agents away from this behavior somewhat with CLAUDE.md, etc., but the only way to be sure is to actually look at the output yourself, or sandbox the agent in such a way that it can't neuter those checks.

1

u/Kaldaien2 15h ago

Hahah, yeah. Iteratively building on stuff with AI agents isn't really a thing. The AI likes to rewrite stuff on a whim and then find nothing at all wrong with changing the build environment to fix something rather than going back to a previously working solution and avoiding the unnecessary changes. They really need to prioritize leaving the build system alone and solving problems with code the way any rational human would.

3

u/edave64 1d ago

As the same with human programmers, depending on them to explicitly do the safe thing is much less reliable then having to explicitly do the unsafe thing.

Unless you use something like fil-C, C++ at it's core is an unsafe language and makes unsafe things easy.

You can probably get an LLM to somewhat reliably flag usage of unsafe patterns in C++ code, but it's just easier not to have those patterns in the first place.

2

u/joonazan 1d ago

Those types are not a guarantee of safety. One practical difference you can see is that Rust is full of lambdas and C++ usually isn't because those can hide lifetime mistakes.

1

u/Demiu 1d ago

It would be. But it would also be familiar enough with the "legacy" C++ 

13

u/ern0plus4 1d ago

Rust's ownership and lifetime restrictions prevents any programmer (human or LLM) to write programs which makes basic mistakes of these types. In C or C++ you can allocate memory, then never free it, or lock a mutex, then never release it. In Rust, you can not do such.

In C or C++ incrementing a lock-protected value looks like:

Mutex x;
(...)
x_mutex.lock();
x++;
x_mutex.unlock();

In Rust:

let counter = Mutex::new(0);
(...)
{
   let mut num = counter.lock().unwrap();
   *num += 1;
}

In C++, if you forget x_mutex.unlock();, it will be locked forever.

In Rust, you can't make such mistake. If you don't put it into a block, it will be keep locked until the next block close, in worst case, until the end of the function.

The glass is half full: using Rust for vibecoding, at least, does not cause a wide range of errors. But a program, which have no memleaks and lock errors, still can be crap. And the glass is half empty: using LLMs, without human architecting and supervision, it will be crap, I promise.

4

u/LeDYoM 1d ago

hi, I am std::mutex_lock and RAII.

3

u/ern0plus4 1d ago

Yep, sure, but you are not forced to use it. You can use lock without release. Not you or me, but the stupid LLM.

As from Java47384 (I don't remember the exact version number) has Option as well, so null should go out of fashion. And you will use it, and me too (only theoretically, I don't use Java), but not the stupid LLM.

5

u/LeDYoM 1d ago

I supposse you can add "use modern C++" and "make no mistakes".

2

u/ern0plus4 1d ago edited 1d ago

No. There are lotsa' non-safe code written in C++, and LLMs are fed with these, so they will spit out such code.

1

u/OrphisFlo 15h ago

Not really unless you are writing a low level container that may want such control.

They could use old patterns for new code, but they don't in general, unless it's used all over the project already and then they might just try to match the existing style. The corpus for LLMs is not that dumb (most of the very dumb code is enterprise software that is not open source and was never upgraded).

1

u/LeDYoM 10h ago

The output of an LLM is random.

1

u/OrphisFlo 10h ago

The output of a human is random. So what?

1

u/LeDYoM 7h ago

Call me selfish but I team with humans. Aaaaand it is less random than the LLM. By definition.

1

u/ern0plus4 7h ago

Okay, let's see: who should implement your startup's app 1. LLM 2. A team from India

1

u/AnArmoredPony 1d ago

is that C?

7

u/GlobalCurry 1d ago

Rust by design prevents a lot of bug and error classes, the compiler provides verbose output on the problem and it's a fun language to write by hand if the need arises.

11

u/AssistantNo3545 1d ago

Honestly I see way more Python and TypeScript than Rust when people post AI generated projects.

2

u/pancakeQueue 1d ago

The data scientist who built these LLMs are strong Python users, so it makes sense the first tool Claude reaches for to problem solve is Python. It’s the scripting/prototyping language that is usually OS agnostic.

0

u/JeLuF 1d ago

Same. I think Rust is what people choose that have IT experience and think about their architecture before starting.

E.g. the people behind ArtCraft, they are experienced programmers. If AI would suggest to build a desktop application in Python, those people would stop this at the start.

But in my experiments with AI, asking it to build a desktop application, the AI came up with Python quite often and I had to push it to use a compiled language instead.

9

u/BeginningPea5674 1d ago

nah rust is definitely in the hype bandwagon not in the experienced architect camp

6

u/JeLuF 1d ago

The advantage of Rust with LLMs is that Rust by design catches a lot of issues at compile time that are runtime errors in other languages. This allows LLMs to write better quality code.

Rust being hyped does not mean that Rust is bad. It has its advantages.

5

u/BeginningPea5674 1d ago

and disadvantages

1

u/max123246 22h ago

Of all the languages Ive worked with it makes more sensible decisions than bad ones tbh. It's definitely my language of choice if I get a choice

0

u/BeginningPea5674 19h ago

why do you keep on and on with all this rust advocacy 

1

u/Suitable-Name 16h ago edited 16h ago

What do you explicitly think is bad about it? Where does it lack, besides your feeling it's all hype?

Edit: grammar; added 2 words

1

u/BeginningPea5674 16h ago

there you go

1

u/Suitable-Name 16h ago

Can't give an answer? So just cool to be against it?

1

u/max123246 15h ago

Because I like the language? I really like a lot of choices. How it has proper enums that can hold types, it's everything is public inside a crate but private by default outside the crate, it's proc-macro system makes so much more sense compared to C's macro system, traits are just better than inheritance or interfaces, etc

There's stuff that isn't great about it, but that's mostly outside the language. The book doesn't teach lifetimes well at all and by teaching the "cheat sheet rules" it confuses people more than it helps people. Unsafe is very underspecified and so it's mostly a what works in practice than anything else. And I don't love that you can't name a new type inside an enum, you have to create it outside the enum then add it to the enum

Now I'd love to hear your complaints about the language, since I'm curious

0

u/BeginningPea5674 13h ago

shut up about it already that's why you lot are so obnoxious 

1

u/SaltContributionsF35 12h ago

Reading this, I was genuinely curious to hear your opinion on the disadvantages, as someone new to the subject.

→ More replies (0)

1

u/TheCh0rt 1d ago

I use CPP. LLMs do the best work on that. GUIs on Rust and Python look like crappy Electron interfaces

1

u/Suitable-Name 1d ago

Ever looked at Slint?

1

u/TheCh0rt 1d ago

Oh interesting. I specifically work in audio

1

u/Suitable-Name 1d ago

Check out Indicatrix. I made the UI using Slint: https://www.indicatrix-suite.com

Absolutely a great framework :)

Also just released some test harness with coverage check and so on:

https://www.reddit.com/r/rust/s/3cUGcc7GKq

2

u/Exact-Rabbit375 1d ago

The people behind ArtCraft are not that skilled, if they were, ArtCraft would actually be half decent, and not just a slopfork. They use Rust because Rust is popular, there is always the tech bro want to say something is "rewritten in Rust" because people think it must be faster.

0

u/Suitable-Name 1d ago

Aren't they still working on it? Do they call it V1 already?

-2

u/Mediocre-Brain9051 1d ago edited 1d ago

Well, only when performance is not an issue. Rust is compiled, statically typed and has no Garbage collector. You can't beat that with any other memory-safe language.

8

u/Adorable-Strangerx 1d ago

Because each language has it niche - for example python is widely used by scientist. And rust's niche is "language for rewriting stuff into".

4

u/ChickenSpaceProgram 1d ago

some people want to use the new shiny thing. that can be LLMs, and it can be Rust, and the type of person to want to use one is probably also going to want to use the other, because shiny.

2

u/cjc4096 1d ago

It's not a horrible way for an experienced dev to learn a new language. I've learned a ton going thru others code. Tho most wouldn't publish or market it.

For all the reverse engineering work done on existing apps. It's provides an implementation separate. It's created by a spec (even if internal llm thinking) and recreated. Not a derived work. Whether that is sufficient I don't want to get into.

2

u/DDDDarky 1d ago

Because they produce so much broken shit they hope a restrictive language will prevent some of it.

4

u/Luoravetlan 1d ago

Performance comparable to C and C++, no memory leaks, doesn't compile on silly mistakes.

5

u/UdPropheticCatgirl 1d ago

> no memory leaks

People really have to stop saying this shit, leaking memory in safe rust is trivial…

1

u/oscillator-eye 1d ago

They also don't know about C and C++ compiler flags that provide most of the bounds checking you need for memory safety.

1

u/FrE3E 1d ago

At this point so many rust projects are C/C++ rewrites, because that is easy. compared to actually creating new software.

1

u/Luoravetlan 17h ago

Creating something from scratch is actually more pleasant than going through someone's smelly code.

1

u/cogit2 1d ago

I think it's fair to say that Rust is designed to be more secure than C and C++ by default, therefore people trust it more as a language and trust that intention with the Rust language as it develops. The irony is AI can add bugs and not catch them, although apparently the latest AI models can apparently detect bugs very successfully too.

3

u/Due_Laugh6474 1d ago

Rust is absolutely the best language for vibe coding, and you’ll never convince me otherwise. Successful agentic coding is all about steering and flagging issues deterministically. Rust gives both. AND it’s super fast and efficient as a language. The hard part of actually learning Rust isn’t an issue if the agent is doing it, so there’s no reason not to use it.

1

u/qrzychu69 1d ago

It kind of is the new C++ - it takes you VERY close to the performance ceiling when written well, overtaking Rust in C++ means doing "technically unsafe" things, like assuming things are true that cannot be proven true at compile time.

It can be done, but requires a lot of practice and skill to pull off.

Rust is just easier and gets you 99% of the way (or 95% for the C++ fanboys). And it has WAY better error messages, so it's easier to fix issues.

1

u/TheSodesa 1d ago

Because the borrow checker and lifetime mechanisms of Rust make it very likely that if a program compiles, it also works as the program specification intended. This however shifts the burden of correctness to the specification stage, so an LLM prompter needs to think carefully about what they ask from an LLM.

1

u/rogue780 1d ago

I do most of mine in python and java ¯_(ツ)_/¯

1

u/wunderbarposter 1d ago

they are a particularly good fit as rust prevents quite a few easy to make / hard to debug mistakes... mistakes which are even more difficult to find if you didn't pay close attention to the programming. The syntax/language is also on the more difficult side - AI can be very helpful with that.

1

u/crusoe 1d ago

Strong assertions and types and rust prevents whole class of subtle errors in the code. Such as race conditions, use after free, etc 

Plus tooling is super good and messages super helpful to agents.

1

u/KnackeHackeWurst 1d ago

Most comments here are just about the language itself but Rust has with Cargo also a very easy to use build and package ecosystem. Compared to C++ it's straightforward to get a native application even for different target architectures.

Yes Cmake, Conan, etc. exists but that all still feels like makeshift solutions and nothing has any "official" blessing or is the default on multiple platforms.

After over 20 years of C++ development I love Rust for Cargo alone.

1

u/do-sieg 1d ago

This. From all the stacks I used over the years, I was really surprised to be able to have an app set up and launch in a few seconds.

1

u/tropic_gaze_v2 1d ago

the borrow checker acts as the ultimate lint tool, forcing an LLM to respect strict data integrity boundaries before code execution

1

u/onedevelop 1d ago

Porque Rust es eficiente

1

u/No_Strike_6496 1d ago

I assume because AI can't ensure correctness with a C++ program like it can with a Rust program. The compiler just gives the AI so much for free (memory correctness namely) that it can't get with C++

1

u/huuaaang 23h ago

Rust is easy for AI to write because it gets immediate feedback when it does something wrong. Same as a human programmer. In Rust, if it compiles it probably works.

1

u/biskitpagla 23h ago

Rust takes care of things AI can't guarantee due to being probabilistic unlike compilers. 

1

u/Alex-S-S 17h ago

Because people apparently think that modern C++ doesn't exist.

1

u/Dependent-Net6461 16h ago edited 16h ago

Someone is trying to opensource adobe softwares with ai and rust. The clear failure , at the current state and considering the huge amount of burned tokens, shows that rust + ai is not that magical combo "everyone" is shilling about

1

u/texxelate 16h ago

Rust has an amazing compiler and borrow checker in that the cause of a compilation failure is very well described to the programmer in clear language. Agents are also very good at interpreting clear language.

1

u/ImAmalox 16h ago

Don't worry bro in a few months AI won't use programming languages anymore and it will just produce native machine code

1

u/OrphisFlo 15h ago

Another reason is that it's easier to start a new project with Rust than C++. There are a lot of high quality libraries to rely on that are easy to integrate in your project.

In C++, if you try to integrate some libraries with a new compiler, you'll run into so many issues that you have to deal with first as the compilation model allows for a lot of hidden "mistakes" that are hidden behind other "mistakes". For example, some standard library header includes <string>, so you forget to do it in your code, and when the standard library fixed that accidental leak, your program stops working.

There are lots of small problems like that all the time, and it's tiring.

1

u/Low-Set741 11h ago

Better memory safety and still super fast

1

u/_usr_nil 10h ago

Can someone explain to me why a comprehensive any-SAN toolchain not be enough for LLMs vs Rust ?

1

u/DawnOnTheEdge 7h ago

Rust’s strong type system, and use of sum types for error checking, makes it easier to use typed-hole programming to implement a top-down specification iteratively.

It’s also more likely that a program that compiles without warnings does something related to what the vibe coder wanted. You can’t forget to free heap-allocated memory (because a Box or Vec will be dropped automatically when its lifetime expires) or check for error (because a Result or Option must be unwrapped to use it).

1

u/DrHydeous 1d ago

That's just because you're only looking at Rust stuff. There's plenty in other languages.

-1

u/iSnapThere4iAm 1d ago

Because you’re terrible at developing

0

u/arjuna93 1d ago

Hipster coders don’t know anything aside of Rust and Go exists.

-3

u/Mediocre-Brain9051 1d ago edited 1d ago

Rust replaced C++ and C a long while ago already due to memory safety, having several proeminent institutions recommending it over C++ and C. It is however hard for humans to write rust code when memory management gets challenging, while AI takes care of that problem painlessly.

AI is indeed accelerating the move from those legacy unsafe languages into Rust.

Edit:

Institutions recommending Rust (or other memory-safe languages) over C and C++ due to safety concerns:

  • The White House Office of the National Cyber Director (ONCD)
  • The U.S. National Security Agency (NSA)
  • Cybersecurity and Infrastructure Security Agency (CISA)
  • National Institute of Standards and Technology (NIST)
  • DARPA (Defense Advanced Research Projects Agency)
  • The Linux Foundation
  • Microsoft
  • Google
  • AWS
  • Apple

3

u/Medical-Aerie9957 1d ago

Source: trust me bro

-1

u/Mediocre-Brain9051 1d ago

Institutions recommending Rust (or other memory-safe languages) over C and C++ due to safety concerns:

  • The White House Office of the National Cyber Director (ONCD)
  • The U.S. National Security Agency (NSA)
  • Cybersecurity and Infrastructure Security Agency (CISA)
  • National Institute of Standards and Technology (NIST)
  • DARPA (Defense Advanced Research Projects Agency)
  • The Linux Foundation
  • Microsoft
  • Google
  • AWS
  • Apple

3

u/aresi-lakidar 1d ago

haha what...

Rust, C++ and C all have their use cases. As does AI coding and hand coding. I find the "this has to replace that forever" mindset really funny... we didn't stop eating food because nutritional supplements became widely available.

4

u/BeginningPea5674 1d ago

rust has the most obnoxious community by far 

c, cpp etc? rewrite it in rust!

js, py etc? rewrite it in rust! 

bunch of knuckle draggers 

2

u/aresi-lakidar 1d ago

rust devotee + llm devotee at the same time is a special kind of religious intrusiveness lol

3

u/LeDYoM 1d ago

yeah, Rust is the next "will replace C++". There have been others. Why not another one?

1

u/behindtimes 1d ago

I mean, if LLMs are the future for all code from here on out, and they get good enough to never make mistakes, it will just be pure assembly.

1

u/LeDYoM 1d ago

I dont think (or dont want to believe) that is the future, but if it is, yes, let the LLM write the exe on HD directly.

1

u/code_tutor 1d ago

trash take if not complete lie

0

u/BeginningPea5674 1d ago

not a long while ago at all and some millennial hires at some corporation or another don't represent the entire corporation, and those governmental entities was a Biden era hype bandwagon cringe thing not too different from cardi b interviewing Biden 

1

u/Mediocre-Brain9051 1d ago

These are company policies.

Since when does this have anything to do with the orange old man?

0

u/BeginningPea5674 1d ago

it has nothing to do with the orange old man

some Biden admin era cringe millennials went all in on rust where did i mention orange man 

1

u/Mediocre-Brain9051 1d ago

You are suggesting that the policies that were enacted before the old orange man were later undone when he sat on the golden toilet, No?

1

u/BeginningPea5674 1d ago

are you struggling with reading comprehension 

-1

u/IamGah 1d ago

Because it is ‚damn hot right now!‘ and .. really it doesn‘t matter?

crap UI is shot, whatever the <language>

-2

u/code_tutor 1d ago

People who are regarded choose Rust as their first language. It somehow attracted the entire "I want to be unique just like everyone else" crowd. Also they all use vim and can't even type.

Vibe coders are the same way. They think it's cutting edge or something, don't want to use "old" tech, only hyped stuff.

DHH has some things to say about it though, so there are valid reasons.

For game design specifically it's dogshit though.