TWiR quote of the week

@DanielKeep with some profound wisdom (and a valid exception to the rule :smile:):


I just want to be convinced before adding a feature that it’s necessary

Herb Sutter in Keynote: The Evolution of C++ - A Typescript for C++ - CppNow 2023.

Even if this quote isn’t directly about Rust I find it a very useful general advice.

1 Like

The context makes this much better:

In [other languages], I could end up chasing silly bugs and waste time debugging and tracing to find that I made a typo or ran into a language quirk that gave me an unexpected nil pointer. That situation is almost non-existent in Rust, it's just me and the problem. Rust is honest and upfront about its quirks and will yell at you about it before you have a hard to find bug in production.

(just so this post is self-contained: source)


Rusts standard library, and a lot of the popular crates, are like a museum. While it does change, as new exhibitions are added, it is mostly finished. Each painting has a detailed explanation in 7 different languages underneath. Descriptions below each excitation are written beautifully, with detailed drawings, showing how everything works. It is so easy to navigate, one glance at the map is enough to find exactly what you are looking for. It is so convenient, you almost don't notice that you are learning something.

Internals of rustc are like a build site of a sprawling factory. You can see the scaffolds everywhere, as more production lines come online, and everything gets faster, better, bigger. Workers move around, knowing the place like the back of their hands. They can glance at the signs on the walls, and instantly tell you: where you are, what this place does and what pitfalls you should avoid. And you are a new hire who has just came for his first day at the new job. You look at the sign, and after some thinking, you too are able to tell roughly in which building you are. The signs almost always tell you what you need, just in short, cryptic sentences. You always can tell what is going on, with some thinking, but it is not effortless. The signs on the walls are not bad, just not written for anyone to get right away.



Is it okay to submit year old quote?

We’re already seeing a shift from a focus on pure language semantics with syntax and editor tooling seen as side projects, to a focus on usability and tooling. Rust is semantically an OCaml with typeclasses, affine types, and unboxed types. What keeps Rust from being an Inria PhD student’s thesis that nobody uses is its focus on tooling, good compiler diagnostics, and ecosystem. I’d like to see some language implementors having that focus from the beginning

source: Tooling for Tooling - , emphasis mine


By obi1kenobi:

It's very much a positive feedback loop: good tooling makes good tooling easier to build, so more of it gets built and the cycle repeats.
cargo-semver-checks stands on the shoulders of giants like rustc and rustdoc and Trustfall. Remove any one of them (or even just rustc's high-quality diagnostics!) and cargo-semver-checks wouldn't have been a viable project at all.


By @0xMB here in URLO:

This is the first programming language I've learned that makes it so easy to make test cases! It's actually a pleasure to implement them.


The problem with Rust it appears,
that it leaves programmers in tears
if they have to go back
to languages that lack
in short they've got feature-arrears.

by @llogiq on r/rust, commenting on a post titled “I never want to return to Python”.


The Rust mission -- let you write software that's fast and correct, productively -- has never been more alive. So next Rustconf, I plan to celebrate:

  • All the buffer overflows I didn't create, thanks to Rust
  • All the unit tests I didn't have to write, thanks to its type system
  • All the null checks I didn't have to write thanks to Option and Result
  • All the JS I didn't have to write thanks to WebAssembly
  • All the impossible states I didn't have to assert "This can never actually happen"
  • All the JSON field keys I didn't have to manually type in thanks to Serde
  • All the missing SQL column bugs I caught at compiletime thanks to Diesel
  • All the race conditions I never had to worry about thanks to the borrow checker
  • All the connections I can accept concurrently thanks to Tokio
  • All the formatting comments I didn't have to leave on PRs thanks to Rustfmt
  • All the performance footguns I didn't create thanks to Clippy

Adam Chalmers in Rustconf 2023 recap


There is no simple way to writing correct code, you just can have a compiler that helps you or not, those are our options at the moment.


The default answer to all feature requests is "no, make a library"

@scottmcm in How to suggest a feature to be added to rust compiler - #3 by scottmcm


When your #Rust build times get slower after adding some procedural macros:

We call that the syn tax :ferris:


After doing a best fit, we found #Rust projects were less likely to introduce vulnerabilities than their equivalent #C++ projects at all relevant experience levels, but more importantly, we found the effect was most significant for first-time contributors, who were almost two orders of magnitude less likely to contribute vulnerabilities. That is, even though Rust may have a reputation as a harder language to learn, there is a very measurable effect that makes it better for newbies. Reviewers should not have to put as much effort into reviewing code to be confident that someone making their first foray into their project is accidentally adding a vulnerability.


From Alice Ryhl on the Linux Kernel Mailing List:

For Binder to continue to meet Android's needs, we
need better ways to manage (and reduce!) complexity without increasing
the risk.

The biggest change is obviously the choice of programming language. We
decided to use Rust because it directly addresses a number of the
challenges within Binder that we have faced during the last years.


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:

I would say that programming in rust is like being in a relationship with someone who's tidy and organized. Rust is gonna get annoyed with you for leaving the lights on. Rust is gonna get annoyed with you for opening the window with the aircon on. Rust is gonna get annoyed with you for leaving the water running. Rust is gonna get annoyed with you for leaving clothes and other junk all over the floor. Rust is gonna get annoyed with you for letting the dishes pile up. You never had to worry about these with javascript! Javascript was chill, javascript would never yell at you for any of this. It feels kind of bad, like rust is kind of a clean freak. It's overbearing, but then at the end of the month you look at your utility bills and they're soooo much lower than they ever were with javascript, and then you realize that you can't remember the last time you misplaced something underneath the layer of junk on your floor. Now you don't dread cooking anymore because the kitchen is organized and you can actually find all of your spices because you have a dedicated spice cabinet and you just have to worry about cleaning the dishes you used today instead of all of the dishes from the past month.

This quote can be attributed to Poyo_SSB if it makes it to TWiR :slight_smile:


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.

1 Like

Are you talking about the Rust compiler or C++? :slight_smile:

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.