Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define different learning tracks #55

Closed
hdoordt opened this issue Jun 19, 2023 · 4 comments
Closed

Define different learning tracks #55

hdoordt opened this issue Jun 19, 2023 · 4 comments
Assignees

Comments

@hdoordt
Copy link
Member

hdoordt commented Jun 19, 2023

Rust 101 is meant to be multi purpose. Therefore, we define a set of different learning tracks consisting of several modules of which we define modules and subjects their content is dependent on.

As a start, we can define the following tracks:

  • Systems programming
  • Embedded development
  • Web development

We also explore the possiblity of setting up a track that uses Rust as a first programming language. See #25

@hdoordt
Copy link
Member Author

hdoordt commented Jun 19, 2023

@squell I took the liberty to draft a proposal for a new structure. The main idea is that we define a basic module (A), and some modules that are optional depending on the track that is being taken. I've listed the modules with their topics and the tracks below. Especially the modules further down are not as detailed as I'd like them to be yet, but you'll get the idea. Also, we need to split up the modules into parts that are suitable for single lecture+tutorial sessions. Feel free to add your thoughts on this.

Also, I'd like to think about how we can incorporate the work of @coastalwhite into this (#25).


Modules

A. Intro to Rust

Get to learn the language

Dependencies: ∅

  1. Why Rust
    • Problems Rust aims to solve
      • Memory safety
      • Concurrency bugs
    • Brief history
    • Design goals
      • Memory safety
    • The space Rust is in
    • What you can use Rust for
  2. Your first Rust project
    • Short intro to Cargo
    • Setting up a new project
    • app vs lib crates
    • Cargo.toml overview
    • Crates.io/lib.rs/docs.rs
  3. Basic syntax
    • Main entrypoint
    • Variables
      • Mutability
      • Type annotations
      • Type inference
    • Primitive types
    • Numeric & boolean perators
    • Tuples
    • Arrays
    • Functions
    • Statements
    • Expressions
    • Flow control
      • if else
      • for in
      • while
      • loop
      • break and loop expressions
      • return
    • Scope
      • Dropping is destructing
      • static
    • String
      • UTF-8
      • Heap-allocated
      • Dealloc on drop
  4. Ownership & references
    • Variable ownership
    • Move semantics
      • Copy types (primitives)
      • Non-copy types (heap-allocated types)
    • Borrowing
      • References
        • Immutable vs mutable
      • Borrowing rules
      • Memory safety implications
  5. Composite types
    • Structs
      • Tuple strict
      • Struct with named fields
      • Empty struct
    • Enums
      • Tuple variants
      • Struct-like variants
      • Memory layout
  6. Pattern matching
    • if let
    • match
      • Exhaustiveness
      • Arm priority
      • Guards and bindings
    • while let
    • let else
    • Irrefutable patterns
    • Destructuring
      • Tuples
      • Arrays
      • Structs
  7. impl blocks
    • Associated functions vs methods
    • self vs &self vs &mut self
    • .-operator
    • Self
  8. Handling optionals or errors
    • Generic intro
    • Option
    • panic
    • Result
    • unwrap
    • ?-operator
  9. Slices
    • Sized vs unsized
    • [T] vs &[T]
    • Memory layout
    • &str
  10. Traits
    • Trait methods
    • Associated types
    • Associated constants
  11. Generic programming
    • Type parameters
    • Type parameter bounds
      • <T: Trait> vs where T: Trait
    • Generic traits
      • Vs associated types
    • impl Trait
    • Monomorphization
  12. Lifetime annotations
    • Within fn signatures
    • Within type definitions
    • Lifetime elision
    • The 'static lifetime
  13. Closures
    • move
    • fn vs Fn vs FnMut vs FnOnce
  14. Smart pointers
    • Box
    • Vec
    • Rc
    • Drop
    • Deref & DerefMut
    • Deref coercion

B. Application programming

