On last week's TWiR I read the following qote in Was Rust Worth It? by Jarrod Overson:
Programming in Rust is like being in an emotionally abusive relationship. Rust screams at you all day, every day, often about things that you would have considered perfectly normal in another life. Eventually, you get used to the tantrums. They become routine. You learn to walk the tightrope to avoid triggering the compiler’s temper. And just like in real life, those behavior changes stick with you forever.
The framing of this is a bit unfortunate, and after I shared it in my friend group someone came up with a different framing:
This quote can be attributed to Poyo_SSB if it makes it to TWiR
Good grief that says more about the author of that statement than it does about Rust. Rust does not scream at me or have tantrums. I have constructive discussions with the compiler.
How about "Programming in Rust is like playing in the yard with your loving mother watching out that nothing bad happens to you."
But really, personifying these things is not very meaningful.
Dude still got it backwards. Having "someone" (something) catch your mistakes is liberating and good, not bad.
I really despise both excerpts and think that they shouldn't be Quote of the Week.
True, but I think a shared experience for some people is that -- after some initial very nice compiler errors that almost let you leave your c induced segfault trauma behind -- the compiler informs you about a lot of things that you don't really understand and don't want to think about. So it does feel like someone is nagging you. The goal of the story is to foreshadow a time in which you got used to the compiler errors and welcome the change in thinking it introduced and what you learned from it.
Are you talking about the Rust compiler or C++?
I guess compiler error trauma is greater for those who have never used a compiled language but I'm not seeing it as worse with Rust.
When I’m writing UI code in JS, I tend to run a lot of programs that aren’t finished yet. I have parts of it built, and want to try them out to see if it “feels” good to actually use, even though I know perfectly well that some of the functionality is missing.
You can, technically, do that in Rust, but you have to explicitly stub out the missing parts with
todo!(), which is annoying enough to do that I’ll probably just finish the design instead.
The trauma I was refering to is C compilers not giving you any errors and then just segfaulting at runtime. I just realized that that's not even a compile time issue. At the time I came from python and back then compile time and runtime where new words to me.
And your're right, apart from some errors being hard to understand because the error they describe is complex the error messages in rust are wayyyy better than what any Cpp compiler I encountered can give you.
Ah yes, that trauma hit me when I first learned C in the early 1980's. I was shocked to find the compiler would build totally non-functional executables that crashed in mysterious ways and often required the machine to be rebooted (MS DOS days).
That surprised me even though I had prior experience of a compiled language. ALGOL did not do that.
This is why these days for me the number one selling point for rust is "No UB in safe rust". Much more than anything else.
As someone who successfully avoided using memory-unsafe languages until picking up a DOS retro-programming hobby after learning Rust, I'd say the best argument for people coming from the other side is either the amount of "if it compiles, it works" that you can encode in the type system, or the large ecosystem of things like PyO3, Wasmer, etc. that allow you to write code once and reuse it across all languages you write.
As suggested in the linked thread, I'm nominating this comment (or some part of it) to TWiR quote of the week:
I just wanted to say a huge thanks to everybody involved in producing the experience that is Rust. Things I highly value in Rust:
- community: it could so easily have adopted the worst of the Haskell mindset, and yet, for the most part, it is welcoming, accessible, friendly, and supportive.
- cargo-fmt: I really appreciate how unconfigurable it is - consistency general wins, particularly when it comes to subjective styling.
- test: the inbuilt testing framework is good enough. One more piece of the "on ramp" provided for you
- traits: the strategy pattern in all its glory. Ok, there is a little too much machinery around them (
Sized etc.), but that's an experience thing.
- enums: sum types as a front-and-centre programming construct. They are exactly the right tool for expressing, well, sum types! One of this, or that, or those.
- the three bears: just enough FP, just enough procedural, and just enough OO
- cargo/workspaces: move over maven, ant, gradle, etc., go home, you're drunk!
- performance: it's just so fast for such a high level programming language.
- std lib: it has a very large std lib, but thanks to judicious use of
traits it isn't overwhelming.
- clippy: a pedantic, opinionated, and vocal opinion on these sorts of decisions has replaced a large part of my job ;-). I don't know why it isn't more used instead of
cargo clippy --fix --all is just <chef's kiss>
- solid: the language and core machinery around rust is just rock solid. At least, I haven't run into any issues that haven't turned out to be either well documented, my misunderstanding, my false assumption, or me being a muppet.
- documentation: the std library documentation, and community crates in general, are excellent. Good doc takes far more time than good code, so thank you.
- you: thank YOU for putting your time and effort into this wonderful project.
Of course, there are pain points, and there are some gotchas on the on-ramp, but they are a small price to pay.
So again, thank you. Now, turn off your computers and go play with your kids, pets, buddies, or failing all of that, go and donate some time to your local community :-).
Thanks everyone - community - The Rust Programming Language Forum
Today @Yandros took me on an epic journey
to Mordor through their struggles with specialization when I stumbled across one of the most hilarious doc comments I've ever read:
Behold, the smoking remains of some ravaged Rust code, the result of an
invocation gone awry, for Yandros had been awakened from their slumber.
The Intelligence Dampening Sphere, thinking it could overtake Rust and its
constraints, had engaged in a devastating battle.
But the Crab was no easy creature to subdue, and no matter how many
cursed poorman specialization stabs were taken against it, the Crab remained,
Unwilling to admit defeat, the challenger, desperate, started chanting an
ancient incantation from the forbidden times, unwittingly dooming us all:
The Crab immediately unleashed an ear-piercing shriek of pain, after which
there was no sound: complete and utter silence.
Tread carefully among these paths, adventurer, and forgo any hope for sane
Never seen spezialization in action, but I imagine this is what it does to people. I've spent most of the day staring at the code and I've still no idea what I'm looking at.
On the topic of "hyperoptimisations"...
Thanks for nominating my quote. Although it seems to miss a bit of context within the the rust newsletter😅
From Is Rust compile time really that slow?
Just ran across this little pearl:
The entire post is worth reading, it's a fun little rant.
For some reason, people named Daniel write the funniest posts . I've thought about creating a dedicated topic for hilarious posts (which too often don't make a good enough quote of the week, unfortunately). I'm pretty sure @DanielKeep and @Yandros would fill this hypothetical topic with lots of great content.
A little late, compared to the October post date, but I thought people might appreciate this:
Fighting with someone else's stupid is often easier than creating a new custom stupid to fight with all while maintaining the new stupid.
-- jwarnica on the question of why the Linux kernel doesn't create a
moc-style preprocessor or get a new dialect merged into GCC to fix the stuff they keep coming up with new library-level workarounds for @ Better string handling for the kernel [LWN.net]
(Thanks to smoogen for ensuring I had "quote of the week" on the mind.)