#webassembly

no-std cranelift-wasm

Translator from WebAssembly to Cranelift IR

138 releases (90 breaking)

new 0.105.1 Feb 20, 2024
0.104.1 Feb 7, 2024
0.103.0 Dec 20, 2023
0.102.0 Nov 20, 2023
0.17.0 Jul 24, 2018

#1376 in WebAssembly

Download history 74966/week @ 2023-11-02 73167/week @ 2023-11-09 73267/week @ 2023-11-16 74813/week @ 2023-11-23 67615/week @ 2023-11-30 75223/week @ 2023-12-07 64428/week @ 2023-12-14 40791/week @ 2023-12-21 35455/week @ 2023-12-28 61293/week @ 2024-01-04 71607/week @ 2024-01-11 77220/week @ 2024-01-18 71792/week @ 2024-01-25 70065/week @ 2024-02-01 77924/week @ 2024-02-08 67559/week @ 2024-02-15

300,446 downloads per month
Used in 290 crates (4 directly)

Apache-2.0 WITH LLVM-exception

6.5MB
159K SLoC

Rust 110K SLoC // 0.1% comments WebAssembly 49K SLoC // 0.0% comments

This crate performs the translation from a wasm module in binary format to the in-memory form of the Cranelift IR.

If you're looking for a complete WebAssembly implementation that uses this library, see Wasmtime.


lib.rs:

Performs translation from a wasm module in binary format to the in-memory form of Cranelift IR. More particularly, it translates the code of all the functions bodies and interacts with an environment implementing the ModuleEnvironment trait to deal with tables, globals and linear memory.

The crate provides a DummyEnvironment struct that will allow to translate the code of the functions but will fail at execution.

The main function of this module is translate_module.

Dependencies

~7MB
~134K SLoC