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.

4.47 (136 reviews)
Udemy
platform
English
language
Web Development
category
instructor
1,705
students
13.5 hours
content
Dec 2021
last update
$84.99
regular price

What you will learn

Create a browser game made in Rust/WebAssembly and Javascript

Understand Rust language in practical and fun way

Use gained knowledge to create your own applications

Establish yourself in the field of the exciting Rust development environment

Description

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.

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.

Screenshots

Rust & WebAssembly with JS (TS) - The Practical Guide - Screenshot_01Rust & WebAssembly with JS (TS) - The Practical Guide - Screenshot_02Rust & WebAssembly with JS (TS) - The Practical Guide - Screenshot_03Rust & WebAssembly with JS (TS) - The Practical Guide - Screenshot_04

Content

Introduction

Introduction
[Optional] How to resolve issues
[Optional] Lecture Structure

Rust Preparation

Rust Installation
Rust Versions
Main Func
Mut Variables
Cargo Init

Basics Types

New function
Primitive types
[AI] Prim Numbers 2
Primitive Types 3

Move & Copy

AI Stack
AI More Stack
String Heap
String Move
AI Moves additional explanation
Return moved value
Copying age

Reference & Borrowing

References
Mutable borrow
AI Mutable Borrow Example
Dereference
AI Dereferencing

Strings

String vs &str
String slice
String Slice +
Clone

Box & Struct

Box type
Struct
Struct functions, methods
Constructors

Enums

Enums
Enum values
Enum match
If Let
Struct no fields

Traits

Trait
Trait narrowing

Modularity

Modularity
Import options
Mod keyword
Nested modules
Pub fields
Super keyword
External lib
Display Trait

Into to WebAssembly

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

Preparing the Game

Pack Webassembly
Init Our Code
[AI] pkg files
Import FN to webassembly
Bootstrap
Wee alloc

Starting the Game

World struct
Getter width
Get canvas
Draw World
Create snake
Draw Snake
[AI] Debugger

Update the World

World Update
Set Timeout
Typescript
Snake random idx
Direction
Move in one row
Up and Down
Function refactor

Moving Snake

Keydown events
Change snake dir
Snake Cells
Cell Ptr
Invalid pointer
Render all cells
Snake color
Refactor directions
Direction profiling

Move Snake Cells

Move cells
Change snake dir check
Improve snake dir

Reward Cell

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

Game Status
Simple UI
Start the game
Handle game status
Draw game status

Game Outcomes

Win Case
Lost Case
Mapping function
Some reward
Add points
Handle play loop

Deployment

Prod server
CLI installation
Package commands
Deployment & Course Finish

Reviews

Rick
July 9, 2022
Great first course to get your feet wet into WebAssembly. Having git and Heroku deployment in the last section is a great bonus on top of the development and Rust primer sections.
Cameron
July 7, 2022
Filip did a great job covering Rust, WASM as well as JS/TS. I found the course very enjoyable and would look forward to additional Rust courses if Filip decides to create any :)
Jay
June 27, 2022
Have taken multiple Rust courses in the past, but this one I think has pushed my understanding of Rust to the next level. Filip answered every question that I posed quickly and well. It also gave me a better high-level understanding of WebAssembly and how to find out information on WebAssembly statements. I would say this is the most "down to earth" Rust programming course that I have seen so far. Thank you Filip! Well done! The only minor criticism I would say is that there are times when I felt that the lecture was assuming that I knew something that I didn't know. So ... don't be afraid to ask a question in the question area of the any lecture if that happens to you -- Filip will answer normally within 24 hours. This always helped me to understand whatever piece of knowledge I was missing. Maybe "traits" could be discussed in a little more depth in the introductory Rust sections -- explaining perhaps things like the Copy trait. I thought perhaps there was an assumption that you understood what the traits are and mean, and that isn't necessarily true.
Lee
June 4, 2022
I like his presentation style, and it was basically good. But for me, I was specifically interested in learning about Rust and WebAssembly. Most the lectures were actually more about working out the logic for the game. I think for more junior programmers this is good, and probably just what they need. But for my purposes, those parts were superfluous. Once I got the basics of Rust and Wasm, the rest was just skimming along. Still enjoyed it though.
Konstantin
May 19, 2022
Good course, much detail. All process steps are described. Understandable and also visually supported. Recommendation!
Katia
May 11, 2022
Great course! I had been learning Rust with other resources which were also very good, and Filip's explanations of the concepts allowed me to understand much better. Having this hands-on project was really helpful.
Rob
April 29, 2022
I've taken several courses from Filip. He's an awesome instructor and I feel like I learn a ton with his courses. Mind you, I'm already a professional software developer, but when I try learning a new technology, I first check if Filip has a course on that tech.
John
April 16, 2022
I really like the structure of the course it gives enough Rust, WebAssembly and TypeScript content that will spearhead your way into integrating Rust to the web using WebAssembly. I learned a lot from this Course, highly recommended. Filip explains the concept really good and even goes deep dive into some of the code.
Christopher
March 9, 2022
I enjoyed learning Rust through this course. The lessons are easy to follow and doesn't take much to start out the box. Definitely worth the investment!
Chris
March 2, 2022
Good refresher on Rust, good example project. I was hoping for prod tips to deploy on non-heroku deployments.
Grzegorz
February 11, 2022
This is the best course you have done. There is only one course on udemy: wasm + rast. I would like to see how you build something in rast + react, rast + nextjs or webworkers with rust. Thank you
Jonathan
February 4, 2022
This course is just great! The instructor did a really great job at explaining things clearly. Moreover having a working project at the end is really engaging! If we have questions or comments Filip is here to help, I really appreciate that, Thanks!!!
Obi
February 3, 2022
I just wish instead of drawing you had slides, maybe some nice animations. It would make things a little easier because Filips explanations are so good. Really great course, my experience with Rust was minimal but after completion I've walked away learning the basics.
Adam
January 16, 2022
Excellent course. Lots of small tricks and details when you get to writing the snake game. Teacher seems to have a good process which is going to help me.
Diaminity
January 4, 2022
I am glad I started with this course. It's my first experience with Rust. It explains lots of fundamental concepts I had no idea of before. As always with Filip, very practical approach to learning.

Charts

Price

Rust & WebAssembly with JS (TS) - The Practical Guide - Price chart

Rating

Rust & WebAssembly with JS (TS) - The Practical Guide - Ratings chart

Enrollment distribution

Rust & WebAssembly with JS (TS) - The Practical Guide - Distribution chart
4423122
udemy ID
11/30/2021
course created date
12/19/2021
course indexed date
Bot
course submited by