Work in progress! No docs yet.
-
C API:
-
See
example/*.cfor example usages. -
See
include/wasm.hfor interface.
-
-
C++ API:
-
See
example/*.ccfor example usages. -
See
include/wasm.hhfor interface.
-
-
A prototype implementation based on V8 is in
src.- Note that this requires adding a module to V8, so it patches V8's build file.
-
C API is implemented on top of C++ API.
-
See
Makefilefor build recipe. Canonical steps to run examples:make v8-checkoutmake v8make all
V8 implementation:
-
Currently requires patching V8 by adding a module.
-
Host functions (Func::make) create a JavaScript function internally, since V8 cannot handle raw C imports yet.
-
As a consequence, does not support i64 in external calls or host functions.
-
Also cannot handle multiple values in external calls or host functions.
-
Host functions and host globals are created through auxiliary modules constructed on the fly, to work around limitations in JS API.
V8 implementation:
- Use reference counting and caching for types?
Possible API tweaks:
-
Distinguish vec and own_vec in C++ API
-
Handle constness of vectors properly in C API
-
Find a way to perform C callbacks through C++ without extra wrapper?
-
Add iterators to
vecclass?