Skip to content

markandrus/rust-c-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-c-js

Here is a little toy project showing how to compile Rust code that can be called from C or JavaScript (via WebAssembly). To set this project up, I used

Installation

Requirements

  • Cargo
  • cbindgen
  • gcc
  • make
  • Node.js (8 or newer)
  • Rust Nightly
  • wasm-bindgen
  • wasm-gc
  • wasm-opt

Usage

Run make all to build and run both the C and JavaScript test applications. You should see each print

Hello, World! Bye!

Release Mode

You can build in release mode with make release. This passes --release to Cargo, transforms the generated WebAssembly with wasm-gc and wasm-opt, and minifies the generated JavaScript.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published