Develop larger projects with Rust

Dependencies: A

  1. API Guidelines
  2. Design patterns
  3. Testing
    • Unit testing
    • Integration testing
    • Benchmarking
    • Fuzzing
  4. Tools
    • Licence checking
    • Audit

C. Concurrency

Learn Rusts concurrency models

Dependencies: A

  1. Parallelization
    • Spawning threads
      • Threads & lifetimes
      • Scoped threads
    • Re-defining references
    • Send&Sync
    • mpsc::channel
    • rayon
  2. Syncronization
    • Atomic*
    • std::sync::atomic::Ordering
    • Mutex
  3. async Rust
    • Comparison to threads
    • Comparison to other languages
    • Future
    • async and await
    • Runtimes
      • Variations
        • smol
        • tokio
        • embassy
        • async-std
      • Compatibility
      • Intro to tokio
    • spawning tasks
    • Borrowing over awaits
    • futures crate
      • Stream
      • channel
      • Mutex

D. Rust for web

Learn to use Rust for web applications

Dependencies: A, B, C.1, C.3

  1. std::net
  2. Backend development with axum
  3. Database interop with sqlx
  4. wasm frontends
  5. Using serde

E. Rust for systems programming

Learn to use Rust for systems programming
Dependencies: A, C.1, C.2, C.3

  1. Unsafe Rust
  2. FFI
  3. Rust ABI and memory layout
  4. Unix syscalls
  5. async primitives
    • mio
  6. Rust in the Linux kernel

F. Rust for embedded (Cortex-M)

Dependencies: A, C3

  1. #![no_std] and core
  2. #![no_main]
    • cortex-m-rt
  3. Rust embedded ecosystem
    • cortex-m
    • PACs
    • HALs
    • embedded-hal
    • Drivers
  4. Portable drivers
  5. RTIC
  6. embassy
  7. Rust in IoT

G. Rust for data science

Dependencies: A, C1

  1. PyO3
  2. Polars
  3. ndarray

Tracks

  • Rust language introduction (A, B)
  • Rust for web (A, B, C.1, C.3, D)
  • Rust for systems programming (A, C, E)
  • Rust for embedded (A, C3, F)
  • Rust for data science (A, C1, G)

@squell
Copy link
Member

squell commented Jun 22, 2023

First thoughts about Rust-as-a-first language (which I had thought about last week as well):

  • Pro: Rust-as-a-first language sounds like it could simply supplant some of the A-material with more expanded stuff; so in the future the current A module could be the "short track".
  • Con: "Mathematical maturity" needs to be taken into account. Appreciating programming takes some development time (like driving a car, riding a bike, learning a new natural language) I think that thinking in a logical, structured way within a mechanized framework (i.e., programming) is a skill our human brain picks up slowly. The upshot of that is that you simply can't start with a A-for-beginners and then in a few weeks jump to writing a mutex using unsafe code, say.

I.e. I think it's a worthwhile thing but maybe something that needs something separate (Programming-101 using Rust), and then finish it off with lots of ideas and suggestions for students "good first Rust projects", and tell them they continue their journey with the B-modue later.

@hdoordt
Copy link
Member Author

hdoordt commented Jun 22, 2023

Notes:

A: add topic on trait objects
C: add part on intro to multithreading as the concept may be overwhelming to students that have never written parallel code before
E: possibly refer to B1, maybe add part on multiprocessing (fork)
F: Add embedded-specific topics on synchronization, atomics, mutexes, possibly on RTOS integration

In teacher's guide #54 , we can suggest pick'n'mixing modules
Add more advanced topics to leaf modules
Possibly add topic on Pin to systems or async or even A

@hdoordt hdoordt mentioned this issue Jun 29, 2023
11 tasks
@hdoordt
Copy link
Member Author

hdoordt commented Jun 29, 2023

Another thought: we can add content on macros to B

@hdoordt hdoordt closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants