805bd40ee2
Prepare for 0.14.0 release |
||
---|---|---|
.azure | ||
.github | ||
docs | ||
examples | ||
fuzz | ||
integration_tests | ||
lib | ||
scripts | ||
src | ||
wapm-cli@7996b1cb0e | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
ATTRIBUTIONS.md | ||
azure-pipelines.yml | ||
bors.toml | ||
build | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
Dockerfile.build | ||
install.sh | ||
LICENSE | ||
logo.png | ||
Makefile | ||
README.md | ||
rustfmt.toml | ||
SECURITY.md |
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 | Docs | Wasmer | actively developed | |||
C/C++ | Docs | Wasmer | actively developed | |||
Python | Docs | Wasmer | actively developed | |||
Go | Docs | Wasmer | actively developed | |||
PHP | Docs | Wasmer | actively developed | |||
Ruby | Docs | Wasmer | actively developed | |||
Postgres | Wasmer | actively developed | ||||
JavaScript | Docs | Wasmer | actively developed | |||
C#/.Net | Docs | Miguel de Icaza | actively developed | |||
R | Docs | Dirk Schumacher | actively developed | |||
Elixir | Docs | Philipp Tessenow | actively developed | |||
❓ | 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 itselflib
: modularized libraries that Wasmer uses under the hoodexamples
: 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).
-
Install Visual Studio
-
Install Rust for Windows
-
Install Git for Windows. Allow it to add
git.exe
to your PATH (default settings for the installer are fine). -
Install CMake. Ensure CMake is in your PATH.
-
Install LLVM 8.0
Building
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).