Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uncomputable/rust-wasm-ffi

Minimal website that exposes C functions via WASM
https://github.com/uncomputable/rust-wasm-ffi

c ffi javascript rust rust-wasm tutorial wasm

Last synced: about 1 month ago
JSON representation

Minimal website that exposes C functions via WASM

Awesome Lists containing this project

README

        

# Rust, WASM and C FFI

Deploy a minimal website that exposes C functions via WASM.

Makes use of [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen).

Targets wasm32-unknown-unknown.

## Enter the development environment

Enter the nix-shell. Yes, it includes a web browser.

```
nix-shell
```

## Build the website

Deploy the website locally and visit it in the browser.

```
just serve
just visit
```

Don't forget to kill the web server daemon when you finish.

```
just kill
```

## Run the unit tests

Run the unit tests in a headless web browser.

```
wasm-pack test --headless --firefox
```