You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wasmer currently has 3 engines: Universal, Dylib and Staticlib. This causes several issues in practice:
It is often unclear to users which engine they should be using and what the advantages/disadvantages of the various engines are.
For a long time the Dylib engine wasn’t properly supported on singlepass.
The Staticlib engine is poorly documented and hard to use. It basically only exists for wasmer create-exe.
There is a lot of code duplication between the various engines.
The use of multiple engines requires some types to be behind traits (e.g. Artifact). This makes code that interacts with these types more complicated due to the use of dyn and boxing.
The abstraction of serializing and de-serializing a module works well for the Universal engine but breaks down for the other engines. What does de-serializing a dylib or staticlib even mean?
The plan here is to deprecate all the existing engines and replace them with a single engine which covers all the existing use cases. This will also allow simplifying Wasmer by removing the engine crates and eliminating configuration options.
Artifact
The core element of the new engine is the Artifact. An Artifact consists of:
A data section, which contains:
The compiled code for all functions.
Constant data used by functions (.rodata).
Unwinding metadata for all functions.
A metadata section which contains everything else.
Function entry points are encoded as offsets into the data section.
This is encoded using rkyv so that it can be used in-place.
Unlike the current artifacts, the compiler is responsible for linking all the compiled code together into a single code block and resolving relocations between functions.
The Artifact format is deliberately simple so that it can be loaded in different ways. The main two are:
Memory-mapping the artifact from a file and constructing a Module from the two memory-mapped sections.
Having the artifact linked directly into the current program. A Module can be constructed from just the pointers to the data and metadata sections.
2 output formats:
Universal format → Dynamic loading by the runtime.
Wasmer currently has 3 engines: Universal, Dylib and Staticlib. This causes several issues in practice:
wasmer create-exe
.Artifact
). This makes code that interacts with these types more complicated due to the use ofdyn
and boxing.The plan here is to deprecate all the existing engines and replace them with a single engine which covers all the existing use cases. This will also allow simplifying Wasmer by removing the engine crates and eliminating configuration options.
Artifact
The core element of the new engine is the Artifact. An Artifact consists of:
.rodata
).Unlike the current artifacts, the compiler is responsible for linking all the compiled code together into a single code block and resolving relocations between functions.
The Artifact format is deliberately simple so that it can be loaded in different ways. The main two are:
2 output formats:
Way to include a static object (Wasm → .o compiled with Wasmer) and use it with Wasmer
The text was updated successfully, but these errors were encountered: