Crates.io | wasm-core |
lib.rs | wasm-core |
version | 0.2.15 |
source | src |
created_at | 2018-03-11 14:30:46.774715 |
updated_at | 2018-05-03 04:17:25.013886 |
description | Portable WebAssembly implementation |
homepage | |
repository | https://github.com/losfair/wasm-core |
max_upload_size | |
id | 54997 |
size | 464,248 |
Portable WebAssembly implementation intended to run everywhere.
wasm-core includes two execution engines, an interpreter and a JIT based on LLVM. While the former one is mainly for use on platforms with constrained resources or not supported by LLVM MCJIT, the latter one is designed for high performance and should be used whenever possible.
With LLVM optimizations and on-demand compilation, the JIT engine of wasm-core is able to achieve near-native performance on x86-64.
wasm-core supports no_std
. This means that it can run on any platforms with libcore
and liballoc
available, which include a lot of embedded devices and even OS kernels.
The default execution environment is fully sandboxed, which means that user code cannot access the outside environment without explicit native imports.
External functions can be easily imported by implementing the NativeResolver
trait and exported WebAssembly functions can be easily called from outside. See Ice Core as an example.
Instead of loading WebAssembly files directly, wasm-core takes code in an IR format generated from the raw WebAssembly code by the wasm-translator
crate under translator/
.
See Ice Core as an example for executing pure-wasm code and wa/
as an example for executing wasm generated by Emscripten. (note: support for Emscripten-generated code may be removed in the future once the WebAssembly backend of LLVM becomes stable and fully usable from clang. )
See issues with the bug
tag.
Contribution to this project is always welcomed! Open a pull request directly if you've fixed a bug and open a issue for discussion first if you want to add new features.