wasmer-compiler
This crate is the base for Compiler implementations.
It performs the translation from a Wasm module into a basic
ModuleInfo
, but leaves the Wasm function bytecode translation to the
compiler implementor.
Here are some of the Compilers provided by Wasmer:
How to create a compiler
To create a compiler, one needs to implement two traits:
CompilerConfig
, that configures and creates a new compiler,Compiler
, the compiler itself that will compile a module.
/// The compiler configuration options.
/// An implementation of a compiler from parsed WebAssembly module to compiled native code.
Acknowledgments
This project borrowed some of the code strucutre from the
cranelift-wasm
crate, however it's been adapted to not depend on
any specific IR and be abstract of any compiler.
Please check Wasmer ATTRIBUTIONS
to further see licenses and other
attributions of the project.