TWiR quote of the week

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.

3 Likes

I think this is not a great comparison, since Rust's safety guarantees are much stronger than any self-driving car's.

Super off topic rant

So much of the self-driving hype is just that...pure marketing hype. Lots of claims are thrown around about the number of miles driven, but that's mostly on straight-ish roads in good weather. I'd love to see a self-driving car navigate a heavy construction area where the GPS maps are all wrong, the painted lines are going all over and/or straight into barriers, uneven road surfaces making extra "lines", flashing lights all over the place, and lanes of barrels that look like they were thrown by drunken monkeys. Add some bad weather on top of it and maybe a few pedrestrians and you have a recipe for disaster. How long until a road full of self-driving cars "see" a flooded roadway as unobstructed and a whole flotilla of cars speed into a washed out area, taking their unsuspecting passengers to a watery doom? I'd also love to see a self-driving car park at an event where the parking is in a grass field and the only indicators are guys standing around pointing where to go. Driving around and parking at a large sporting event, or a mall on Christmas Eve would also be impressive, but unlikely. Manufacturers taking the easy way out (Tesla, I'm looking at you) by suggesting that the driver be alert and ready to take over in case of "emergency", is simply ridiculous. No human being could possibly have the situational awareness and reaction speed to instantly take over in a situation where the computer suddenly decides it doesn't know what to do. Expecting such is a way of avoiding responsibility for the fact that AI driving is still little more than marketing BS.
End rant.

1 Like

To be fair, expecting self-driving cars in 2021 to drive anywhere and in any weather conditions without driver's intervention is like expecting rustc to write safe programs for you while you watch Netflix. Also, an analogy is just that - an analogy.

Rust reigns supreme as most loved.

6 Likes

By @curoli. There's a lint for that.

8 Likes

From How to write really slow Rust code (from TWIR some time ago):

Writing code in Rust doesn’t mean your code will be blazing fast. It’s easy to make mistakes and get quite slow performance.

1 Like

.

6 Likes

It's five months old, but I encountered this quote today and don't remember seeing it in here back then.

Code doesn't deal with resources until it does. Similarly with everything else that forces you to reason about control flow - you don't care about thread management until you do, you don't care about action logs until you do, you don't care about performance until you do... and from the other side, code doesn't need to be exception-safe until it does. The trouble with this kind of "magic" language feature is that correctness becomes non-compositional: you can take two working pieces of code and put them together and get something that doesn't work.

-- lmm (Mickey Donaghy) @ > Not all code deals with resources. Streaming parsers normally don't. When you ... | Hacker News

(The full name was found by following the "this is also me" in the YCombinator user profile to the associated GitHub profile.)

I've never seen Rust's "complexity" put both from that angle and as succinctly as those last two sentences.

10 Likes

From a zulip thread i started by Lokathor

Note: function pointers are not always aligned, though some platforms may have them be aligned

Anyway: the standard library docs say "check the nomicon"
then the nomicon says "here is some advice and ultimately we don't know, maybe check UCG"
then UCG says "ultimately we don't know it's probably like this but there's no RFC yet"
then Ralf says "probably it should be allowed if the layout matches".

I found this pretty funny and sad.

Not sure whether to include the first sentence or not, you decide :slight_smile:

9 Likes

From @H2CO3 in Rationale behind Fn, FnMut and FnOnce design

9 Likes

From the russian telegram chat room Telegram: Contact @rust_offtopic

Original:

Кстати я знаю чем занимается борроу чекер
Чекает не свихнулся ли ты еще

In English:

By the way i know what borrow checker does
Checks to see if you're still crazy

1 Like

Isn't the translation inverted? "Не свихнулся ли ещё" literally means "isn't crazy yet".

Both are correct in their own way. The craziness is UB.

1 Like
Edition!

From: Rust 2021 Edition - YouTube

6 Likes

A huge :orange_heart: of Rust is "you're holding it wrong" is considered a language bug.

6 Likes

Hot take: Rust isn't as hard as it's detractors think it is, and it isn't as easy as we want it to be. But I think we have a better chance of becoming easier to use than easier use languages becoming lower level without compromises.

Link

7 Likes

I think Rust being difficult is like saying you had good parents because they let you play with knives. Rust may seem hard at first but borrowck is just looking after you.

To elaborate writing a fast and memory safe multi-threaded webserver is easy in Rust; if it compiles it works, but difficult in C since while it may be easier to get it to compile it might not work correctly.

2 Likes

the strains of the project have hurt a lot of people over the years and I think maybe the only path to recovery involves getting some distance from it.

Graydon Hoare on Twitter

2 Likes
1 Like