Volver al blog

Síguenos y suscríbete

Sólo disponible en inglés

Por el momento, esta página solo está disponible en inglés. Lamentamos las molestias. Vuelva a visitar esta página más tarde.

How Lucet and Wasmtime make a stronger compiler, together

Pat Hickey

Principal Software Engineer, Fastly

We believe WebAssembly will help define high-performing, secure edge compute. And when we open-sourced Lucet — the first WebAssembly runtime designed for edge computing — we knew it would be useful beyond the edge. This is one reason we formed the Bytecode Alliance, an open-source community focused on improving WebAssembly-based compilers, alongside Mozilla, Intel, and Red Hat.

The other high-performance WebAssembly runtime from the Bytecode Alliance is Wasmtime. It shares many core components with Lucet, and was developed at Mozilla during the period where Lucet was still a closed-source prototype. Thanks to the Bytecode Alliance, work is now underway to unite the powers of Lucet and Wasmtime — helping developers get started with fewer barriers, do more in one codebase, and better integrate existing languages and workflows. 

When this project is complete, Lucet will be able to leverage all of the support Wasmtime has for platforms like Mac OS and Windows, and Wasmtime will be able to leverage Lucet’s ahead-of-time compilation model. It’s a big win for each project.

Lucet was built to go beyond the browser to help us build a platform focused on security, speed, and lower resource usage. Lucet uses ahead-of-time compilation to create fast native code from WebAssembly modules — which works really well for sandboxing when you’re optimizing for speed, so you don’t have to compile every time you start. And for a number of domains, this ahead-of-time approach works well. But we know there’s more to it than that. Lucet was designed exclusively for Linux, and it hasn’t been easy to use it on Mac OS or Windows. Similarly, Lucet is used at Fastly in C and Rust programs, so we haven’t produced bindings to other languages. And that’s where our work with Wasmtime comes in. 

Wasmtime is designed primarily for just-in-time compilation, where native code is produced for a WebAssembly module in the same process as the code is executed. This is appropriate for many applications where ahead-of-time compilation is not as useful, like using WebAssembly to implement scripting or plugin systems. And Wasmtime has excellent support for other languages, like Ruby, Python, and .NET, which means it’ll be easier to integrate into your existing projects. We also believe in the power of Wasmtime’s speed and security: their team hasn’t taken any shortcuts here, and they share our values of prioritizing fast, safe execution of WebAssembly. 

This project is only the beginning of our collaboration with the Bytecode Alliance, and we’re already seeing new avenues surface. For example, we know many of you want to run locally on your laptops, servers, or CI systems, so you can more easily test if your edge compute applications are doing what you expect. We’re excited about the relevance this project has for that space — as it’s helping us lay the groundwork to potentially run local environments on Mac and Windows in the future. 

Combining the power of Lucet and Wasmtime exemplifies why the Bytecode Alliance formed: it specifically enables this kind of collaboration — aimed at making developers’ lives easier and  powering trustworthy computation on the edge and beyond. 

As always, we’ll keep you posted on any new developments and let you know when it launches. Until then, you can visit our Community forums to share any feedback or ideas, further explore our commitment to open-source projects, or read more about how to get involved with the Bytecode Alliance.