Go to file
2020-02-16 12:48:20 -08:00
.azure Add musl build target for CI. 2020-01-29 01:07:55 +08:00
.github Update CODEOWNERS 2020-01-17 17:15:00 -06:00
docs doc(assets) Reduce Elixir logo to ~25px. 2020-01-16 10:26:34 +01:00
examples Add MIT license to crates that were missing it 2019-12-22 12:28:33 +01:00
fuzz Merge #938 2019-11-08 23:54:53 +00:00
integration_tests Fix some other files too 2019-09-30 22:50:04 -07:00
lib Added link to a custom ABI example repo 2020-02-16 12:48:20 -08:00
scripts Prepare for 0.13.1 release 2020-01-16 14:07:18 -08:00
src Remove WasmTrapInfo and passExceptionCode in the generic Box<Any> container. 2020-02-06 23:49:50 +08:00
wapm-cli@7996b1cb0e Prepare for 0.13.1 release 2020-01-16 14:07:18 -08:00
.dockerignore Add examples dir to Docker file. Fix #970 2019-11-15 09:47:38 -08:00
.gitattributes Use union merge on the changelog file. 2019-09-13 14:46:37 -07:00
.gitignore Trying to fix building docs 2020-01-14 13:35:06 +01:00
.gitmodules rm clif submodule; fix master 2019-07-10 10:38:38 -07:00
.travis.yml Update Travis CI nightly version to 2019-12-19 2019-12-19 14:20:42 -05:00
ATTRIBUTIONS.md Fix formatting and grammar in documentation 2019-02-19 17:01:44 -07:00
azure-pipelines.yml Update Rust version used to build docs to be consistent 2020-02-11 10:41:17 -08:00
bors.toml Add ARM CI to bors's list 2019-12-10 16:13:09 -08:00
build Add a Docker sandbox for building Wasmer 2019-07-29 21:18:04 +03:00
Cargo.lock Merge branch 'master' into feat-interface-types 2020-02-13 14:40:46 +01:00
Cargo.toml Merge branch 'master' into feat-interface-types 2020-02-13 14:40:46 +01:00
CHANGELOG.md Improve clif verifier error message 2020-02-14 11:45:11 -08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-08-22 16:16:34 -05:00
CONTRIBUTING.md Fix some other files too 2019-09-30 22:50:04 -07:00
Dockerfile Bump supported Rust version to 1.40.0 2020-01-31 14:56:20 -08:00
Dockerfile.build Add a Docker sandbox for building Wasmer 2019-07-29 21:18:04 +03:00
index.html Publishing GitHub Pages ***CI*** 2020-01-14 12:34:12 +01:00
install.sh Use wapm packages last after $PATH 2020-02-14 00:16:32 -08:00
LICENSE Update LICENSE author 2019-04-16 12:11:00 -07:00
logo.png Updated logo 2019-08-17 21:41:09 -07:00
Makefile test(interface-types) Add wasmer-interface-types to make check. 2020-02-13 15:38:35 +01:00
README.md Bump supported Rust version to 1.40.0 2020-01-31 14:56:20 -08:00
rustfmt.toml update rustfmt.toml to ignore and fmt 2019-07-15 10:43:30 -07:00
SECURITY.md Fix security contact 2019-05-27 14:41:18 -07:00

Wasmer logo

Build Status Documentation License Join the Wasmer Community Follow @wasmerio on Twitter

Introduction

Wasmer is a standalone WebAssembly runtime for running WebAssembly outside of the browser, supporting WASI and Emscripten. Wasmer can be used standalone (via the CLI) and embedded in different languages, running in x86 and ARM devices.

Install the Wasmer and WAPM cli with:

curl https://get.wasmer.io -sSfL | sh

If Homebrew is installed:

brew install wasmer

Note: Wasmer is also available on Windows

Languages

Wasmer runtime can be used as a library embedded in different languages, so you can use WebAssembly anywhere:

  Language Docs Author(s) Maintenance Release Stars
