Crates.io | wasmer-engine-native-asml-fork |
lib.rs | wasmer-engine-native-asml-fork |
version | 1.0.2 |
source | src |
created_at | 2021-02-06 03:17:28.895722 |
updated_at | 2021-02-06 03:17:28.895722 |
description | Wasmer Native Engine |
homepage | |
repository | https://github.com/wasmerio/wasmer |
max_upload_size | |
id | 351398 |
size | 45,598 |
wasmer-engine-native
The Wasmer Native engine is usable with any compiler implementation
based on wasmer-compiler
that is able to emit
Position-independent Code (PIC).
After the compiler generates the machine code for the functions, the
Native engine generates a shared object file and links it via
dlsym
so it can be usable by the wasmer
API.
This allows Wasmer to achieve blazing fast native startup times.
Note: you can find a full working example using the Native engine here.
wasmer-engine-jit
The Native Engine and JIT engine mainly differ on how the Modules are loaded/stored. Using the same compilers, both will have the same runtime speed.
However, the Native engine uses the Operating System shared library loader (via dlopen
)
and as such is able to achieve a much faster startup time when deserializing a serialized
Module.
The wasmer-engine-native
crate requires a linker available on your
system to generate the shared object file.
We recommend having gcc
or clang
installed.
Note: when cross-compiling to other targets,
clang
will be the default command used for compiling.
You can install LLVM (that provides clang
) easily on your
Debian-like system via this command:
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
Or in macOS:
brew install llvm
Or via any of the pre-built binaries that LLVM offers.