#singlepass #compiler

no-std wasmer-compiler-singlepass-x

Singlepass compiler for Wasmer WebAssembly runtime

1 stable release

2.4.1 Apr 26, 2024

#1155 in WebAssembly

Download history 59/week @ 2024-06-17 51/week @ 2024-06-24 23/week @ 2024-07-01 18/week @ 2024-07-08 67/week @ 2024-07-15 29/week @ 2024-07-22 47/week @ 2024-07-29 31/week @ 2024-08-05 47/week @ 2024-08-12 36/week @ 2024-08-19 53/week @ 2024-08-26 22/week @ 2024-09-02 37/week @ 2024-09-09 39/week @ 2024-09-16 62/week @ 2024-09-23 35/week @ 2024-09-30

174 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–17MB
~257K SLoC