Today, we are releasing a new tool that will help you use WebAssembly anywhere: WAPM (aka WebAssembly Package Manager).

This release includes:

A command line application: wapm , included when you install Wasmer

, included when you install Wasmer A website and package registry: wapm.io

Why: while working on Wasmer, we discovered that the developer ergonomics needed to improve significantly for WebAssembly to be accessible by the general audience. We realized that a Package Manager will help solve common problems like publishing, defining module ABIs, distributing executable binaries and using them.

What: WebAssembly is an abstraction on top of chipset instructions, this enables wasm modules to run very easily on any machine. If we move this abstraction up we can unlock the potential of having universal binaries that can run anywhere, even on platforms/chipsets not supported at the moment of releasing the binary. Integrations like WASI and Emscripten are essential for projects that want to target WebAssembly easily.

We aim to offer a Package Manager to be a companion to WebAssembly, that will ease the use and distribution of WebAssembly modules.

You can see wapm in action in this video:

Why do we need a Package Manager?

Let’s dig a bit more into why a Package Manager is key for the adoption of WebAssembly on the server-side.

Persona I: common user

First, we have the use case of a developer that wants to use a WebAssembly binary but has no idea how/where to find it: this can be nginx, lua, sqlite or any other wasm binary. For them, this is how the process looked like:

Let’s do some search and see where can I find a runnable lua.wasm

Try to run it… what are the commands I can run on this binary?

wasmer run lua.wasm -- -h

Persona II: universal binary publisher

Our second persona is a developer that wants to create a universal binary and distribute it very easily across any machine and operating system. This can be useful for command-line tools, or anything that can be run directly in your shell:

Generate the WebAsseembly file (with tools like emcc )

emcc main.c -s WASM=1 # this emits the main.wasm file

Where should I publish it? Github? Npm? But it’s only the WebAssembly, no JS associated… let’s do Github!

git push ...

Persona III: universal library publisher

We also have the use case of a developer that wants to create universal libraries in WebAssembly and use them from all languages (this can be: Python, PHP, JavaScript, Rust, C, C++…).

This would be useful, for example, for developers that are creating libraries that could be used across any language (like a lightweight embeddable search engine, a face detection library, an universal GraphQL framework …).