Rust logo Rust Docs Wasmer actively developed last release number of Github stars
C logo C/C++ Docs Wasmer actively developed last release number of Github stars
Python logo Python Docs Wasmer actively developed last release number of Github stars
Go logo Go Docs Wasmer actively developed last release number of Github stars
PHP logo PHP Docs Wasmer actively developed last release number of Github stars
Ruby logo Ruby Docs Wasmer actively developed last release number of Github stars
Postgres logo Postgres Wasmer actively developed last release number of Github stars
JS Logo JavaScript Docs Wasmer actively developed last release number of Github stars
C# logo C#/.Net Docs Miguel de Icaza actively developed last release number of Github stars
R logo R Docs Dirk Schumacher actively developed number of Github stars
Elixir logo Elixir Docs Philipp Tessenow actively developed last release number of Github stars
your language is missing?

Usage

Wasmer can execute both the standard binary format (.wasm) and the text format defined by the WebAssembly reference interpreter (.wat).

Once installed, you will be able to run any WebAssembly files (including Lua, PHP, SQLite and nginx!):

# Run Lua
wasmer examples/lua.wasm

You can find more wasm/wat examples in the examples directory.

Docs

Wasmer documentation lives on docs.wasmer.io.

Code Structure

Wasmer is structured into different directories:

  • src: code related to the Wasmer executable itself
  • lib: modularized libraries that Wasmer uses under the hood
  • examples: some useful examples for getting started with Wasmer

Dependencies

Building Wasmer requires rustup.

To build Wasmer on Windows, download and run rustup-init.exe then follow the onscreen instructions.

To build on other systems, run:

curl https://sh.rustup.rs -sSf | sh

Other dependencies

Please select your operating system:

macOS

macOS

If you have Homebrew installed:

brew install cmake

Or, if you have MacPorts:

sudo port install cmake

Debian-based Linuxes

Debian-based Linuxes

sudo apt install cmake pkg-config libssl-dev

FreeBSD

FreeBSD

pkg install cmake

Windows

Windows (MSVC)

Windows support is experimental. WASI is fully supported, but Emscripten support is in the works (this means nginx and Lua do not work on Windows - you can track the progress on this issue).

  1. Install Visual Studio

  2. Install Rust for Windows

  3. Install Git for Windows. Allow it to add git.exe to your PATH (default settings for the installer are fine).

  4. Install CMake. Ensure CMake is in your PATH.

  5. Install LLVM 8.0

Building

Rustc Version 1.40+

Wasmer is built with Cargo, the Rust package manager.

The Singlepass backend requires nightly, so if you want to use it,

Set Rust Nightly:

rustup default nightly

Otherwise an up to date (see badge above) version of stable Rust will work.

And install Wasmer

# checkout code
git clone https://github.com/wasmerio/wasmer.git
cd wasmer

# install tools
make release-clif # To build with cranelift (default)

make release-llvm # To build with llvm support

make release-singlepass # To build with singlepass support

# or
make release # To build with singlepass, cranelift and llvm support

Testing

Thanks to spec tests we can ensure 100% compatibility with the WebAssembly spec test suite.

You can run all the tests with:

rustup default nightly
make test

Testing backends

Each backend can be tested separately:

  • Singlepass: make singlepass
  • Cranelift: make cranelift
  • LLVM: make llvm

Testing integrations

Each integration can be tested separately:

  • Spec tests: make spectests
  • Emscripten: make emtests
  • WASI: make wasitests
  • Middleware: make middleware
  • C API: make capi

Benchmarking

Benchmarks can be run with:

make bench-[backend]

# for example
make bench-singlepass

Roadmap

Wasmer is an open project guided by strong principles, aiming to be modular, flexible and fast. It is open to the community to help set its direction.

Below are some of the goals of this project (in order of priority):

  • It should be 100% compatible with the WebAssembly spec tests
  • It should be fast (partially achieved)
  • Support WASI - released in 0.3.0
  • Support Emscripten calls
  • Support Go JS ABI calls (in the works)

Architecture

If you would like to know how Wasmer works under the hood, please see docs/architecture.md.

License

Wasmer is primarily distributed under the terms of the MIT license (LICENSE).

ATTRIBUTIONS