Product Promotion
0x5a.live
for different kinds of informations and explorations.
GitHub - jondot/rust-how-do-i-start: Hand curated advice and pointers for getting started with Rust
Hand curated advice and pointers for getting started with Rust - jondot/rust-how-do-i-start
Visit SiteGitHub - jondot/rust-how-do-i-start: Hand curated advice and pointers for getting started with Rust
Hand curated advice and pointers for getting started with Rust - jondot/rust-how-do-i-start
Powered by 0x5a.live ๐
Rust :crab:. How do I start?
A collaborative advice for this casual question that gets asked many times, so here it is as a Github repo anyone can contribute to and improve!
- ๐๏ธ Before you start, watch this repo (Github watch button) so you can get updates when we add stuff
- ๐พ Play with this page first! Take an hour to look at all the stuff that's linked from top to bottom. Watch a few videos, scroll through a couple blogs. Then start with the main track.
- ๐ทโโ๏ธ While you're working your way through, feel free to ask questions about ways to start in Rust in Discussions
- ๐ Feel free to add suggestions and PRs of your own https://github.com/jondot/rust-how-do-i-start#contributing
๐ฑ What to expect?
Some hand-selected articles to give you a feeling of what's the journey like.
- My own key learnings after 30k LOC in Rust - I can say that today the experience is much greater than back then. There's so much more to learn from, and the ecosystem is huge. Still, the core ideas in the article are relevant.
๐ Main track
This is largely the learn path you should follow. It is hand-selected, minimal, and high-value, highly effective content only
- ๐ Reading (code or text)
- ๐๏ธโโ๏ธ Exercise
- ๐๏ธ Building
- ๐ฆ The ๐Rust Book. You can read it cover to cover, or skim it. What ever you do, make sure you have a pet project idea to experiment with. You can pick ๐any of the core utils you like. The advantage of just re-implementing a core util is that you are probably familiar with one of those, they're just CLI apps and you're not biting more than you can chew, and you do have the source code in that repo for reference.
- ๐ฌ Feeling a bit lost? You can watch Getting Started with Rust: Understanding Rust Compile Errors, and part 2 which is a great intro to errors, borrow checker and more.
- ๐ฅธ If you're coming from dynamic programming languages, expect the reading process to be less "flowing" and more thinking about types and the type system. If you're stuck and want to "translate" concepts to your own dynamic world, feel free to ask here
- ๐ซถ You don't have to read it cover to cover. Get to a nice, working CLI app for starters.
- ๐๏ธโโ๏ธ If you like exercises as a learning aid, you can swap "building a small project" while reading the Rust book, with ๐๏ธโโ๏ธrustlings
- ๐งฐ Pick a hobby project that's useful for you. Something more than trivial that includes data passing and a few modules (just so you get to experience the borrow checker and data modeling) something in the scope of ๐๏ธbat. Work on it and go back to the Rust book from time to time (as well as, well - StackOverflow). Repeat, rinse.
- ๐คทโโ๏ธ Don't have an idea for a hobby project? ๐๏ธโโ๏ธPNGMe is a good project to build + it's a book and exercise format. Look at the project idea list too.
- ๐ฉ Don't want to work on a project at all? the ๐๏ธโโ๏ธtoo many lists minibook will have you building linked-lists of all kinds and is quite good
- ๐ค Asking for feedback is highly encouraged to get better at writing idiomatic, readable and performant Rust. You can ask for feedback in the Rust Subreddit or in the Rust Programming Language Community Discord Server.
- ๐ The ๐Rust API Guidelines for why things are the way they are. E.g. why
into
, and why the_mut
postfix. For understanding the Rust-"isms" around you when reading people's code. - ๐ฑ You're now ready for ๐๏ธโโ๏ธRust by example and ๐๏ธโโ๏ธRust by practice
- โซ ๐Rust patterns is a great intro to idioms in Rust
- ๐ Next, ๐Zero to Production in Rust will give you some service-ish, production-ish use cases which will round off your experience
- ๐ค When you feel curious about the "why's", pick up ๐Rust for Rustaceans. Skim it and read what's interesting to you, cover-to-cover is a hard read, unless you have the focus & time.
From here, since everyone have their own taste, visit ๐Rust Books from time to time to pick up a resource that you feel can move you forward to the next step.
๐ฆ Starter libraries - save me from choosing ๐คฆโโ๏ธ!
These are opinionated but popular choices. The goal is to avoid paradox of choice while learning.
- anyhow for error handling
- clap for CLI building
- serde for serialization, including serde_json and serde_yaml
- dialoguer for CLI prompts and console for ANSI colors and handling
- env_logger for logging and log for facade
- lazy_static for declaring static variables that have nontrivial initialization
- rayon for easy concurrency for data, vectors, arrays based workloads
- reqwest and reqwest-middleware for HTTP calls
- actix-web as a web/API server
- nom (parser combinators) or pest (peg) for building custom parsers
- insta, wiremock, and fake for testing
- tap for utility
:ok_hand: Thinking in Rust
Hand picked material to give you context, reasons, and history of how Rust evolved. Some of it is historical.
- Rust Programming Techniques (youtube) - a talk from 2018 which is more about "thinking in Rust", and will encourage using more Rust constructs.
- @jonhoo on Rust Trivia (twitter: @jonhoo)
- @jonhoo on Rust Keywords (twitter: @jonhoo)
- Getting Started with Rust: Understanding Rust Compile Errors, and part 2 - A live session with Ryan Levick exploring and understanding compiler errors and the borrow checker
๐ฅ Gold Nuggets
Great articles, blogs, videos of specific topics in Rust, that are must-read or must-watch
- Error handling isn't all about errors - a talk from RustConf 2020, which gives a fantastic overview, breakdown and ultimate tips to error handling and error libraries in Rust
๐ก Project ideas
These are easy starter project ideas, not full-blown projects, just to get you up and running.
cat
,grep
,uniq
,wc
,find
+ more. in this repo from the Command line Rust book. --Practice
CLI, stdlib, data.Difficulty
easy.- A beefed up calculator --
Practice
CLI, parsing, data.Difficulty
easy. - SMTP Protocol in Go - but implement in Rust and build a simple TCP server from scratch --
Practice
CLI, parsing, services.Difficulty
easy - CloudFormation parser. --
Practice
CLI, serde, errors, data.Difficulty
medium. - Realworld implementation in Rust. See realworld-axum-sqlx. --
Practice
Web, services, SQL, data.Difficulty
medium. - QR code generator --
Practice
CLI, modules, data.Difficulty
medium. - Redis protocol parser (RESP) --
Practice
parsing, TDD, creating Rust libraries, data.Difficulty
medium. - Add a lint to Clippy. Clippy is the Rust linter, and you might be using it all day long. How about add stuff to it?.
Practice
real world Rust, parsing, compilers.Difficulty
hard. - JSON log viewer, CLI --
Practice
CLI, TUI, modules, data, parsing.Difficulty
hard.
๐ค Looking to work with other people
Find other people that are passionate and looking to build stuff in Rust for fun.
- Rusty Ferris Club builds tiny Rust based open source projects, and you can add your ideas or requests
๐คพโโ๏ธ Hold on! I want to just play around before deciding to start
Some links to give you a feeling of Rust, if you're not ready to make the jump yet, or need some convincing to invest the time
๐ป Cool stuff to have open in a tab while working
If you have multiple screens, and like a full immersive learning experience - you can keep these open at all times
- A big cheatsheet or a smaller cheatsheet
- A fun syntax explorer explainer
- awesome-rust and are we there yet for when you're reaching out for a library or need inspiration
๐ Releasing
Mental Bridges
These links will help bridge the mental model when you're coming from Node.js
I'm a Node.js Developer
- Add Rust for node developers to your schedule, which is a soft intro just to get your bearings.
I'm a Python developer
- Check out From Python into Rust
Contributing
Please feel free to submit PRs to improve this list. A few pointers:
- The list must be concise
- If there are new tracks, feel free to open them by adding a new subtitle to this README and submit PR (i.e. "Rust for game developers, how do I start?")
Happy hacking!
Rust Resources
are all listed below.
Made with โค๏ธ
to provide different kinds of informations and resources.