TWiR quote of the week

I know what you mean, but for me this is just too much guesswork on the compiler's part. As far as I know, whitespace between tokens does not matter anywhere in Rust right now. (Also, not all generated code comes from macros.)

It's not like making the mistake will get you a typechecking program that only misbehaves at runtime. In contrast to similar issues in dynamic languages, such as the "interesting" case a in b < c in Python.

[please insert kind reminder to move these discussions into a new thread]
Thank you very much ladybugs and gentlecats.

4 Likes

"Although rusting is generally a negative aspect of iron, a particular form of rusting, known as "stable rust," causes the object to have a thin coating of rust over the top, and if kept in low relative humidity, makes the "stable" layer protective to the iron below"

From: Rust - Wikipedia

17 Likes

I assumed someone made a recent change in Wikipedia in a jest.
So I tracked the change in Wikipedia, and it is more than a year old.
The WIkipedia diff.

3 Likes

No, that is a real thing. It is sometimes used to protect steel infostructure. Although it has gotten less common as it does not hold up as well in the wild as it does in the lab.

I do love how ambiguous that quote is. It can so easily be read as using rust as a metaphor for Rust.

3 Likes
<mbrubeck> I think that I shall never see
<mbrubeck> a poem as pretty as Result<Option<T>,E>
8 Likes

Every great language needs a Steve.

Someone from hackernews about @steveklabnik: Every great language needs a Steve. If you don't read anything else programming ... | Hacker News

By the way, let me tell a personal story of how I've actually got involved with Rust.... This happened shortly after 1.0. At that time, I've just finished the year-long C++ course for master's students at my university. The course instructor was really really great, and I've got a solid understanding about major moving parts of the language. I'd read "the C++ programming language" book before, and I'd even pushed some semi-production C++ code, but, after working with the course instructor, I came to realization that I hadn't knew a thing about C++ before! So, my conclusion was that everyone who wants to touch C++, should really attend a university and take a proper master's-level C++ course.

And then, Rust comes into my life. I open a nice minimalist webside, and I see a link to "The Rust Book" there. I click the link and I see the official book which just goes and teaches you how to use the language! So, I've read the book and I could program in Rust! (granted, I needed quite a lot of practice to stop fighting the borrow checker and to learn that you shouldn't put extern crate rand into each and every of your modules, but these are details :slight_smile: )

The fact that there is an official book which you can just read and be able to use the language astonishes me even today!

Thanks a lot to all of you, who contributed to Rust documentation in any form, and especially to @steveklabnik! :heart:

20 Likes

If C is like playing with knives and C++ is like juggling chainsaws then Rust is like parkour wearing protective gear while suspended from strings. It may look ridiculous at times, but you can do all sorts of awesome moves that would be damn scary or outright impossible without it.

-- u/llogiq on r/rust

17 Likes

Dialog between @matklad and @arielb1 here:

Joke that it looks like SoA, ECS, and that we should build compiler like a game engine so that we can rewrite a browser like a game engine.

The compiler itself is already an ECS, this is just pushing stuff to the parser too.

4 Likes

Honestly, after more than 25 years of C (and C++), I've become very frustrated with the average C code I seen in the wild. OpenSSL is fairly typical, in a lot of ways. So much C code has buffer overflows, numeric overflows, memory leaks, double frees, undefined behavior, and an an endless number of bugs. There are exceptions—djb's code is quite good, dovecot seems reasonable, OpenBSD audits aggressively—but when I dive into most C code, I expect problems.... I'm tired. I don't want to rely on programmers practicing constant, flawless vigilance.

-- u/emk on r/rust

9 Likes

moz irc, #rust

15:40 < Ske> Oh, that compiles
15:40 < Ske> This is gonna bite me in the ass sooner or later isn't it

very zeitgeist imo

2 Likes

Anything that will make wasm nicer will be awesome, but honestly, I'm thrilled with what we've got. It feels absolutely insane that I can just compile this language that's basically the opposite of JavaScript and it's running in the browser.

Tomas Sedovic at https://aimlesslygoingforward.com/blog/2018/01/10/rust-2018/

Suggested by u/ErichDonGubler

5 Likes

Rust: spend your lifetime thinking about lifetimes.

– /u/heysaturdaysun

Source: Reddit - Dive into anything

3 Likes

Failure is not an OPTION<T>.
It's a Result<T, E>.

14 Likes
4 Likes

winapi is big. Really big. You just won't believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist, but that's just peanuts to winapi.

When cargo doc was designed, they did not forsee winapi. They did not believe the legends. The warnings.

But now, like the Cygnus, caught in the pull of a black hole, all we can do is fall. Fall into darkness.

https://www.reddit.com/r/rust/comments/7td9yq/cargo_doc_takes_forever_anyone_know_why/dtbmt39

u/Quxxy on r/rust (suggested by u/jswrenn)

14 Likes

Seeing this just after a now-deleted-for-inappropriate-tone example in the discussion around RFC 2308 (which mentioned a 330-variant enum in SPIR-V) made a half-formed draft of the following come to mind:

Rust: The Murphy's Law language for programmers tasked with works both subtle and powerful.

(I had to ad-lib the "tasked with works both subtle and powerful" part because I couldn't google up whatever reference was tickling my brain.)

1 Like

Rust has a very high friction coefficient.

We call it grip and it lets us drive fearlessly around hard corners very fast.

/u/asmx85
https://www.reddit.com/r/programming/comments/7ugm8e/c2_c_with_cleaner_syntax_a_module_system_no/dtkde2s/

26 Likes

Even though it's an obvious typo, I must nominate @droundy's statement about eternal love:

If a panic or exit happened in the loop, then the variable would not love forever.

From: Passing a borrowed variable to a thread from an endless loop - #2 by droundy

I'm very happy that Rust saves us from such dire consequences.

9 Likes

Rust's standard regex library isn't the fastest in the world, and the lack of backtracking can be limiting, but it is highly optimised for Rust's main use case of posting showoff comments on Hacker News.

From Regular Expression Matching Can Be Simple and Fast

4 Likes