Zeitgeist of Rust: developing load bearing software that will survive us.
– Bryan Cantrill: The Summer of RUST (1:08:10)
.expect("this will work if the computer isn't a coward")
Credit to @firstname.lastname@example.org on Mastodon
Rust beginners worrying about lifetimes is like kids worrying about quicksand. Both turn out to be a non-issue in life.
Rust is a Fast Programming Language. Rust programs are therefore “fast,” especially so if you write them with the correct observations to the arcane ley lines of birth and death known as “lifetimes,” and also remember to pass cargo the --release flag.
<…> low-level memory-mongling is what C was designed for, and it is good at it. This is a great way to build low-level systems, but a shitty way to engineer software as a whole.
There actually are NOT very many places where the C code’s behavior conflicts with Rust’s borrowing rules. This is both somewhat surprising, because there’s no way this code was written with Rust’s borrowing semantics in mind, and also entirely sensible, since Rust’s borrowing semantics are often quite close to how you actually want your code to behave anyway.
Not a rusty quote, but still nice:
There’s two hard problems in computer engineering: cache invalidation, type naming and off-by-one errors
Sorry, that’s very much not from this week See https://martinfowler.com/bliki/TwoHardThings.html for some history
Panic is “pulling over to the side of the road” whereas crash is “running into a telephone pole”.
/u/zzzzYUPYUPphlumph on reddit.
I’d like to also nominate the full quote from the same source:
Panic is the car automatically pulling over to the side of the road, shutting down the engine, and refusing to restart when the blood-alchohol monitor detects that the driver is intoxicated and undefined behavior is letting things continue until the driver “crashes” into a bunch of school children in a cross-walk.
To be fair to @KillTheMule, that was added in an edit. (It wasn’t there 8 hours ago when I went to bed.)
None of [Rust’s] “safe” behaviors can lead to truly undefined behavior. … If an attacker can only crash or deadlock your program, that’s still bad, but it usually can’t escalate into Front Page of the New York Times levels of bad.
Another one from the same thread, qualifying Rust’s safety
[It is] not only the systems programming problems that Rust tackles and makes accessible, but also the particular intersection of different expertises and goals - the systems problems, the type theoretical approach, the commitment to an accessible user experience - that [makes] Rust a fulcrum of learning for me. Even as my knowledge grows, there [is] always a more informed person - often a world class expert - available to answer my questions.
I’ve been very fortunate over these past 4 years to have had the opportunity to become more and more involved in Rust, to the point that now it is my full time employment. It makes me so glad to hear that my work has had for others the impact that the work of others before had on me.
From this blog post:
In Rust there are entire classes of bugs that are simply impossible to create because of the compile time guarantees. Because it’s software, there will be bugs. Oh yes, there will be bugs. However, we can create all new bugs and not trip over these other ones that we’ve been creating for the last four-plus decades.
This is the payoff, and despite the strictness of the compiler, Rust’s bet is that if you learn the way you can be as productive (or more) than with another language. In Programming Rust, Jim Blandy and Jason Orendorff refer to this as “Rust’s radical wager.”
I personally think this is kinda killer feature.
Undefined behaviour never was so nice! (Yes, I know that it’s well defined by implementation, but doesn’t this sound like it?)
Who doesn’t like building abstractions like LEGO