#singlepass #compiler

no-std wasmer-compiler-singlepass-x

Singlepass compiler for Wasmer WebAssembly runtime

1 stable release

2.4.1 Apr 26, 2024

#1212 in WebAssembly

Download history 47/week @ 2024-07-19 46/week @ 2024-07-26 32/week @ 2024-08-02 34/week @ 2024-08-09 48/week @ 2024-08-16 43/week @ 2024-08-23 36/week @ 2024-08-30 27/week @ 2024-09-06 44/week @ 2024-09-13 59/week @ 2024-09-20 36/week @ 2024-09-27 14/week @ 2024-10-04 16/week @ 2024-10-11 24/week @ 2024-10-18 15/week @ 2024-10-25 26/week @ 2024-11-01

81 downloads per month
Used in unc-vm-runner

MIT license

1MB
20K SLoC

wasmer-compiler-singlepass Build Status Join Wasmer Slack MIT License crates.io

This crate contains a compiler implementation based on the Singlepass linear compiler.

Usage

use wasmer::{Store, Universal};
use wasmer_compiler_singlepass::Singlepass;

let compiler = Singlepass::new();
// Put it into an engine and add it to the store
let store = Store::new(&Universal::new(compiler).engine());

Note: you can find a full working example using Singlepass compiler here.

When to use Singlepass

Singlepass is designed to emit compiled code at linear time, as such is not prone to JIT bombs and also offers great compilation performance orders of magnitude faster than wasmer-compiler-cranelift and wasmer-compiler-llvm, however with a bit slower runtime speed.

The fact that singlepass is not prone to JIT bombs and offers a very predictable compilation speed makes it ideal for blockchains and other systems where fast and consistent compilation times are very critical.

Dependencies

~9–18MB
~262K SLoC