TWiR quote of the week

RustConf 2021: - Compile-Time Social Coordination by Zac Burns

Do you want to know what was harder than learning lifetimes? Learning the same lessons through twenty years of making preventable mistakes.

Perfect.

25 Likes

Shameless plug :blush:

"All applications that can be (re)written in Rust will eventually be (re)written in Rust" - Riemer's law

Posted on Mastodon.

See Atwood's law for context. :grin:

3 Likes

From How can we teach people about self-referential types?

11 Likes

Twitter surfaced this and I couldn't help but to nominate this tweet :joy:

https://twitter.com/Gankra_/status/1443624416986939400

They go on to say:

i lived in a glorious ivory tower of algorithms and datastructures, absolutely refusing to think about what the fuck was in std::fs, even while i was literally on the team that ostensibly maintained it

now my tower is in ruins, i know what an OpenOptions is, alas, i am no more

i must soothe my burns with the knowledge that i still have absolutely no idea what is in std::net

although even that is ash in my mouth knowing i was also forced to actually write the word "async" like a coward and a fool

12 Likes

Rust really turned me on to the idea that there are actually two places to put data of indeterminate length: space (heap), and time (iterators, write-APIs)

Brandon Smith on twitter

13 Likes

There's a common trope among people unfamiliar with rust where they assume that if you use unsafe at all, then it's just as unsafe as C and rust provided no benefit. Comparing C's approach to safety vs Rust's is like comparing an open world assumption to a closed world assumption in formal logic systems [1]. In C, you publish your api if it's possible to use correctly (open world). In Rust, you publish a safe api if it's im possible to use in correctly (closed world). Rust's key innovation here is that it enables you to build a 'bridge' from open world (unsafe) to a closed world (safe), a seemingly impossible feat that feels like somehow pairwise reducing an uncountable infinity with a countable infinity. Rust's decision to design an analogous closed-world assumption for safe code is extremely powerful, but it seems very hard for old school C programmers to wrap their head around it.

[1]: https://en.wikipedia.org/wiki/Open-world_assumption

source

27 Likes

Rust is the language where you get the hangover first.

Unattributed, via RustConf 2021 - Project Update: Lang Team by Niko Matsakis

11 Likes

The biggest failure in Rust‘s communication strategy has been the inability to explain to non-experts that unsafe abstractions are the point, not a sign of failure

By withoutboats at tweet

30 Likes

Working today, I realized my Javascript got rusty.

By micha_38 in the Berline.rs Matrix Chat:

1 Like

...[T]he fastest and most reliable way to make slow rust code fast is to post it on r/rust saying that it's slower than corresponding Go code, and then watch other people optimizing it.

@dpc (I think) from Reddit - Dive into anything.

37 Likes

While talking about API design

I think in general "force the user to think about the extra cases, and be explicit about ignoring them" is definitely idiomatic rust.

By illicitonion on IRLO.

12 Likes

I just said something which, in hindsight, might appeal as a quote of the week:

Rust is very much about patching or working around wetware bugs.

-- Reddit - Dive into anything

(Said in the context of arguing that the orphan rule is about preventing programmer burn-out and that machine analysis has shown that we may be better at it than memory safety, but we're not very good at stable ABIs either.)

5 Likes

I always tell myself that code quickly written just to compile looks like Order 66 executed on Christmas day.
[...]
Clones and unwrapping as far as the eye can see.

Dhghomon on r/rust

13 Likes

What you'll find is that when Rust developers are freaking out about "bad performance", the "bad" performance is still usually hundreds of times better than dynamic languages
it's just bad compared to perfect optimized ideal Rust code

Pauan on the future-signals Discord server

16 Likes

Error, Confusing is not general enough; expected Confusing<'_> , found Confusing<'_>

by @Yandros in response to @cole-miller's statement that

It seems like things always get confusing fast when higher-order lifetimes show up…

from the recent forum thread Argument requires that ... is borrowed for 'static (it is a great thread btw.)

6 Likes

And even if you could fix all of rustc's soundness holes, or otherwise prevent user code from exploiting them, a soundness bug in any third-party library can also make it possible for malicious crates to trigger arbitrary behavior from safe code.
[...]
This is why we need to emphasize that while Rust's static analyses are very good at limiting accidental vulnerabilties in non-malicious code, they are not a sandbox system that can place meaningful limits on malicious code.

mbrubeck in Regarding the Security / Safety of Libraries on Crates.io

16 Likes

By @kornel

20 Likes

Wait until you go back to Python after some time in Rust. Returning whatever you feel like from a function, having potentially uninitialized variables of whatever type, and all the other things that make Python fun feel like drunk driving a 747 when you come back.
DonLemonAIDS replying to “had my first rust moment today”

16 Likes

do not use RUSTC_BOOTSTRAP unless you're rustc bootstrapping

callie on discord

5 Likes

Probably a good rule of thumb is any SIMD code done at id software will be too clever to abstract away with SIMD libraries that aim to make it easier. :smiley:

-- FitChickFetish @ Reddit - Dive into anything