Skip to content

🔩🔌📬 An example of Rust compiling to WASM and passing Cap'n Proto messages to JavaScript.

License

Notifications You must be signed in to change notification settings

couchand/rust-wasm-capnproto-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-wasm-capnproto-example

This is a little demonstration of Rust compiling to WASM, and using Cap'n Proto messages as a high-bandwidth communication channel between the Rust/WASM code and JavaScript code.

uses

build dependencies

runtime dependencies

  • Your browser of choice supporting JavaScript and WASM

getting started

# 1. Install the Rust nightly.
rustup toolchain install nightly

# 2. Install & setup cargo-wasm.
cargo install cargo-wasm
cargo wasm setup

# 3. Clone the repository.
git clone [email protected]:couchand/rust-wasm-capnproto-example.git
cd rust-wasm-capnproto-example

# 4. Install JavaScript dependencies.
yarn

# 5. Build the project.
make

# 6. Pull it up in your browser.
yarn start

more information

Read the code & build config, there's only like 200 lines of code.

caveat

I'm new to Rust, so the code's not great. Please submit a PR!

╭╮☲☲☲╭╮

About

🔩🔌📬 An example of Rust compiling to WASM and passing Cap'n Proto messages to JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published