TruffleWasm: A WebAssembly Interpreter on GraalVM

Salim Salim, Andy Nisbet, Mikel Luján

Research output: Chapter in Book/Conference proceedingConference contributionpeer-review

1667 Downloads (Pure)

Abstract

WebAssembly is a binary format originally designed for web- based deployment and execution combined with JavaScript. WebAssembly can also be used for standalone programs provided a WebAssembly runtime environment is available.

This paper describes the design and implementation of TruffleWasm, a guest language implementation of a WebAssembly hosted on Truffle and GraalVM. Truffle is a Java framework capable of constructing and interpreting an Abstract Syntax Tree (AST) representing a program on standard JVMs. GraalVM is a JVM with a JIT compiler which optimises the execution of ASTs from Truffle.

Our work is motivated by trying to understand the advantages and disadvantages of using GraalVM, and its support for multiple programming languages, to build a standalone WebAssembly runtime. This contrast with developing a new runtime, as Wasmtime and other projects are undertaking. TruffleWasm can execute standalone WebAssembly modules, while offering also interoperability with other GraalVM hosted languages, such as Java, JavaScript, R, Python and Ruby.

The experimental results compare the peak performance of TruffleWasm to the standalone Wasmtime runtime for the Shootout, C benchmarks in JetStream, and the Poly- BenchC benchmarks. The results show the geo-mean peak performance of TruffleWasm is 4% slower than Wasmtime for Shootout/JetStream, and 4% faster for PolyBenchC.
Original languageEnglish
Title of host publicationProceedings of the ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE'20)
PublisherAssociation for Computing Machinery
Number of pages13
DOIs
Publication statusPublished - 17 Mar 2020

Fingerprint

Dive into the research topics of 'TruffleWasm: A WebAssembly Interpreter on GraalVM'. Together they form a unique fingerprint.

Cite this