Mozilla and Fastly Labs have led development of the Cranelift open source library, which translates functions for the WebAssembly portable code format for the web into native machine-code functions, for efficient execution. Cranelift can also be used for running WebAssembly code outside the web. Cranelift is being built under the auspices of Crane Station, the Crane Compiler Organization.

Cranelift reads WebAssembly as input and writes native machine code as output. The library also can ingest its own Crane IR (intermediate representation), providing a broader feature set. With Cranelift, functions are converted into SSA (static single assignment) form and optimizations are performed before being converted into machine code, which can be packaged into native object files (.o files) or allocated in memory and executed directly as a just-in-time (JIT).

To read this article in full, please click here