TWiR quote of the week

The Rust stdlib is getting blazingly faster sort implementations! : rust

Holy shit, what an incredible feat of work. 2 years of research and implementation. More than 2 months since they opened the PR and patiently worked through all the concerns raised by reviewers.

And the perf numbers look incredible!

They've designed 2 separate algorithms, one stable (design doc) and one unstable (design doc). The level of detail, care and patience that has gone into this work is next level.

Also, they point out that the community did say runtime performance is a high priority in the 2023 survey. Well, that's exactly what we've got. Sorting heavy programs are about to get much faster by simply compiling with the latest rustc.

hgwxx7_ on Rust's new sort implementations coming in Rust 1.81

We believe in responsible ownership and borrowing of everything, including Gun s.

https://www.reddit.com/r/rust/comments/1dlrg6t/is_rust_political/l9qnhlu/?context=3

“You really think someone would do that? Go on <insert language package manager here> and publish bad code???”

– @nytpu@tilde.zone

Rust has no theoretical inconsistencies.... a remarkable achievement...

Simon Peyton Jones. 46 minutes into here: Exploring Verse, Haskell, Language Design and Teaching (with Simon Peyton Jones)

High praise indeed coming from someone who takes formalism and correctness so seriously.

This link jumps straight to Simon Peyton Jones mentioning Rust. He talks about Rust's formal status with the show host for about 2 minutes.

The inherent problem is with human beings. The reason other languages are easier to prototype is is specifically because they don’t have guardrails. [...] This is the reality of languages that are easy to prototype in, they make it easy to move about freely with just one’s own naive assumptions about how a system should work, deliberately not being forced to take into account the entire state of the program. Then reality flies in the developer’s face and sod’s law painstakingly shows them every potential state their program can be in that they did not account for. I want to call this “the sin of naivety”. It’s impossible to be skilled enough to avoid this either, even the best programmers on earth make plenty of mistakes in C. It’s a problem well above what the human mind alone can handle, which is why we have these “hard” languages like Rust and Haskell, to act as our own extra hardware so we can think and reason better, better than our little monkey brains can handle.

— kameko on Lobste.rs

Making unwraps easier to perform just sounds like someone trying to introduce exceptions or nulls into Rust. [...] even if I’m pretty sure it’s not going to be None/Err, I still properly handle that case by logging it and returning early, not panicking. Yes, it’s more verbose, but that’s not Rust’s fault, it’s the universe’s fault for making reality do things I wish it didn’t, like having flaky network connections or buggy programs. Some might consider that statement to be cope (I’m not wrong, everyone else is wrong!) but genuinely, what are you gonna do if there is an error? Crash? Ignore it? Make up an answer in it’s absence like a hallucinating LLM? You have to do something, and Rust makes you, even if that decision is to crash, at least it’s an explicit decision, unlike exceptions.

— kameko on Lobste.rs

On this thread.

all that it's possible

Q: How far from completion is the project:
A: Hard to say. The codegen is mostly feature complete (besides async), and the only thing preventing it from running more complex code are bugs. If I knew where / how many bugs there are, I would have fixed them already. So, providing any concrete timeline is difficult.

https://www.reddit.com/r/rust/comments/1doh929/comment/la9oo2i/

The last sentence is such a good summary of so many project updates that I think it needs to be quoted more often.

This nomination elided some parts that I think are important context for the "properly", which inspires me to propose an alternative QoTW:

Is it a bug if the program couldn’t build a regular expression from a static string literal? Yup. The programmer typed that regex. It should be correct. So a panic is appropriate.

From https://blog.burntsushi.net/unwrap/

:thinking: Isn't that a quote of, um, 98 weeks ago?

From the same article, I really like this quote:

Being wrong fast is not impressive...

the compiler usually doesn't complain about [you] doing undefined behavior because it doesn't know that you're doing undefined behavior.

~ @Noratrieb in https://github.com/rust-lang/rust/issues/125658#issuecomment-2135511362

For the question:

Is there something like “Rust Core Guidelines” (like “C++ Core Guidelines”)?

The answer by @kornel in Is there something like "Rust Core Guidelines" (like "C++ Core Guidelines")? - #3 by kornel

In Rust, the preferred solution is to avoid the need for such document to exist. ...

From The missing parts in Cargo:

I have a dream. A dream that Cargo has its own release cadence, so it is free from the strict stability curse and can then ship major version releases.

From Pinned places:

Properly understood, imperative programming involves code operating over a world of objects, these objects have types, which enumerate the set of possible values the object could have, and these objects exist at places; as a result they also have a notion of identity, in that while two different objects at different places may have the same value, they do not have the same identity. Any programmer knows these facts intuitively but we often elide them when we speak about programming and often cannot clearly explain them, in the same way we successfully use our native languages without being able to explain their grammar.

Man, rust crates are so allergic to 1.0 that they'll skip all the way to version 22.

/u/darkpyro2, commenting on the official Reddit post announcing WGPU's bump from version 0.21.* to 22.0.0.

JavaScript, Python and SQL are all highly-desired and admired programming languages, but Rust continues to be the most-admired programming language with an 83% score this year.

-- StackOverflow survey results 2024

I don't know what is better, the original saying to the reply to it :smile:

@pubfnbar on URLO (Add a lint to warn against early returns inside closures - #14 by pubfnbar - tools and infrastructure - Rust Internals):

Currently with 37 votes in, the poll shows that 97% think that labeled break should not be used for early exits in closures. I want to point out to the small minority of us who thought that labeled break should be used for that purpose, that it's important that people write code in idiomatic manner because code consistency makes it easier for other people to read. This is why I introduced this as a warn-by-default lint, which would have forced everybody along the ride. Therefore we, the small minority, should not start using labeled break s for early exists in closures, even though we thought that it was a good idea - code consistency is more important than our personal preferences.

To which @pitaj replied with:

A very humble and thoughtful response. Why the Rust community is great!