https://github.com/lambdaclass/cairo-rs-wasm
https://github.com/lambdaclass/cairo-rs-wasm
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/lambdaclass/cairo-rs-wasm
- Owner: lambdaclass
- License: mit
- Created: 2022-11-15T17:33:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-17T19:01:46.000Z (over 3 years ago)
- Last Synced: 2025-03-24T01:24:09.840Z (about 1 year ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Demo of `cairo-rs` on WebAssembly
While cairo-rs is compatible with WebAssembly, it doesn't implement any bindings
to it. Instead, create a new WebAssembly crate with cairo-rs as a dependency and
implement the required functionality there.
Since mimalloc is not automatically compilable to WebAssembly, the cairo-rs
dependency should disable the default features, which will in turn disable
mimalloc.
WebAssembly doesn't support filesystem access unless building with WASI support,
therefore cairo_run may not work as is. Running programs requires manual
program, vm and runner initialization.
A working example is provided in this repository.
**Building**
```sh
# The web target generates a JavaScript module that is directly loadable by the
# browser.
wasm-pack build --target=web
```
**Running**
```sh
# Running from file:// will result in a CORS error.
wasm-pack build --target=web
```