Git Product home page Git Product logo

Comments (4)

hdoordt avatar hdoordt commented on July 28, 2024

@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)

from teach-rs.

squell avatar squell commented on July 28, 2024

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.

from teach-rs.

hdoordt avatar hdoordt commented on July 28, 2024

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

from teach-rs.

hdoordt avatar hdoordt commented on July 28, 2024

Another thought: we can add content on macros to B

from teach-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.