I love Rust, and have for most of my programming career, so I rebuke the idea that Rust is too complex for humans. Its been stable for just over 11 years. People have been writing great software in Rust, with their monkey brains and meat fingers, for over half of my life, and many continue to do so.
Actually, in my view, Rust has always been a particularly human-friendly language since it moves so many assumptions and invariants out of your brain and into the code where the compiler can prove them for you. Once you know the rules of Rust, there's a lot less mental load in understanding code because so much is guaranteed to you by the compiler. In fact, LLMs are only so good at writing Rust for these same reasons.
Yeah, agreed. I found Rust really easy to get into. Much easier than C and C++ for instance. Sure, it took me a good month or so to really get going, which in today's time is maybe an eternity. But at that point, I was already way more confident in my skills and doing cooler things than I'd been after 5+ years of C and C++.
Thanks for the thoughtful response, but I am a bit dismayed that the take-away from the post was that Rust is too hard for humans. That wasn't my meaning at all.
I think it is beyond dispute that Swift is an easier language than Rust, just like I think it is beyond dispute that Java is an easier language than C++. By "easy", I don't mean that Swift and Java are for dummies and Rust and C++ are for the rarefied elite. Rather, I think that Java and Swift make it easy to get stuff done without needing to struggle with difficult concepts and spend a lot of time learning. There is a reason why CS curriculums switched to Java for decades over demonstrably superior languages: it fast-tracks the route to tackling essential complexity without getting bogged down in the accidental complexity.
If the take-away was "use Rust because you can just get the chatbots to vipe-slop it all for you", then I clearly wasn't communicating very effectively. No one should be creating software without understanding the code. Seriously, don't be this guy. I'll be following up with a heartfelt apology to any and all who interpreted my words as advocacy of that brand of (sadly, all-to-common these days) solipsism.
I think it is beyond dispute that Swift is an easier language than Rust
I... am not sure that's true. Swift makes it much easier to me to leak memory, and much harder to write concurrent code. Swift is also just harder to use on the platforms where one might use Rust IME.
I likewise appreciate your thoughtful reply. To clarify a bit, "rust is too hard for humans" definitely wasn't the main takeaway I had from your post, but that sentiment just hits close to home with people like DHH sloping all over the place with a language I really enjoy and respect. I'll definitely be interested to see where you take day from here.
Lobste.rs has a big Rust constituency, and I think your post didn't really say much about the way forward (the "like and subscribe" part), so unfortunately I can see why it got derailed.
I have seen that happen in other threads too -- if you say something about a language, the whole thing gets derailed.
Swift does the same things you describe, and with a lot less annoying boilerplate like “return Ok(…)” and “.map(…)” and the horrors of dealing with futures. It is So. Much. Easier. To write code with the exact same semantics.
Rust people seem to disdain such ergonomics because they want every last detail to be expressed explicitly in code, like when you pass a reference or return an optional or clone a struct. Yes, the code doesn’t hide what’s going on (except for the “?” operator, or Deref conversions), but it is such a pain in the ass to keep writing that stuff, and to filter the meaning out of the noise when rereading code.
The problem is that Swift sometimes has extra overhead in the machine code it generates, usually in the form of extra copying. So it’s not going to be 100% as fast or small as Rust. Honestly I’d take easier over as-fast-as-possible, except maybe in some inner loops, but that’s not a choice I get except by switching languages (which I did, to Rust, unwillingly.)
The big problem with Swift is that it implicitly depends on a really big standard library — largely because of its overdesigned string API — and while that library can be swept under the rug on Apple platforms because it ships in the OS, other platforms don’t have that advantage, so when you build for those platforms you suddenly find your binary size jumps by 10 or 20 megabytes. (Not exaggerating.)
(Another contributing factor is that some things about reflection apparently make it impossible to effectively dead-strip unused code, as I found out when Bloaty showed that my release-mode binary contained everything from the huge AsyncCollections (sp?) package even though I only used one or two bits of it.)
it moves so many assumptions and invariants out of your brain and into the code where the compiler can prove them for you
This! And it holds for many strongly-typed languages of course. When I happen to write code in Python I feel constantly “at risk” of forgetting something.
Swift also moves those assumptions and invariants out of your brain and into the code. I feel the same about Python when I've stepped away from Swift to Python.
Disclaimer: I am, at the moment, at best, a casual rust program reader.
nearly every week there is some new project converting some massively complex codebase from language X to Rust
In my experience, there is a missing word here. IMHO, the word complex should show up twice:
"nearly every week there is some new project converting some massively complex codebase from language X to complex Rust"
I accept that others will disagree. Some have already written so here. I humbly submit that there's a bit of incentive driven survivor bias there. It takes all kinds, 20 years ago, it was C++ vs those that, er, uh, didn't. It will be interesting to see over time, if simpler paradigm languages (probably not one of the current historical batch) emerge, allowing the new AI world to be more repeatable/concise. OR if complexity is now a managed thing of the past. Maybe the story will be "GC made the hard problem of memory a management for a large swath of programming problems a non issue, and AI made the hard problem of complex language models also a non issue."
Mad props to the author and his contributions in both spots regardless.
ibomb | 21 hours ago
Some thoughts as a young programmer:
I love Rust, and have for most of my programming career, so I rebuke the idea that Rust is too complex for humans. Its been stable for just over 11 years. People have been writing great software in Rust, with their monkey brains and meat fingers, for over half of my life, and many continue to do so.
Actually, in my view, Rust has always been a particularly human-friendly language since it moves so many assumptions and invariants out of your brain and into the code where the compiler can prove them for you. Once you know the rules of Rust, there's a lot less mental load in understanding code because so much is guaranteed to you by the compiler. In fact, LLMs are only so good at writing Rust for these same reasons.
muvlon | 21 hours ago
Yeah, agreed. I found Rust really easy to get into. Much easier than C and C++ for instance. Sure, it took me a good month or so to really get going, which in today's time is maybe an eternity. But at that point, I was already way more confident in my skills and doing cooler things than I'd been after 5+ years of C and C++.
[OP] marcprux | 20 hours ago
Thanks for the thoughtful response, but I am a bit dismayed that the take-away from the post was that Rust is too hard for humans. That wasn't my meaning at all.
I think it is beyond dispute that Swift is an easier language than Rust, just like I think it is beyond dispute that Java is an easier language than C++. By "easy", I don't mean that Swift and Java are for dummies and Rust and C++ are for the rarefied elite. Rather, I think that Java and Swift make it easy to get stuff done without needing to struggle with difficult concepts and spend a lot of time learning. There is a reason why CS curriculums switched to Java for decades over demonstrably superior languages: it fast-tracks the route to tackling essential complexity without getting bogged down in the accidental complexity.
If the take-away was "use Rust because you can just get the chatbots to vipe-slop it all for you", then I clearly wasn't communicating very effectively. No one should be creating software without understanding the code. Seriously, don't be this guy. I'll be following up with a heartfelt apology to any and all who interpreted my words as advocacy of that brand of (sadly, all-to-common these days) solipsism.
singpolyma | 13 hours ago
I... am not sure that's true. Swift makes it much easier to me to leak memory, and much harder to write concurrent code. Swift is also just harder to use on the platforms where one might use Rust IME.
ibomb | 14 hours ago
I likewise appreciate your thoughtful reply. To clarify a bit, "rust is too hard for humans" definitely wasn't the main takeaway I had from your post, but that sentiment just hits close to home with people like DHH sloping all over the place with a language I really enjoy and respect. I'll definitely be interested to see where you take day from here.
andyc | 15 hours ago
Lobste.rs has a big Rust constituency, and I think your post didn't really say much about the way forward (the "like and subscribe" part), so unfortunately I can see why it got derailed.
I have seen that happen in other threads too -- if you say something about a language, the whole thing gets derailed.
snej | 13 hours ago
Swift does the same things you describe, and with a lot less annoying boilerplate like “return Ok(…)” and “.map(…)” and the horrors of dealing with futures. It is So. Much. Easier. To write code with the exact same semantics.
Rust people seem to disdain such ergonomics because they want every last detail to be expressed explicitly in code, like when you pass a reference or return an optional or clone a struct. Yes, the code doesn’t hide what’s going on (except for the “?” operator, or Deref conversions), but it is such a pain in the ass to keep writing that stuff, and to filter the meaning out of the noise when rereading code.
The problem is that Swift sometimes has extra overhead in the machine code it generates, usually in the form of extra copying. So it’s not going to be 100% as fast or small as Rust. Honestly I’d take easier over as-fast-as-possible, except maybe in some inner loops, but that’s not a choice I get except by switching languages (which I did, to Rust, unwillingly.)
The big problem with Swift is that it implicitly depends on a really big standard library — largely because of its overdesigned string API — and while that library can be swept under the rug on Apple platforms because it ships in the OS, other platforms don’t have that advantage, so when you build for those platforms you suddenly find your binary size jumps by 10 or 20 megabytes. (Not exaggerating.)
(Another contributing factor is that some things about reflection apparently make it impossible to effectively dead-strip unused code, as I found out when Bloaty showed that my release-mode binary contained everything from the huge AsyncCollections (sp?) package even though I only used one or two bits of it.)
gignico | 21 hours ago
This! And it holds for many strongly-typed languages of course. When I happen to write code in Python I feel constantly “at risk” of forgetting something.
kevinc | 3 hours ago
Swift also moves those assumptions and invariants out of your brain and into the code. I feel the same about Python when I've stepped away from Swift to Python.
travisgriggs | 20 hours ago
Disclaimer: I am, at the moment, at best, a casual rust program reader.
In my experience, there is a missing word here. IMHO, the word complex should show up twice:
"nearly every week there is some new project converting some massively complex codebase from language X to complex Rust"
I accept that others will disagree. Some have already written so here. I humbly submit that there's a bit of incentive driven survivor bias there. It takes all kinds, 20 years ago, it was C++ vs those that, er, uh, didn't. It will be interesting to see over time, if simpler paradigm languages (probably not one of the current historical batch) emerge, allowing the new AI world to be more repeatable/concise. OR if complexity is now a managed thing of the past. Maybe the story will be "GC made the hard problem of memory a management for a large swath of programming problems a non issue, and AI made the hard problem of complex language models also a non issue."
Mad props to the author and his contributions in both spots regardless.
[OP] marcprux | 20 hours ago