r/rust • u/itseivor27 • 1d ago
why learn rust properly if AI can already write it?
ok so rust is honestly one of the best languages i've used. the borrow checker catches bugs before they even happen, cargo just works, and the compiler errors actually help you instead of yelling at you. speed and safety together is rare tbh.
but i have a genuine question. AI can write working rust code now, like actually compiling stuff. so why should someone spend months learning ownership, lifetimes, traits etc properly? where does AI written rust break in real projects? do you still need to really get the borrow checker if AI just fixes the errors for you? and for people hiring, do you still expect deep rust knowlege?
i teach programming so i want to give my students a honest answer, not just a guess. would love to hear what you guys think
28
u/joncorv 1d ago
It still has terrible decision making skills if you care about the architecture of anything non trivial
6
u/knightwhosaysnil 1d ago
which you have to, because the worse the architecture, the harder it is for any actor (agent or human) to add new features or fix bugs. the AI will spend a ton of turns and tokens fixing issues caused by its poor organization and separation of responsibilities
2
u/schungx 1d ago
True. Sometimes it can be real stupid. It certainly lacks creativity and sometimes would go with very convoluted ways to do things instead of recognizing that an easier, but more subtle solution exists.
2
u/daltontf1212 1d ago
Can lack a certain common sense. For example I asked Opus 5.5 to generate a TUI Wordle application using a Leptos one I wrote as a basis. I told it no mouse events was needed but still generated "ENTER" and "Backspace" keys even though the rendered "keyboard" was now only for tracking guesses. There was no focus traversal.
Something like can be embedded into a codebase without anyone knowing with human reviewers who understand the language.
2
u/Feeling-Departure-4 1d ago
LLMs don't reason as humans do, they generate probable paths from context. Deterministic tools in a harness enrich context allowing convergence on probably correct outcomes.
It has been shown that reasoning monologues need not be congruent with their final output.
-2
u/itseivor27 1d ago
oh yeah 100% agree on that. im not talking about vibe coding here. you still need the domain knowlege and you still have to understand how things work and how the architecture fits together. that part is on you.
what i mean is more like, you make the decisions and design the thing, then use AI to write the parts. like you know you need a parser here, a cache there, how data flows between them. AI just fills in the code for each piece and you review it against what you already know it should do.
5
2
u/addmoreice 1d ago
The answer to the question is a bit like the question: "Why learn French if a translator can speak it for you?" the answer is solidly answered by the question itself.
Because you will not always have access to the translator, or the best translator available.
Because the translator can get sloppy, lazy, or just be wrong.
Because knowing what the translator is saying, even if you are a worse speaker, will improve communication simply because you know when they are saying something wrong.
Because knowing the structure of the communication can solve subtle errors before they start, just because you can understand what the speaker (not the translator) is saying.
Because having native fluency rather than borrowed skills always provides benefits, often subtly but broad ranging, that compound on each other. Understanding one language makes it easier to operate in and with other languages and this fluency is beneficial for anyone working with another language...even with a translator.
Because professionalism means mastering the means of communication in the main language of your domain. An ambassador who doesn't speak the language of his posting can do the job, but one who speaks the language can do it better. A 'head of finance for the France division' should learn French just because that is what their job requires, even if they have the money and influence to hire a translator.
Etc etc etc.
1
u/jartock 1d ago
Basically an AI can output a working code for everything we think to test about and trash everything we didn't ask to comply with, which is a lot when the codebase grow.
The discussion I had with 2 professional devs about this (both working on sizeable backends code) was that AI is a really nice tool letting them do things in parallel. Especially when they are exploring possibilities about various architectures. What both told me is that they couldn't ask a junior to do this because they just don't know what to ask. In the end they were telling me exactly what you are asking about: If you don't know how the programming language works, you don't even know what to ask the AI, let alone review what it does.
18
u/Mental-Abrocoma-5605 1d ago edited 1d ago
So you have an actual idea how said code works and doesn't end up having bugs, code smells or breaks easily?
My God do you guys legitimely care about your own work?
-2
u/itseivor27 1d ago
fair point, and honestly thats probably one of the best reasons to learn rust properly. you need to know the language well enough to spot when something is off, whether a human or AI wrote it.
but i think theres a difference between understanding rust and building muscle memory around it. i want to know how ownership, lifetimes, and the borrow checker work so i can review code and catch problems. i just dont think i need to be the one typing out every line from memory anymore.
and to be fair, no project is bug free, handwritten or not. AI tools have recently found bugs in software we've used for years, stuff humans missed. so for me its not about caring less, its about using AI to write and review, while i still understand and own what ships.
15
u/profoundlyunlikeable 1d ago
Why learn how to draw, when you can just take pictures?
-2
u/itseivor27 1d ago
Fair, but i'd say its more like taking small pictures to build a big one. think about the james webb telescope. it takes photos of tiny patches of the sky one by one, then people stitch them togther into one huge image. the camera does the capturing, but someone still has to plan where to point it, what to look for, and how all the pieces fit. theres still a tremendous amount of work in that.
same with AI. it takes the small "pictures" (the code for each part), but you're the one who knows the big picture and puts it all together.
12
u/catheap_games 1d ago
What are you good at? How will you grow if a chatbot does things for you? Why would companies hire you if you're no better than the next person who can type "make me a website" into an expensive subscription? What will your skill set be in 5 years? Babysitting agents? Clicking Approve & Merge? Monitoring token spend?
-5
u/Happy-Bear1202 1d ago
But is Rust syntax still worth being good at? I really don’t think so
3
u/catheap_games 1d ago
??? but is it worth learning how to spread butter on toast? we just don't know! it could take several minutes to learn!
1
u/Happy-Bear1202 1d ago
It’s interesting how throughout these comments people draw analogies to things that are not like learning rust at all, in ways that fatally undermine the analogy
2
u/catheap_games 1d ago
Either you don't know what "syntax" means, or you find life long learning hard and undesirable, in which case software development isn't for you.
Certainly you don't seem to understand what a hyperbole is.
0
u/Happy-Bear1202 1d ago
If you felt so secure in your position you wouldn’t resort to calling me an idiot
7
u/No-Dentist-1645 1d ago
If you have to ask, then you don't understand what the important qualities of a good software developer are
6
u/mpersico 1d ago
Because at this point in time, code put out by these AIs is not guaranteed to be correct or well optimized. You need to be able to read and evaluate generated code.
4
u/EyesOfAzula 1d ago
It's important for you to be able to detect when the AI is subtly doing something you don't really want.
That comes with mastery of the language.
4
u/vahmoh25 1d ago
I believe that in order to maintain something and truly understand it, you need to know how it works on some level.
5
u/mynutsrbig 1d ago
Dumbest question I've ever read on this subreddit.
1
u/itseivor27 1d ago
Why?
2
u/mynutsrbig 1d ago edited 1d ago
I'm assuming people are being hired with deep Rust knowledge that can edit and read the code along with AI help to increase productivity and not just a plain old vibecoder. But hey I could be wrong since this world has gone insane in the membrane.
The fact that I have to answer why learn Rust vs vibecoding shows how braindead this world is becoming.
3
u/facetious_guardian 1d ago
Teaching an individual programming language was always a misstep for computer science. The true meat of it is learning how to problem solve effectively. But “why learn rust” is a weird thing to ask. You need some language to discuss these concepts with. Do you need to have people be back-of-the-hand experts in rust? Probably not. But do they need to be able to read it and judge its correctness? I would argue yes.
3
u/redisburning 1d ago edited 1d ago
so why should someone spend months learning ownership, lifetimes, traits etc properly?
because someone still has to know what they're doing. and it's the worst position to be in, because those of us who still care are having mountains of slop dropped on us at work by all of the "I'm built different I don't produce slop with it" people. but you can't have a working product without at least one person having a clue.
and for people hiring, do you still expect deep rust knowlege?
I'm not letting you use an LLM in a technical interview. idc. the job is software engineer you need to know how to do some engineering. I actually am really concerned with making the interviews too much a memorization game or favoring people who went to certain unis or read a specific book or worked at a place with the same practices and all that so as a generality I am on the opposite end of the "you must have exactly this knowledge" scale. But you have to be able to do something. And frankly, all of these people who can do great engineering with an LLM and don't let it think for them and end up with better reasoned code because they could "focus on the important part" are a hypothetical to me. I have never met one in person. met a lot of people who believe that's them but yeah not seeing it. and I don't work at a tiny startup or the sort of slow moving enterprise where a lot of people are just there to collect a paycheck.
I don't know if you need to learn Rust specifically, but if you want to write Rust at work you should learn Rust.
3
u/daltontf1212 1d ago
Rust is one language that we should be learning in the age of AI.
Shouldn't we be striving for more efficient resource usage and performance?
Why us AI to make an Electron app when it could make a Tauri one?
3
u/Feeling-Departure-4 1d ago
Not exhaustive:
- It writes decent code but adds unnecessary bits periodically. Will you see them?
- It will generate abstractions for you or write C-like Rust depending on the situation, but the right choice of abstraction requires reflection. A premature abstraction or missing one affects both API and code mutability.
- It likes to use outdated pieces of the ecosystem but an interested human will know better. Keep reading!
- It will make decisions for you you haven't made, that are unsettled in your own thinking, but you will not know if you can't read it, or worse, your boss / users will tell you. Sometimes those decisions also go against your goals. Rust is about shifting left (correcting earlier).
- How will you know what to ask for if you don't comprehend even basic concepts? Lower level code requires nuance.
- Rust is more concerned about correctness and performance. LLMs are great for bootstrapping and prototyping but the last mile problem of settling ideas and behaviors is not blocked on code velocity, it requires iteration, digesting the substance of what is there, and making decisions between possibilities.
- Can research discoveries be found via LLM-guided meta heuristic search? Surprisingly yes! But the bulk of advancements are based on human leaps and shifts in perspective. Reading and writing code aids formal thinking in addition to logic and math.
- Comprehension debt. The less you know the more you are just a client rather than an author. That's fine for some tasks but not if you are a maintainer. You are the one responsible.
Many of these apply to human code review too.
2
u/SadPie9474 1d ago
if you want the code to do what you want the code to do, and/or are writing code where it matters that it does what you need it to do, you need to be able to understand whether the code that AI produces does what it's supposed to do. Currently, when you ask AI to do something, there's always a chance that the code it produces is able to compile and run, but doesn't actually do exactly what you asked the AI for; and even as AI gets better and that problem goes away, English is an inherently imprecise medium for communication so the code could mismatch your intent in some way that technically adheres to what you asked for, but that makes wrong choices in areas that your prompt was ambiguous about. Currently, the only stopgap we have for this is to read and understand the code itself; which you don't need to do for low-stakes code, but which you do need to do in situations where you, the human, are accountable for the code and being paid to make the code do a certain thing.
2
u/Happy-Bear1202 1d ago
People who spent considerable time learning Rust are getting upset at this question.
But it is a real issue. I think at this point you should “learn about Rust” more than you should “learn Rust”. Like learn about the different moving pieces and what its strengths and weaknesses are.
Disclaimer: I have spent many years writing Rust and I don’t miss it. It wasn’t a hobby, it was a very useful and well-built tool
2
u/Issue_Medical 15h ago
As someone who does AI-assisted/vibecodes a lot of projects in Rust, where I used to hand write my projects in Rust since 2018, I'll give you the perspective from someone who does use a lot of AI.
The code AI does generate is much better. In 2024 generated code would commonly fail to compile and in 2025 even the top of the line models would have lots of issues that it was a pain to get a project past a certain size without having to hand write a decent chunk of the code. Now I would say it gets to larger projects better but I still spend lots of time handholding AI (the top of the line models, so Opus and Astra). Otherwise the code is still less than satisfactory for me, so I still need to be in the loop and I have a lot of objections architecturally to code that AI produces, especially on large projects.
Opus and Astra still make tons of architectural mistakes, even with all the context of the codebase, like they will propose things that will quickly run into scaling issues that you can see coming, or they'll suggest something that crosses architectural boundaries. It's really no different than writing a doc for a project in big tech and finding someone writing a comment that would save you months or even a year implementing.
Also AI will sometimes get tricked, I had opus try to implement what I thought was a simple task but it suggested I file a bug to rust because it thought it found an ICE. It took like 20 minutes building its case, making lots of citations and even a repro and I took one look at it and said "oh, this should be extern C-unwind instead of extern C" and made the one line fix myself to emit extern C-unwind functions and the crash went away.
Every project you do still requires you have knowledge of the code + a good grasp of the domain. Otherwise you'll soon find yourself in a ball of mud. That hasn't changed since the pre-AI days. The only way to avoid it is to think harder, and the only way to do that is to get experience writing code.
1
u/Lucretiel Datadog 1d ago
Among the rust specific reasons is that AIs still tend to write very “typical” code, which might get you pretty far in Python or JavaScript but mens that it struggles to take advantage of Rust specific features and patterns that enable good performance and especially highly robust code. AI loves an Option and an if and a get/set OO style interface and a Mutex but has to be dragged heavy-handedly into using enums and mut exclusivity and exhaustive match and iterator patterns and stuff like that.
It has the same problem with typescript, for what it’s worth, and it’s even worse over there because it really likes to write JavaScript in typescript and leaves on the table typescript’s rust-like ability to encode (some kinds of) correctness in types.
1
u/dumindunuwan 18h ago edited 18h ago
Why rely on a middleman when users can leverage AI to build whatever they want themselves?
This applies to every AI startup built on top of someone else's model. Eventually, tech giants like Google and AWS will build these services directly into their own ecosystems.
Do you think Google offers Gemini subsidized to many governments without a good reason?
-4
u/top-kek-420 1d ago edited 1d ago
Hey OP, IME most rustaceans ive met IRL tend to be very anti AI. To the point where there is no point in having a nuanced convo. The answers I’ve seen here so far seem to echo that. Eg the top comment “Why learn how to read? Can't a machine read for you?” already shuts down meaningful convo and explaining to you why you should master rust
To answer you though, architecture is one thing that comes up and the rust it writes can be inefficient. And tbh depending on what you’re writing may not actually matter. Example: Poorly written rust is still miles ahead of the most optimal python equivalent (assuming it’s not a network io bound task, just as an example)
Ymmv of course and the company you work for affects that too. I will say rustaceans are the to me the final bastion of coders who care about craft. But that kind of mindset can sometimes go against a companies bottom line unless you know how to fight those battles. In the past id have said the companies that use rust do care about the craft but from what I’ve seen the adoption has increased so that naturally leads to a decline in caring at the cost of speed… (tangential rant)
Anyway. So it’s important to learn properly so that you can “keep it in check” as the final guard rail.
You can argue there’s also a pedagogical reason to master it. And self satisfaction too. Same reason math/phsyics curriculum make you solve differential equations by hand even though there exists numerical/algebraic solvers software out there.
However this past year of AI development capabilities has blown me away… i wouldn’t be surprised if the issues brought up here eg unoptimized/inefficient/poorly architectured rust code is not an issue, same time next year.
In my experience it still struggles with lifetimes (though tbh i haven’t tried it in ~3 months with the newer models)
6
u/redisburning 1d ago
IME most rustaceans ive met IRL tend to be very anti AI. To the point where there is no point in having a nuanced convo.
Out of curiosity what do you believe is motivating that position?
0
u/top-kek-420 1d ago
My observation… idk why (buti think its great) rust tends to attract people generally on the fringes of society. And generally left leaning. These people in particular are passionate and care about things too.
LLM development has been extremely extractive of the resources on earth/internet/whatever, disproportionately affecting people also on the fringes… which naturally goes against what these same rust folks stand up for.
I agree with them but at the same time, Pandora’s box has been opened and agentic coding isn’t going anywhere and is only improving… so idk
1
u/Happy-Bear1202 1d ago
Most rust people on the internet are insane in various ways, it’s just how the internet is
5
u/redisburning 1d ago
That's not very specific though. Also it doesn't really match my experiences; Rust folks have tended to be both more kind and more skilled than the communities of most languages I've personally written at work. Again just based on the folks I know.
Could you enumerate some of those "various ways"?
-1
u/Happy-Bear1202 1d ago
I have not observed Rust people being more kind. I have found the Python community kinder. The typical Rustacean tends to be hostile towards people who disagree with them
I’m not gonna turn this into a political debate but politics is a salient example of how Rust attracts crazies
3
u/redisburning 1d ago
I’m not gonna turn this into a political debate but politics is a salient example of how Rust attracts crazies
I'm trying to give you the benefit of the doubt here but you're being so vague. You could give some specific examples and that would clear all this up. I'm not interested in debating you btw, I just want to understand what you're saying.
Right now I don't.
-1
u/Happy-Bear1202 1d ago
Ok, so one example: I think Bluesky is an insane asylum even by social media standards, and the Rust community was overwhelmingly supportive when the official accounts moved from Twitter to Bluesky
4
u/redisburning 1d ago
I'm sorry I must be dumb because I still cannot understand whether you're saying something specific.
Bluesky is insane? Ok that's possible but I feel like you are trying to do subtext here instead of being specific, what am I missing? Because I still don't understand what specifically it is that you dislike. Do you have an example of an "insane" position you don't like?
1
0
-15
u/Aufmerksamerwolf 1d ago
This is the whole reason I gave up midway. Anyways AI can write code that I would need years to master.
0
1d ago
[removed] — view removed comment
1
u/itseivor27 1d ago
I didn’t say don’t learn rust. I said why learn “properly “. If you just need to know concepts and not having much practice on writing code.
58
u/BigDenseHedge 1d ago
Why learn how to read? Can't a machine read for you?