TWiR quote of the week

If you haven't tried Rust, just grab it and work through the first couple of chapters of the rust book and do something wrong. Because the error messages in Rust is like a hug from the compiler.
"You did your best, yes, yeah. You see here, where you've done this ? No you can't do that, no it's bad. What you probably want to do is this."
It teaches you Rust. The compiler is lovely.

Mark Rendle - The Worst Programming Language Ever - Mark Rendle - NDC Oslo 2021 - YouTube

10 Likes

Self nominating:

rust is not hard, doing things right is hard. And because rust forces you to do things right, it feels like rust is hard. [...]

optionally, the full comment:

rust is not hard, doing things right is hard. And because rust forces you to do things right, it feels like rust is hard. I'd argue that other languages are even harder because the compiler does not tell you that you messed up, you have to think yourself. I use rust because I am too dump for the hard languages!

(source: musicmatze: "@pet84rik@osna.social rust is not hard, doing thi…" - Mastodon for Tech Folks)

17 Likes

:100:% this. I use Rust because I don't want to worry about my past self making stupid mistakes! :smiley:

9 Likes

Which I think captures the spirit of the forum quite well :slight_smile:

1 Like

Rendle’s language borrows nothing from Rust, “because Rust is very close to being the perfect language.” (As Rendle sees it, even Rust’s error messages are “like a hug from the compiler.”)

David Cassel referencing Mark Rendle in Comical Coder Envisions the Worst Programming Language Ever

I also feel like the compiler is hugging me.

4 Likes

This is the most fundamental philosophy of both the Rust language and the Rust project: we don't think it's sufficient to build robust systems by only including people who don't make mistakes; we think it's better to provide tooling and process to catch and prevent mistakes.

Jane Lusby, Inside Rust Blog - 19 April 2022

The post in general expresses well the openness of the Rust community to encourage people to participate instead of gatekeeping and insults you see in other communities.

17 Likes

Rust makes me feel like I can step into more areas of software that I was previously unfamiliar with

Source: https://twitter.com/chrisbiscardi/status/1518610355844382720

7 Likes

I really like to compare programming languages to types of parents.

Python - Rich parents that like to think that they care about you by throwing money at everything, you have all the possibilities but zero guidance and help when you have a problem. Overall it's okay but you get irritated by the lack of order. It's fun though if you want to go for all the rollercoaster rides around you.

C/C++ - Parents that do not care at all, you can do everything, they don't really care if you are alive or not. You might think that you are responsible and you will never do something bad but everyone fails once in a while(and then you are f*cked). When there's a problem your dad/mom drunkenly mumbles something you barely understand.

JavaScript - Your parents have good intentions but don't know what to do with a child at all, they come up with random rules that "WE FOLLOW" and make up reasons as they go, overall some of it makes sense but you are confused 90% of the time.

Rust - You feel that the parents are smarter than you almost all the time. They set up a bit limiting rules that sometimes annoy you (sometimes you even hate them) but then pretty much always when you actually think why they set up those limitations it is because they care about you and what you do. If you are brave enough you can tell them to close their eyes and only then you can do whatever you want, but you know that this should be used wisely.

-- IDontHaveNicknameToo @ https://www.reddit.com/r/rust/comments/uboyeq/why_is_rust_the_most_loved_programming_language/i66ixy2/

14 Likes

rust safety guarantees do not cover people eating the pizzas

Sahl#2307 on the community discord

3 Likes

"Ah but logic errors can happen with all languages" yes and I'm sure trains occasionally run into trees as well, but cars are way more likely to. :upside_down_face:

25 Likes

The safest program is the program that doesn't compile

-- ancient Rust proverb

8 Likes

I was going to submit a quote, but Amos's quote is going to win anyway :joy:

3 Likes

Amos also has an updated quote (rolls off the tongue slightly better imo) on the followup blog post:

And you can write logic errors in just about every language! And if you try hard enough I'm sure you can drive a train straight into a tree! It's just much easier with a car.

6 Likes

My preferred response to this argument goes like this:

3 Likes

Edit: nvm... Somebody already got here first: TWiR quote of the week - #1219 by crumplecup

I'd like to stretch up a bit the concept of "quote" for TWiR and use a portion of a video. I'll include a transcript after it (if I manage to get everything right).

The Worst Programming Language Ever - Mark Rendle - NDC Oslo 2021

So, nothing is taken from Rust, by the way, because Rust is very close to being the perfect language. And Rust's borrow checker (and lifetime checker and all this other stuff) they make your life very difficult. But the reason they're making life very difficult is because the things you are trying to do are really, really bad and you shouldn't be doing them, and they have the potential to cause your program to crash and do unexpected things.
And Rust knows this and it is not going to let you do these things. But if you haven't tried Rust, just grab it and work through the first couple of chapters of the Rust book and do something wrong, because the error messages in Rust... it's like a hug form the compiler. It's just "There, there. You did your best. Yes, yes. No, you see here where you've done this? No, you can't do that. No, no, i'ts bad. No, what you probably wanted to do was..." It teaches you Rust. The compiler. It's lovely.

The shorter version of a quote I believe would best be:

[...] if you haven't tried Rust, just grab it and work through the first couple of chapters of the Rust book and do something wrong, because the error messages in Rust... it's like a hug form the compiler. It's just "There, there. You did your best. Yes, yes. No, you see here where you've done this? No, you can't do that. No, no, i'ts bad. No, what you probably wanted to do was..." It teaches you Rust. The compiler. It's lovely.

2 Likes

This video has already been brought up two times.

2 Likes

I liked this quote:

3 Likes

I also liked this quote:

It doesn't matter who points out that "maybe we shouldn't hit ourselves in the head with a rake repeatedly": that feedback ought to be taken under advisement no matter who it comes from.

1 Like

From Stabilize generic associated types by jackh726 · Pull Request #96709 · rust-lang/rust

...I believe this general pattern - [Generic Associated Types] as a way to generically define an operation with types known only to the implementation - is generally useful for a lot of code, as is visible in existing languages with GATs/HKTs. Where Rust really hits the ball out of the park is that it guarantees monomorphisation, allowing these patterns to be truly zero-cost. It's difficult to overstate just how powerful that is.

5 Likes

Sorry for the spam, I keep finding things I want to post

At Cloudflare we have big Rust projects/teams and onboard new developers regularly.

There is a learning curve. Rust is rigid and unforgiving, and noobs need assistance when the compiler says “no” (although error messages and Clippy do a good job for common mistakes).

However, the big upside is that noobs can contribute safely to Rust projects. Rust limits severity of the damage an inexperienced programmer can cause. Once they manage to get the code to compile, it already has lots of correctness guarantees. “Bad” Rust code may just clone more than strictly necessary, or write 10 lines of code for something that has a helper method in the stdlib, but it won’t corrupt memory or blindly run the happy path without checking for errors. Rust prefers to be locally explicit, so it’s also easy to review.

- kornel on Lobsters

10 Likes