0.1.1 • Published 2 years ago
dumbfancy v0.1.1
A bytecode interpreter written in Rust and WebAssembly
Built with 🦀🕸 by The Rust and WebAssembly Working Group
Usage
Import the wasm module and use it in a React component:
const InterpreterComponent = dynamic({
loader: async () => {
const { interpret } = await import('dumbfancy');
return ({ source }: InterpreterProps) => <div>{interpret(source)}</div>
}
})
const MyApp = () => {
return (<InterpreterComponent source="7 + 4 * (2 + 1)"/>);
}
wasm-pack docs
📚 Read this template tutorial! 📚
Be sure to check out other wasm-pack
tutorials online for other
templates and usages of wasm-pack
.
🛠️ Build with wasm-pack build
wasm-pack build
🔬 Test in Headless Browsers with wasm-pack test
wasm-pack test --headless --firefox
🎁 Publish to NPM with wasm-pack publish
wasm-pack publish
🔋 Batteries Included
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.