Comments (4)
@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: ∅
- 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
- Problems Rust aims to solve
- 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
- 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
andloop
expressionsreturn
- Scope
- Dropping is destructing
static
- String
- UTF-8
- Heap-allocated
- Dealloc on drop
- 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
- References
- Composite types
- Structs
- Tuple strict
- Struct with named fields
- Empty struct
- Enums
- Tuple variants
- Struct-like variants
- Memory layout
- Structs
- Pattern matching
if let
match
- Exhaustiveness
- Arm priority
- Guards and bindings
while let
let else
- Irrefutable patterns
- Destructuring
- Tuples
- Arrays
- Structs
impl
blocks- Associated functions vs methods
self
vs&self
vs&mut self
.
-operatorSelf
- Handling optionals or errors
- Generic intro
Option
panic
Result
unwrap
?
-operator
- Slices
- Sized vs unsized
[T]
vs&[T]
- Memory layout
&str
- Traits
- Trait methods
- Associated types
- Associated constants
- Generic programming
- Type parameters
- Type parameter bounds
<T: Trait>
vswhere T: Trait
- Generic traits
- Vs associated types
impl Trait
- Monomorphization
- Lifetime annotations
- Within
fn
signatures - Within type definitions
- Lifetime elision
- The
'static
lifetime
- Within
- Closures
move
fn
vsFn
vsFnMut
vsFnOnce
- Smart pointers
Box
Vec
Rc
Drop
Deref
&DerefMut
Deref
coercion
B. Application programming
Develop larger projects with Rust
Dependencies: A
- API Guidelines
- Design patterns
- Testing
- Unit testing
- Integration testing
- Benchmarking
- Fuzzing
- Tools
- Licence checking
- Audit
C. Concurrency
Learn Rusts concurrency models
Dependencies: A
- Parallelization
- Spawning threads
- Threads & lifetimes
- Scoped threads
- Re-defining references
- Send&Sync
mpsc::channel
rayon
- Spawning threads
- Syncronization
Atomic*
std::sync::atomic::Ordering
Mutex
async
Rust- Comparison to threads
- Comparison to other languages
Future
async
andawait
- Runtimes
- Variations
smol
tokio
embassy
async-std
- Compatibility
- Intro to
tokio
- Variations
spawning
tasks- Borrowing over
await
s futures
crateStream
channel
Mutex
D. Rust for web
Learn to use Rust for web applications
Dependencies: A, B, C.1, C.3
std::net
- Backend development with
axum
- Database interop with
sqlx
wasm
frontends- Using
serde
E. Rust for systems programming
Learn to use Rust for systems programming
Dependencies: A, C.1, C.2, C.3
- Unsafe Rust
- FFI
- Rust ABI and memory layout
- Unix syscalls
async
primitivesmio
- Rust in the Linux kernel
F. Rust for embedded (Cortex-M)
Dependencies: A, C3
#![no_std]
andcore
#![no_main]
cortex-m-rt
- Rust embedded ecosystem
cortex-m
- PACs
- HALs
embedded-hal
- Drivers
- Portable drivers
- RTIC
embassy
- Rust in IoT
G. Rust for data science
Dependencies: A, C1
- PyO3
- Polars
- 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.
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.
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.
Another thought: we can add content on macros to B
from teach-rs.
Related Issues (20)
- Add content on macros
- Add content on quality tools
- Add content on Memory Ordering
- Add content on crate `futures`
- Add content introducing multithreading
- Add content on NodeJS interoperability HOT 1
- Add content on `sqlx`
- Add content on WASM
- 101-rs/slides /A3-traits-generics.md : ` impl std::ops::Add ` (2) : typo ? HOT 1
- 101-rs/slides / D-trait-objects-patterns.md : Typestate: example : typo ? HOT 1
- Cannot create a Vec literal (compile error in slices/slides.md example) HOT 1
- Swap out slidev for some rust-based tool HOT 2
- FizzBuzz exercise is missing (empty file) HOT 1
- Some exercises are very long HOT 3
- Improve modmod
- modmod: Support images in exercise descriptions HOT 1
- Move teach-rs to the Trifecta Tech Foundation
- Website / book links are broken HOT 2
- Exercise 2.4.1.J Deref and DerefMut not working as said
- Exercise 2.4.1.I Generic Index 's LocalStorageVecIndex seems unnecessary?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teach-rs.