Greetings and welcome to rustlings
. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!
One language that has been gaining popularity is Rust. I learned about Rust from NoBoilerPlate's "How to Learn Rust" video on YouTube. Rust is a systems programming language that emphasizes safety, performance, and concurrency. If you are interested in learning Rust, here are some great resources that Tris outlines that I will be using, in a slightly different order.
My basic plan of attack is to use Rustlings code kata and learn by fixing tiny failing tests. If I get stuck on a rustling, I will reference Rust By Example in an attempt to keep pace and gain momentum. Using the compiler messages, I am attempting to self-identify the issue and implement the solution. This, in my opinion, is simulating a traditional problem solving techinque I would use in a real-life scenario. I must be able to identify why it's not working. If all else fails, the hint
functionality of rustlings will point me to a chapter in The Book,
Rustlings is available on Github, and you can install it on a Windows Subsystem for Linux (WSL) to get started.
In addition to these resources, I am going to complete two "sidequests", as suggested by Tris.
- Sidequest #1: Listen to Ultralearning Audiobook is a great resource that explains the principles of ultralearning, and you can use these principles to learn Rust quickly.
- Sidequest #2: Reading "The Book" a second time, this time using Brown University's Interactive Book Experiment. This will help you to absorb the information better.
-
Is this your first time? Don't worry, Rustlings was made for beginners! We are going to teach you a lot of things about Rust, but before we can get
started, here's a couple of notes about how Rustlings operates:-
The central concept behind Rustlings is that you solve exercises. These exercises usually have some sort of syntax error in them, which will cause
them to fail compilation or testing. Sometimes there's a logic error instead
of a syntax error. No matter what error, it's your job to find it and fix it!
You'll know when you fixed it because then, the exercise will compile and
Rustlings will be able to move on to the next exercise. -
If you run Rustlings in watch mode (which we recommend), it'll automatically
start with the first exercise. Don't get confused by an error message popping
up as soon as you run Rustlings! This is part of the exercise that you're
supposed to solve, so open the exercise file in an editor and start your
detective work! -
If you're stuck on an exercise, there is a helpful hint you can view by typing
'hint' (in watch mode), or runningrustlings hint exercise_name
. -
If an exercise doesn't make sense to you, feel free to open an issue on GitHub!
(https://github.com/rust-lang/rustlings/issues/new). We look at every issue,
and sometimes, other learners do too so you can help each other out! -
If you want to use
rust-analyzer
with exercises, which provides features like
autocompletion, run the commandrustlings lsp
.
-
-
Got all that? Great! To get started, run
rustlings watch
in order to get the first exercise. Make sure to have your editor open!
Thanks goes to the wonderful people listed in AUTHORS.md for making all of this possible and to NoBoilerPlate for the initial inspiration. 🎉
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
exec bash
curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash
rustlings
rustlings watch
control P exercise.rs
Quick add, commit, push
git add . && git commit -m "fix: move semantics" && git push