Outline updated November 2026
Rust for JavaScript and TypeScript Programmers
Class Duration
35 hours of live training delivered over 5-10 days to accommodate your scheduling needs.
Student Prerequisites
- Strong working proficiency in JavaScript or TypeScript
- Comfort with Node.js, npm/pnpm, and modern bundlers
- Familiarity with TypeScript's structural type system is helpful
- No prior Rust experience required
Target Audience
JavaScript and TypeScript engineers adding Rust for fast Node services, WebAssembly modules, CLIs, or full-stack web apps. It fits full-stack teams that want one language in the browser and on the server. Teams continuing on can move to Memory-Safe Programming with Rust and then Rust Parallel Programming. For the web stack, see Web APIs with Rust and Actix-web and Full-Stack Web Apps with Rust and Leptos.
Description
This course teaches production Rust to experienced JavaScript and TypeScript developers. Each concept is taught against its JS or TS equivalent, such as ownership against garbage collection and enums against discriminated unions. Students compare lazy Tokio futures with eager Promises, and sized numeric types with number. The course also covers where Rust already runs in the JavaScript world: build tools, native Node.js addons, and WebAssembly. It ends with a REST API on Actix-web and a Leptos front end, built with help from AI coding assistants.
Learning Outcomes
- Write idiomatic Rust using ownership, borrowing, and lifetimes.
- Map common JavaScript and TypeScript idioms to Rust.
- Build CLIs, library crates, and async services on Tokio.
- Use traits and generics where TypeScript uses interfaces.
- Query PostgreSQL from Rust with
sqlx. - Build a REST API on Actix-web.
- Build a client-side WebAssembly app with Leptos.
- Call Rust from JavaScript through WebAssembly or napi-rs.
- Check AI-generated Rust with the compiler, clippy, and tests.
Training Materials
All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples.
Software Requirements
A free GitHub account, the current stable Rust toolchain via rustup (2024 edition), with examples on Actix-web 4 and Leptos 0.8, Node.js 22+, Visual Studio Code or another supported editor with the rust-analyzer extension, Docker for the local PostgreSQL instance used in the database module, and an AI coding assistant of choice (GitHub Copilot, Cursor, or Claude Code). A cloud-based environment can be provided if local installation is restricted.
Training Topics
Introduction: Rust from a JS/TS Perspective
- Where Rust fits next to JS and TS
- What the current edition changed
- Rust vs. JavaScript at a glance
- Nominal vs. structural typing
- The Rust ecosystem
Toolchain and Editor Setup
- Installing Rust with
rustup cargovs. npm, pnpm, and yarn- rust-analyzer in VS Code, RustRover, and Zed
- AI assistants for Rust
- The Rust Playground
Cargo and Crates
cargo new,cargo run,cargo build,cargo testCargo.tomlvs.package.json- Workspaces and
cargo publish --workspace - Popular crates such as
serdeandtokio
Rust vs. JS/TS: A Working Map
- Static vs. dynamic typing
- Runtime types vs. erased TypeScript types
- Ownership vs. garbage collection
Option<T>vs.nullandundefinedResultvs. thrown errors and rejected Promises- Sized integers vs.
numberandbigint - UTF-8 vs. UTF-16 strings
- Immutable bindings vs.
const - Iterators vs. generators
- Enums vs. discriminated unions
- Traits vs. interfaces and duck typing
- Monomorphized vs. erased generics
- Multi-threaded futures vs. the event loop
Scalar Types, Control Flow, and Functions
- Integers, floats, booleans, and characters
- Constants, statics, and
const fn if/elseas expressionsloop,while, andforletchains inifandwhile- Closures and capture modes
Modules and Built-In Macros
modanduse- Importing from crates.io
- Visibility and re-exports
- Common built-in macros
Memory Management and Ownership
- Ownership, moves, and copies
- Borrowing with
&Tand&mut T - Lifetimes and the borrow checker
Box,Rc, andArc- JS closure capture vs.
move - Callbacks that outlive their data
- Cloning to silence the borrow checker
Strings, Tuples, Enums, Structs, Collections
Stringvs.&str- Tuples and tuple structs
- Enums with data
Option<T>andResult<T, E>- Compiler-owned tags vs. hand-written tags
- Structs, methods, and constructors
- Collections vs. arrays,
Map, andSet - Lazy iterators vs. eager array methods
serdevs.JSON.parseand Zod
Pattern Matching
matchvs. TypeScript narrowing- Exhaustiveness vs.
neverchecks if let,while let, andletchains- Destructuring nested data
- Guards, bindings, and
@patterns
Traits and Generics
- Defining and implementing traits
- Default methods and
dyn Trait - Bounds and
whereclauses - Static vs. dynamic dispatch
- Async fn in traits
Async/Await with Tokio
- Async/await from a Promise perspective
- Lazy futures vs. eager Promises
- Multi-threaded scheduling and
Sendbounds - Async closures
tokio::select!vs.Promise.raceJoinSetvs.Promise.all- Cancellation vs.
AbortController - HTTP with
reqwestandserde
Concurrent Programming
- Threads, async tasks, and Node.js workers
Send,Sync, and data racesArc,Mutex,RwLock, and channels- Data parallelism with
rayon
Rust in the JavaScript Ecosystem
- Rust-based JavaScript build tools
- SWC, Rspack, Rolldown, Oxc, and Biome
- Native Node.js addons with napi-rs
- WebAssembly modules with
wasm-bindgen - Sharing types with TypeScript
- Addon vs. WebAssembly vs. service
Database Programming with sqlx
- Connecting to PostgreSQL
- Compile-time-checked queries
- Inserts, updates, and transactions
- Database error handling
Web APIs with Actix-web
- Actix-web vs. Express, Fastify, and NestJS
- Projects, routes, and handlers
- Extractors, JSON, and forms
- Logging and session middleware
- Error handling
- Connecting to the database
Client-Side Rust with Leptos
- WebAssembly today
- Fine-grained reactivity vs. virtual DOM
- Similarities with SolidJS signals
- Components, signals, and effects
- Server functions
- The islands router
- CSR, SSR, and hydration
- Calling the Actix-web API
AI-Assisted Rust Development for JS/TS Engineers
- AI tools for Rust work
- Prompts for ownership and trait design
- Catching AI mistakes with the compiler
- Reviewing AI-generated
unsafeandunwrap - Reflexive
Arc<Mutex<T>>in AI code - AI-assisted refactors and code review