This adds a feature which allows one to look up an export by name without knowing what module it's in -- `lookup_global_export` on an `InstanceContents`. The main expected use for this is to support APIs where module A imports a function from module B, and module B needs to access module A's memory. B can't import it from A in the normal way, because that would create a dependency cycle. So for now, allow B to look up A's exported memory dynamically with `lookup_global_export`. In the future, with reference types and possibly host bindings, we'll be able to pass references to memory as arguments, which will obviate the need for this mechanism.
Wasmtime: a WebAssembly Runtime.
Wasmtime is a standalone wasm-only runtime for WebAssembly, using the Cranelift JIT.
It runs WebAssembly code outside of the Web, and can be used both as a command-line utility or as a library embedded in a larger application.
Wasmtime is complete enough to pass the WebAssembly spec testsuite. Support for system APIs is coming soon!
One goal for this project is to implement CloudABI using WebAssembly as the code format, provide CloudABI system calls as WebAssembly host imports, and then port the Rust CloudABI package and CloudABI libc to it to support Rust, C, C++, and other toolchains.
CloudABI is a natural complement for WebAssembly, since WebAssembly provides sandboxing for code but doesn't have any builtin I/O, and CloudABI provides sandboxed I/O.
Additional goals for Wasmtime include:
- Support a variety of host APIs (not just CloudABI), with fast calling sequences, and develop proposals for system calls in the WebAssembly Reference Sysroot.
- Implement the proposed WebAssembly C API.
- Facilitate testing, experimentation, and development around the Cranelift and Lightbeam JITs.
- Develop a the native ABI used for compiling WebAssembly suitable for use in both JIT and AOT to native object files.
It's Wasmtime.