ABSTRACT

WebAssembly is a binary format compilation target for languages such as C/C++, Rust and Go. It enables execution within Web browsers and as standalone programs. Compiled modules may interoperate with other languages such as JavaScript, and use external calls (imports) to interact with a host environment. Such interoperability dependencies influence the overall WebAssembly module performance and can limit Web/standalone execution capabilities.

The implementation of a WebAssembly runtime, called TruffleWasm is described that provides a single environment for execution of both, standalone modules, and, interoperation with multiple GraalVM hosted languages such as JavaScript (GraalJS) via Truffle's interoperability framework. The Graal compiler is used to speculatively and aggressively apply profiling driven optimisations to perform Just-in-Time (JIT) code generation.