Estimated time: 4 days
❗️ To meet the first deadline, please open a Pull Request by Sunday of the first week and include answers to at least one question in it.
Read through Rust Book, Rust FAQ, and become familiar with basic Rust concepts, syntax, memory model, type and module systems.
Polish your familiarity by completing Rust By Example and rustlings.
Read through Cargo Book and become familiar with Cargo and its workspaces.
After completing these steps, you should be able to answer (and understand why) the following questions:
- What memory model Rust has? Is it single-threaded or multi-threaded? Is it synchronous or asynchronous? What are the memory layouts of
Box
andVector
? What are a heap and a stack? Where, but on heap and stack data could live in RAM? - What runtime Rust has? Does it use a GC (garbage collector)?
- What is special about slice? What is the layout of Rust standard data types? Difference between fat and thin pointers?
- Why does Rust have
&str
andString
types? How do they differ? When should you use them? Why str slice coexists with slice? What is the difference betweenString
andVec
? - What static typing means? What are the benefits of using it? Weak vs strong typing? Implicit vs explicit typing?
- What are generics and parametric polymorphism? Which problems do they solve?
- What are nominative typing and structural typing? What is the difference?
- What are traits? How are they used? How do they compare to interfaces? What are auto trait and blanket impl? Uncovered type? What are marker traits?
- What are static and dynamic dispatches? Which should you use, and when? What is monomorphization?
- What are a crate, a module, and a package in Rust? How do they differ? How are they used? What is a workspace?
- What is cloning? What is copying? How do they compare? What is trait Drop for? What is special about this trait?
- What is immutability? What is the benefit of using it? What is the difference between immutability and const?
- What are move semantics? What are borrowing rules? What is the benefit of using them?
- What is RAII? How is it implemented in Rust? What is the benefit of using it?
- What are lifetimes? Which problems do they solve? Which benefits do they provide?
- What is an iterator? What is a collection? How do they differ? How are they used?
- What are macros? Which problems do they solve? What is the difference between declarative and procedural macro?
- How code is tested in Rust? Where should you put tests and why?
- Is Rust an OOP language? Is it possible to use SOLID/GRASP? Does it have inheritance? Is Rust a functional language? What variance rules does Rust have?
After you are done, notify your lead in an appropriate PR (pull request), and they will examine what you have learned.
Additional articles, which may help to understand the above topic better:
- Chris Morgan: Rust ownership, the hard way
- Adolfo Ochagavía: You are holding it wrong
- Vikram Fugro: Beyond Pointers: How Rust outshines C++ with its Borrow Checker
- HashRust: A guide to closures in Rust
- Ludwig Stecher: Rusts Module System Explained
- Tristan Hume: Models of Generics and Metaprogramming: Go, Rust, Swift, D and More
- Jeff Anderson: Generics Demystified Part 1
- Jeff Anderson: Generics Demystified Part 2
- Bradford Hovinen: Demystifying trait generics in Rust
- Brandon Smith: Three Kinds of Polymorphism in Rust
- Jeremy Steward: C++ & Rust: Generics and Specialization
- cooscoos: &stress about &Strings
- Jimmy Hartzell: RAII: Compile-Time Memory Management in C++ and Rust
- Trait Drop
- Common Lifetime Misconception
- Visualizing Memory Layout
- Package vs. Crate terminology (r/rust)
- Packages and crates (Rust wiki)
- Full list of available crates on Rust Playground
- Blanket impl definition
- Auto-trait definition
- Georgios Antonopoulos: Rust vs Common C++ Bugs
- Yurii Shymon: True Observer Pattern with Unsubscribe mechanism using Rust
Additional: