TWiR quote of the week

Shameless self-nomination:

When a panic has a payload that's an object which needs Drops,
And the panic hits a catch_unwind for unexpected stops
Before if its Drop panicked we'd just crash to your desktops,
Now the payload gets forgotten, and you'd better grab some mops!

-- https://twitter.com/josh_triplett/status/1407776002973986819

5 Likes
4 Likes

11 posts were split to a new topic: Rust, sloppiness, and gatekeeping

Seems worthy enough of a self-nomination.

4 Likes

By @Ethindp.

10 Likes

Beginning Rust: Uh why does the compiler stop me from doing things this is horrible

Advanced Rust: Ugh why doesn't the compiler stop me from doing things this is horrible

qDot on Twitter

30 Likes

The nasty thing about UB is that it does not guarantee that things will go horribly wrong. UB likes to lure you into thinking that you are fine... until it suddenly pulls the floor out from underneath of you and you plummet into the pit where all your code has been arranged in a nice set of spikes.

RalfJung on IRLO

15 Likes

Just replace the "Advanced Rust" with "Beginner C" (or "Advanced C", for that matter) and this will be perfect :grinning_face_with_smiling_eyes:

Lol I came here because I considered self-nominating, but you people are too quick and exceedingly well informed. :wink:

10 Likes

First of all, it seems like Pin might actually be Unpin . This might sound surprising, but really what Unpin means is that the "pinned" and "not-pinned" typestates of a type are the same

-- ralfj

Source: https://github.com/rust-lang/rust/pull/81363#discussion_r650561252

3 Likes

If I can get around ownership issues by cloning first I will absolutely do it, because I see removing clones as an optimization step. […] go and actually measure your performance to see if you actually need to remove the clones. Sometimes you don’t and sometimes you do.

-- Jonathan "JT" Turner in a Rust stream

7 Likes

Tip: whenever you wonder if Pin could be the solution, it isn't

10 Likes

One of the hardest parts of design is the way it interacts with everything. A good abstraction can sometimes cut through that tangled mess and make some parts orthogonal.

@Eh2406 on internals

4 Likes

"Four years had passed since then and the future was now; two years have passed since the future was now and the future is now past."

-- bstrie in Scoped threads in the standard library, take 2 by bstrie · Pull Request #3151 · rust-lang/rfcs · GitHub

7 Likes

We were able to verify the safety of Rust's type system and thus show how Rust automatically and reliably prevents entire classes of programming errors

Ralf Jung in Computer Scientist proves safety claims of the programming language Rust | EurekAlert! Science News

8 Likes

Rust isn't a "silver bullet". Never was. It is a car with seatbelts, airbags, lane assist, turn signals and crumple zones. You can still crash, but risk is mitigated.

Estaban Kuber on Twitter

6 Likes

Rust is an super-safe self-driving car with manual override.

I think that misses the point. Rust still lets you make logic errors, but that shouldn't discount the progress it's made. "super-safe self-driving car" seems to imply that safe rust will always be bug free, which is never a goal that rust has had, and what this quote is about.

maybe, but maybe logic errors are going the wrong way and UB is crashing the car.

(safe) rust wont let you crash, but if you give it the wrong directions that's on you.

2 Likes

I hate car analogies, especially to software things. They fall apart so quickly, even if they made any sense in the first place.

"Safe Rust" has a specific and well known meaning. At least to anyone who has studied Rust for a few minutes. It says nothing about always being bug free.

2 Likes