└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Rust :crab:. How do I start? 2 | 3 | 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! 4 | 5 | * 👁️ Before you start, watch this repo (Github watch button) so you can get updates when we add stuff 6 | * 👾 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. 7 | * 👷‍♀️ While you're working your way through, feel free to ask questions about ways to start in Rust in [Discussions](https://github.com/jondot/rust-how-do-i-start/discussions) 8 | * 🎊 Feel free to add suggestions and PRs of your own https://github.com/jondot/rust-how-do-i-start#contributing 9 | 10 | ## 🐱 What to expect? 11 | 12 | _Some hand-selected articles to give you a feeling of what's the journey like._ 13 | 14 | * [My own key learnings after 30k LOC in Rust](https://jondot.medium.com/my-key-learnings-after-30-000-loc-in-rust-a553e6403c19) - 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. 15 | 16 | # 🚜 Main track 17 | 18 | _This is largely the learn path you should follow. It is hand-selected, minimal, and high-value, highly effective content only_ 19 | 20 | * 📚 Reading (code or text) 21 | * 🏋️‍♀️ Exercise 22 | * 🏗️ Building 23 | 24 | 1. 🦀 The 📚[Rust Book](https://doc.rust-lang.org/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](https://github.com/uutils/coreutils/tree/main/src/uu). 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. 25 | * 🎬 Feeling a bit lost? You can watch [Getting Started with Rust: Understanding Rust Compile Errors](https://www.youtube.com/watch?v=hgZQJys2zpY), and [part 2](https://www.youtube.com/watch?v=9391GxkYPyY) which is a _great_ intro to errors, borrow checker and more. 26 | * 🥸 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](https://github.com/jondot/rust-how-do-i-start/discussions) 27 | * 🫶 You don't have to read it cover to cover. Get to a nice, working CLI app for starters. 28 | * 🏋️‍♀️ If you like exercises as a learning aid, you can swap "building a small project" while reading the Rust book, with 🏋️‍♀️[rustlings](https://github.com/rust-lang/rustlings) 29 | 2. 🧰 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](https://github.com/sharkdp/bat/tree/master/src). Work on it and go back to the Rust book from time to time (as well as, well - StackOverflow). Repeat, rinse. 30 | * 🤷‍♀️ Don't have an idea for a hobby project? 🏋️‍♀️[PNGMe](https://picklenerd.github.io/pngme_book/introduction.html) is a good project to build + it's a book and exercise format. Look at the [project idea list](https://github.com/jondot/rust-how-do-i-start#-project-ideas) too. 31 | * 🎩 Don't want to work on a project at all? the 🏋️‍♀️[too many lists](https://rust-unofficial.github.io/too-many-lists/index.html) minibook will have you building linked-lists of all kinds and is quite good 32 | 3. 🤝 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](https://reddit.com/r/rust) or in [the Rust Programming Language Community Discord Server](https://discord.gg/rust-lang-community). 33 | 4. 📐 The 📚[Rust API Guidelines](https://rust-lang.github.io/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. 34 | 5. 🌱 You're now ready for 🏋️‍♀️[Rust by example](https://github.com/rust-lang/rust-by-example) and 🏋️‍♀️[Rust by practice](https://github.com/sunface/rust-by-practice) 35 | 6. ⏫ 📚[Rust patterns](https://rust-unofficial.github.io/patterns/intro.html) is a great intro to idioms in Rust 36 | 7. 🚀 Next, 📚[Zero to Production in Rust](https://www.zero2prod.com/) will give you some service-ish, production-ish use cases which will round off your experience 37 | 8. 🤔 When you feel curious about the "why's", pick up 📚[Rust for Rustaceans](https://nostarch.com/rust-rustaceans). Skim it and read what's interesting to you, cover-to-cover is a hard read, unless you have the focus & time. 38 | 39 | From here, since everyone have their own taste, visit 📚[Rust Books](https://lborb.github.io/book/) from time to time to pick up a resource that you feel can move you forward to the next step. 40 | 41 | ## 📦 Starter libraries - save me from choosing 🤦‍♀️! 42 | _These are opinionated but popular choices. The goal is to avoid [paradox of choice](https://en.wikipedia.org/wiki/The_Paradox_of_Choice) while learning._ 43 | 44 | * [anyhow](https://docs.rs/anyhow/latest/anyhow/) for error handling 45 | * [clap](https://docs.rs/clap/latest/clap/) for CLI building 46 | * [serde](https://serde.rs/) for serialization, including [serde_json](https://github.com/serde-rs/json) and [serde_yaml](https://github.com/dtolnay/serde-yaml) 47 | * [dialoguer](https://docs.rs/dialoguer/latest/dialoguer/) for CLI prompts and [console](https://crates.io/crates/console) for ANSI colors and handling 48 | * [env_logger](https://docs.rs/env_logger/latest/env_logger/) for logging and [log](https://docs.rs/log/latest/log/) for facade 49 | * [lazy_static](https://docs.rs/lazy_static/latest/lazy_static/) for declaring static variables that have nontrivial initialization 50 | * [rayon](https://github.com/rayon-rs/rayon) for easy concurrency for data, vectors, arrays based workloads 51 | * [reqwest](https://docs.rs/reqwest/latest/reqwest/) and [reqwest-middleware](https://crates.io/crates/reqwest-middleware) for HTTP calls 52 | * [actix-web](https://docs.rs/actix-web/latest/actix_web/) as a web/API server 53 | * [nom](https://crates.io/crates/nom) (parser combinators) or [pest](https://pest.rs/) (peg) for building custom parsers 54 | * [insta](https://crates.io/crates/insta), [wiremock](https://crates.io/crates/wiremock), and [fake](https://crates.io/crates/fake) for testing 55 | * [tap](https://crates.io/crates/tap) for utility 56 | 57 | ## :ok_hand: Thinking in Rust 58 | _Hand picked material to give you context, reasons, and history of how Rust evolved. Some of it is historical._ 59 | 60 | * [Rust Programming Techniques (youtube)](https://www.youtube.com/watch?v=vqavdUGKeb4) - a talk from 2018 which is more about "thinking in Rust", and will encourage using more Rust constructs. 61 | * [@jonhoo on Rust Trivia](https://github.com/rusty-ferris-club/jonhoo-rust-trivia) ([twitter: @jonhoo](https://twitter.com/jonhoo)) 62 | * [@jonhoo on Rust Keywords](https://github.com/rusty-ferris-club/jonhoo-rust-trivia/blob/main/keywords.md) ([twitter: @jonhoo](https://twitter.com/jonhoo)) 63 | * [Getting Started with Rust: Understanding Rust Compile Errors](https://www.youtube.com/watch?v=hgZQJys2zpY), and [part 2](https://www.youtube.com/watch?v=9391GxkYPyY) - A live session with Ryan Levick exploring and understanding compiler errors and the borrow checker 64 | 65 | ## 🥇 Gold Nuggets 66 | _Great articles, blogs, videos of specific topics in Rust, that are must-read or must-watch_ 67 | * [Error handling isn't all about errors](https://www.youtube.com/watch?v=rAF8mLI0naQ) - a talk from RustConf 2020, which gives a fantastic overview, breakdown and ultimate tips to error handling and error libraries in Rust 68 | 69 | ## 💡 Project ideas 70 | _These are easy starter project ideas, not full-blown projects, just to get you up and running._ 71 | 72 | * `cat`, `grep`, `uniq`, `wc`, `find` + more. [in this repo](https://github.com/kyclark/command-line-rust) from the _Command line Rust_ book. -- `Practice` CLI, stdlib, data. `Difficulty` easy. 73 | * [A beefed up calculator](https://crates.io/crates/eva) -- `Practice` CLI, parsing, data. `Difficulty` easy. 74 | * [SMTP Protocol in Go - but implement in Rust](https://notes.eatonphil.com/handling-email-from-gmail-smtp-protocol-basics.html) and build a simple TCP server from scratch -- `Practice` CLI, parsing, services. `Difficulty` easy 75 | * [CloudFormation parser](https://rtoch.com/posts/advanced-serde/). -- `Practice` CLI, serde, errors, data. `Difficulty` medium. 76 | * [Realworld](https://github.com/gothinkster/realworld) implementation in Rust. See [realworld-axum-sqlx](https://github.com/launchbadge/realworld-axum-sqlx). -- `Practice` Web, services, SQL, data. `Difficulty` medium. 77 | * [QR code generator](https://github.com/madprops/qool) -- `Practice` CLI, modules, data. `Difficulty` medium. 78 | * [Redis protocol parser (RESP)](https://redis.io/docs/reference/protocol-spec/) -- `Practice` parsing, TDD, creating Rust libraries, data. `Difficulty` medium. 79 | * [Add a lint to Clippy](https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md). 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. 80 | * [JSON log viewer, CLI](https://github.com/gistia/json-log-viewer) -- `Practice` CLI, TUI, modules, data, parsing. `Difficulty` hard. 81 | 82 | ## 🤘 Looking to work with other people 83 | _Find other people that are passionate and looking to build stuff in Rust for fun._ 84 | * [Rusty Ferris Club](https://github.com/rusty-ferris-club) builds tiny Rust based open source projects, and you can add your [ideas or requests](https://github.com/rusty-ferris-club/build-it-for-me-please) 85 | 86 | ## 🤾‍♂️ Hold on! I want to just play around before deciding to start 87 | 88 | _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_ 89 | 90 | * Try the [tour of rust](https://tourofrust.com/index.html) 91 | * [A gentle intro to Rust](https://stevedonovan.github.io/rust-gentle-intro/readme.html) 92 | * [Take your first steps with Rust](https://docs.microsoft.com/en-us/learn/paths/rust-first-steps/) 93 | 94 | 95 | ## 💻 Cool stuff to have open in a tab while working 96 | _If you have multiple screens, and like a full immersive learning experience - you can keep these open at all times_ 97 | 98 | * [A big cheatsheet](https://www.cheats.rs/) or [a smaller cheatsheet](https://upsuper.github.io/rust-cheatsheet/) 99 | * A fun [syntax explorer explainer](https://jrvidal.github.io/explaine.rs/) 100 | * [awesome-rust](https://github.com/rust-unofficial/awesome-rust) and [are we there yet](https://wiki.mozilla.org/Areweyet) for when you're reaching out for a library or need inspiration 101 | 102 | ## 🚀 Releasing 103 | 104 | - [a CI/CD template for your project and crates](https://github.com/SpectralOps/rust-ci-release-template) to start with 105 | - [Documenting your crate](https://blog.guillaume-gomez.fr/articles/2020-03-12+Guide+on+how+to+write+documentation+for+a+Rust+crate) 106 | 107 | 108 | # Mental Bridges 109 | _These links will help bridge the mental model when you're coming from Node.js_ 110 | 111 | ## I'm a Node.js Developer 112 | 113 | 1. Add [Rust for node developers](https://github.com/Mercateo/rust-for-node-developers) to your schedule, which is a soft intro just to get your bearings. 114 | 115 | ## I'm a Python developer 116 | 1. Check out [From Python into Rust](https://github.com/rochacbruno/py2rs) 117 | 118 | # Contributing 119 | 120 | Please feel free to submit PRs to improve this list. A few pointers: 121 | 122 | 1. The list must be concise 123 | 2. 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?") 124 | 125 | Happy hacking! 126 | --------------------------------------------------------------------------------