google / google/comprehensive-rust

WebAssembly class

Open
#1,012 3 comments 0 reactions 1 assignee Claimed by @sakex View on GitHub
enhancement
Dominant language
Rust
Stars
33.4k
Forks
2.1k
Avg merge
1d 3h
Merged PRs (30d)
10

Description

# Objective
Add a chapter to cover WebAssembly in Comprehensive Rust 🦀.

# Design Goals
WASM can be thought of both as a compilation target and a platform. Therefore, we want to add a simple entry into “Interoperability > With the web” and a more exhaustive “WebAssembly” class. WASM’s main appeal is the development of applications for the web, so we’ll want to have a setup with a web page that can load the student’s WASM code. Exercises should be visual.

# Requirements
- [x] A template to run wasm [commit](https://github.com/google/comprehensive-rust/commit/964a0d62158fac01ff9688e9128cd6f834ad06c6)
- [ ] Create a new entry Interoperability: `With the Web`
It should reference the new course for an in-depth dive

Create a new class with the following chapters:
- [x] WebAssembly intro [commit](https://github.com/google/comprehensive-rust/commit/b989324e95634ef290d6f7121c46c09be4c51765)
- [x] Installation (wasm-pack) [commit, for now in webassembly.md](https://github.com/google/comprehensive-rust/commit/b989324e95634ef290d6f7121c46c09be4c51765)
- [x] Expose a method with wasm-bindgen [commit](https://github.com/google/comprehensive-rust/commit/7d209454b105bfac3219e94a7c0d88e3389a6a46)
- [x] Error handling [commit](https://github.com/google/comprehensive-rust/commit/4f8bc9061fde033ddc09c410d6159cc0a45668a8)
- [x] Compile and Load wasm module in Javascript, call the method from previous point [commit](https://github.com/google/comprehensive-rust/commit/b0ce243f86b41424e6e14963ea9976e882354c6a)
- [x] Pass user-defined types from Rust to JS [commit](https://github.com/google/comprehensive-rust/commit/fdf83866cb3e3f879b02a3a389c7483033b5f68c)
- [x] js_sys [commit](https://github.com/google/comprehensive-rust/commit/7d411b72377a4a4a9bc168b1cdb0b3261464ea72)
- [x] Limitations and workarounds
- [x] Prevent garbage collection [commit](https://github.com/google/comprehensive-rust/commit/bee0f950e280ac77a25839ba64d07a00ce51599b)
- [x] Threading
- [x] Random
- [x] Time
- [x] Closures
- [x] Pass user-defined types from JS to Rust [commit](https://github.com/google/comprehensive-rust/commit/13af2243ecfc4261e19c6b1224e3e5e4205896fa)
- [x] Async [commit](https://github.com/google/comprehensive-rust/commit/f7d791fac7bfc9f9a4fce43c05137e960cd015d6)
- [ ] Exercises (TBD)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.