TWiR quote of the week

Rust helped me grasp concepts I should have known when writing C++

-- Microsoft intern Alexander Clarke in this blog post: https://msrc-blog.microsoft.com/2019/10/16/an-interns-experience-with-rust/

10 Likes

Slightly off-topic, but I've had the experience in the exact opposite direction: having written lots of C++ and having been constantly looking for improvements and patterns that ensure safety, Rust had basically no learning curve for me.

4 Likes

As the intern honestly admits in that blog, most users of high level languages have no idea where the memory is they are using and who else is using it. It's not something they think about until they get the segfaults and corrupt data.

Can't blame them. The whole thrust behind high level languages since forever has been to abstract away all those annoying details. Works fine in Javascript but it's an abstraction too far in the case of C++.

Memory in C++ is a leaky abstraction (see what I did there :slight_smile: )

1 Like

I came from C# where I found that low level memory things were kind of swept under the rug and left to the compiler to deal with. These kinds of things interested me so I tried C++. To put it simply, I was not prepared to deal with C++, so I instead switched to Rust, and have found that dealing with the details of low level things can be nice and refreshing little niches, opposite to my experience in C++ and present compared to C# (At least at the time and my understanding of it).

5 Likes

:grin:

let txt = child.expect("this is safe")
    .get_text().expect("this is safe");

…man, starting to dig through the source code of a really large open source program is so weird. It’s like wandering around a giant cathedral that’s being constantly renovated and repaired and maintained over the course of years by a giant team of invisible crafters and architects, who mostly communicate via notes and designs pinned to the walls in various places.

From https://wiki.alopex.li/WhereRustcSpendsItsTime

29 Likes

Woah, I just came here to suggests this. I'm only half surprised someone else has before.

Aaaaaa I wrote an article because of a quote in TWiR and now a quote from it is being submitted to TWiR!

Mind blown.

7 Likes

Question on community discord:
Well, what is the difference between:
let closure = |_: Id<'_>| {}

and:
let closure = |_| {}

Answer by Ari:

One is a closure, the other is a toilet

8 Likes

I'm never gonna ask that question again... Oh, and I can't unsee it now, thanks y'all

1 Like

I can't tell which one is which?

From Writing "fluent" code, creating objects with reference to self and lifetime subtyping

6 Likes

From std::marker::PhantomData and unused fields in structs:

7 Likes

Rust and rustaceans being what they are, if you say „performance“ you can expect few crates to pop up.

From: https://vorner.github.io/2019/11/03/io-uring-mental-experiments.html#what-exists-already

2 Likes

I know the closest connection this has to Rust is being in a blog post that's a response to Gankra's "Text Rendering Hates You", but it's just so good:

In my experience, prayers are not a very effective concurrency primitive.
-- https://lord.io/blog/2019/text-editing-hates-you-too/

14 Likes

there are two hard problems in computer science:

  1. writing software that isn't in rust
  2. naming things

from https://view.matrix.org/room/!BHcierreUuwCMxVqOf:matrix.org/?anchor=$lmmD3T6f-OTVFqcUo1w-e1hiJQcbFwYBr_8_ezrywnk&highlight

6 Likes

Quite so.

I suspect naming things should be number 1 on the list. Even Rust does not help us with that.

We've previously had QotWs that weren't specifically about Rust, haven't we? I think that's actually a good thing; QotW are quotes the community "likes", which should arguably say more about the community than about Rust the technical project.

2 Likes

If being directly relevant to Rust is not required my quote of the week comes from Russell Anderson in some video about some kind of programming on YouTube I found last night:

I can make software, without knowing, whatever it is that I'm doing.

He was talking about the subtleties of Javascript. It rang true with me as I seem to have spent my life making software with a new language, operating system, application area every two years or so. Now Rust of course. Permanently in a state of not knowing, whatever it is, that I'm doing :slight_smile:

I love rust and javascript, top 2 favorite languages. Rust is very safe. JavaScript is a hot mess. I want my core game engine code safe, and my gameplay code a hot mess.

Bombfuse, on the unofficial Rust discord, on the topic of scripting languages for game engines.

3 Likes