Rust & WebAssembly with JS (TS) - The Practical Guide
Learn to code in Rust. Compile the code to WebAssembly. Prepare JS/TS frontend and create browser-based Snake game.
What is Rust?
Rust is a programing language. Rust is blazingly fast and memory-efficient: with no runtime or garbage collector, it can power performance-critical services, run on embedded devices, and easily integrate with other languages.
What is WebAssembly?
WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C#, and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.
Is this course right for you?
If you plan to start your career as a developer or improve your programming skills, this course is right for you. Learn how to build a browser game with minimal JS and Rust code compiled into webAssembly instructions.
You will get the confidence and skills required to start your projects during this course. In addition, you will get the right mindset to apply for a developer career.
What are you going to work on?
You will build the Snake game from scratch. You will learn to write code in Rust language, static type, compiled language.
The course starts with an explanation and practical examples of the Rust language. You will learn Rust-specific features such as "moving" and "copying."
Rust doesn't have a garbage collector. Memory is cleared when the values are getting out of the scope. You will learn how to manage this concept with ease.
The next feature you will learn of is borrowing and references. Through references, you will be able to access values without owning them.
In the beginning lectures, we will also talk about memory management in Stack and the Heap structures, modularity, strings, and other essential topics.
After Rust's introduction lectures, you will start building your Snake game. You will learn how to structure the application modular and cleanly.
You will build your own JS frontend, exposed through a simple Webpack development server. Later, you will transform JS implementation into TS (Typescript). This will specify types and be on the same page as Rust code.
Then, you will build your rust backend code, the backbone of our game. You will learn how to compile Rust code into WebAssembly code. WebAssembly is code that can run in the browser. It's faster (almost Native speed) and more efficient than JS.
At the end of the course, we will create a production server, and deploy our game to Heroku, so anybody on the internet can play our game.
Basic programming knowledge
Rust installation
Rust Versions
Main Func
Mut Variables
Cargo Init
New function
Primitive types
[AI] Prim Numbers 2
Primitive Types 3
AI Stack
AI More Stack
String Heap
String Move
AI Moves additional explanation
Return moved value
Copying age
References
Mutable borrow
AI Mutable Borrow Example
Dereference
AI Dereferencing
String vs &str
String slice
String Slice +
Clone
Box type
Struct
Struct functions, methods
Constructors
Enums
Enum values
Enum match
If Let
Struct no fields
Trait
Trait narrowing
Modularity
Import options
Mod keyword
Nested modules
Pub fields
Super keyword
External lib
Display Trait
WebAssembly start + Link
More wasm
Load Wasm in Browser
Dev Server
[AI] webpack dev server
Copy plugin
Fetch wasm
Import to wasm
Wasm Memory
JS Memory
Pack Webassembly
Init Our Code
[AI] pkg files
Import FN to webassembly
Bootstrap
Wee alloc
World struct
Getter width
Get canvas
DrawWorld
Create snake
Draw Snake
[AI] Debugger
World Update
Set Timeout
Typescript
Snake random idx
Direction
Move in one row
Up and Down
Function refactor
Keydown events
Change snake dir
Snake Cells
Cell Ptr
Invalid pointer
Render all cells
Snake color
Refactor directions
Direction profiling
Move cells
Change snake dir check
Improve snake dir
Reward cell
Import Date to Rust
Random function
Check if body contains reward
Consume reward cell
AI Reward cell
Fn to gen reward
Reward cell generate fix
Game Status
Simple UI
Start the game
Handle game status
Draw game status
Win Case
Lost Case
Mapping function
Some reward cell
Add points
Handle play loop
Prod Server
CLI Installations
Package commands
Deployment, Last Lecture
Filip Jerga
Every video contains a discussion where you can create a post describing an issue. The instructor usually responds within 1 business day.
Within 30 days of the purchase, you can ask for a full refund. No questions asked. Your happiness is our priority.
Of course not! Every lecture is committed (explained in the introduction section). You can start watching at any lecture. Just download the correct version of the project attached to lecture resources.
Single Course Access
$29.00
Access to this course only.
Get started nowMonthly Membership
$19.00 / month
Cancel Anytime!
Get started nowAnnual Membership
$190.00 / year
Cancel Anytime!
Get started now