Live data from Hacker News

Exercises to Learn Rust

rust-exercises.com

51–60 of 129 posts

Re: Exercises to Learn Rust

#51

Surprised no one has mentioned another great and similar resource called Rustlings [0] (yes very punny name). You are given some files with todo statements which you'll need to fix and make the code compile and pass all the tests. It's an interactive way to learn which is what got me through learning Rust a few years ago. [0] https://github.com/rust-lang/rustlings

The difference is that Rustlings requires the person to already know Rust whereas the link on this post (100 Exercises to Learn Rust) starts teaching Rust from the basics (assuming that the person knows another language).

Re: Exercises to Learn Rust

#52

This certainly looks great. I hate to be stickler, but on the very first page ("Syntax"), right after explaining comments, the text says "In previous exercise, you saw the greeting function..." Unless I'm missing something, this is the very first intro to Rust, and so there are no prior exercises...

You did. Read all of the first page, they tell you where to find the first exercise.

> The exercise for this section is located in exercises/01_intro/00_welcome

Re: Exercises to Learn Rust

#53
post #7

Worth noting that this set of exercises was created by the author of "Zero to Production in Rust", the well-reviewed book with the crab-in-a-human-skull cover[1]. [1]: https://www.zero2prod.com

Also the same one who is making a new web server framework for Rust called Pavex, which is apparently pretty novel in how it works compared to others like Actix Web and Axum [0][1]. [0] https://www.lpalmieri.com/posts/a-taste-of-pavex-rust-web-fr... [1] https://blog.logrocket.com/using-pavex-rust-web-development/

> Pavex is in beta, so you need to activate Pavex with an activation key: > You can retrieve an activation from the Pavex Discord server’s #activation channel after you’ve joined the beta on Pavex.dev.

Re: Exercises to Learn Rust

#54
post #51

Surprised no one has mentioned another great and similar resource called Rustlings [0] (yes very punny name). You are given some files with todo statements which you'll need to fix and make the code compile and pass all the tests. It's an interactive way to learn which is what got me through learning Rust a few years ago. [0] https://github.com/rust-lang/rustlings

The difference is that Rustlings requires the person to already know Rust whereas the link on this post (100 Exercises to Learn Rust) starts teaching Rust from the basics (assuming that the person knows another language).

I did Rustlings without any knowledge of Rust and I thought it worked great. There are links to guide & documentation pages for every exercise. It worked great to learn the basics through practice.

Re: Exercises to Learn Rust

#55
Wonder if there's anyone who (1) is reasonably comfortable in some popular programming language(s) and (2) has gone through these exercises could/would share their take on how helpful/useful these are?

Context: I've been doing Java professionally for 10+ years, Python, JS a few years ago, C++ way earlier in my career (early 2000s).

Re: Exercises to Learn Rust

#56
post #51

Surprised no one has mentioned another great and similar resource called Rustlings [0] (yes very punny name). You are given some files with todo statements which you'll need to fix and make the code compile and pass all the tests. It's an interactive way to learn which is what got me through learning Rust a few years ago. [0] https://github.com/rust-lang/rustlings

The difference is that Rustlings requires the person to already know Rust whereas the link on this post (100 Exercises to Learn Rust) starts teaching Rust from the basics (assuming that the person knows another language).

That doesn't match with my experience: I learned the language from scratch just fine with Rustlings. (In fact, I found it more approachable than the Rust Book.) The first few groups of exercises in it walk you through the basic syntax and semantics, to the point that I found it almost tedious to work through, but I ultimately came to appreciate it.

Re: Exercises to Learn Rust

#58
post #53

Earlier quoted context omitted.

Also the same one who is making a new web server framework for Rust called Pavex, which is apparently pretty novel in how it works compared to others like Actix Web and Axum [0][1]. [0] https://www.lpalmieri.com/posts/a-taste-of-pavex-rust-web-fr... [1] https://blog.logrocket.com/using-pavex-rust-web-development/

> Pavex is in beta, so you need to activate Pavex with an activation key: > You can retrieve an activation from the Pavex Discord server’s #activation channel after you’ve joined the beta on Pavex.dev.

To be fair, he did say it was "pretty novel"...

Re: Exercises to Learn Rust

#59
One observation I have with Rust, looking at the code in wild, abstractions are usually (always?) leaky - implementation details are exposed/imposed due to the ownership feature of the language.

Re: Exercises to Learn Rust

#60
post #7

Worth noting that this set of exercises was created by the author of "Zero to Production in Rust", the well-reviewed book with the crab-in-a-human-skull cover[1]. [1]: https://www.zero2prod.com

Oh nice ! I bought this book and forget to finish it for life reasons but it was really enjoyable.

Book’s name doesn’t lie , it’s literally the author taking you by the hand along the path of building a real application with real problems on a real production environment explaining everything from the basics of the language to how to keep it online.

The book is pretty opinionated (because well, since it guides you until production giving you basically all the code, choices are needed) but the author always takes the time to explain its choices and what the alternatives are.

I’m feeling like I want to come back to this book.

Post reply on HN