Crates.io | wasmer-compiler-llvm-near |
lib.rs | wasmer-compiler-llvm-near |
version | 1.0.1 |
source | src |
created_at | 2021-02-05 00:37:10.023004 |
updated_at | 2021-02-05 00:37:10.023004 |
description | LLVM compiler for Wasmer WebAssembly runtime |
homepage | |
repository | https://github.com/wasmerio/wasmer |
max_upload_size | |
id | 350806 |
size | 609,209 |
wasmer-compiler-llvm
This crate contains a compiler implementation based on the LLVM Compiler Infrastructure.
use wasmer::{Store, JIT};
use wasmer_compiler_llvm::LLVM;
let compiler = LLVM::new();
// Put it into an engine and add it to the store
let store = Store::new(&JIT::new(compiler).engine());
Note: you can find a full working example using LLVM compiler here.
We recommend using LLVM as the default compiler when running WebAssembly files on any production system, as it offers maximum peformance near to native speeds.
The LLVM compiler requires a valid installation of LLVM in your system. It currently requires LLVM 10.
You can install LLVM 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.