| Crates.io | wasm-wrapper-gen |
| lib.rs | wasm-wrapper-gen |
| version | 0.0.3 |
| created_at | 2017-11-27 22:37:25.49572+00 |
| updated_at | 2017-12-06 07:20:37.434743+00 |
| description | JavaScript wrapper generation for rust code targeting wasm32-unknown-unknown |
| homepage | |
| repository | https://github.com/daboross/wasm-wrapper-gen |
| max_upload_size | |
| id | 40790 |
| size | 5,416 |
JavaScript wrapper generation for rust code targeting wasm32-unknown-unknown.
This repository is currently very WIP, but there's a full working example Cargo project in examples/simple_summation/.
General overview:
wasm-wrapper-gen is composed of two interlocking parts:
wasm-wrapper-gen provides the js_fn!() macro which generates extern "C" functionswasm-wrapper-gen-build is a build-script utility which scrapes the source for usages of js_fn!() and generates a JavaScript file which binds to those exported functions.Note: this assumes little-endian hardware (the majority of modern hardware).
bool, u8, u16, u32, usize, i8, i16, i32, isize, f32, f64&[_], &mut [_], Vec<_> where _ is any of the abovebool, u8, u16, u32, usize, i8, i16, i32, isize, f32, f64Vec<_> where _ is any of the aboveNext to do:
impl blocks with self arguments and creating wrapper JS types
which manage allocation sanely.Further future: