Go to file
Syrus f4e60c09c1 Squashed commit of the following:
commit 62d9da4e3e02251a0f61c904e826bc06cf964ff7
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:34 2019 -0700

    Fixed syscall221

commit a8fde9148d50d89616d8a85a68110b89e3273229
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:04 2019 -0700

    Improved ioctl use case

commit 5ad109d39838624ad84232a4c17714b885835893
Merge: 61526e2c 5cab8161
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 17:44:25 2019 -0700

    Merge branch 'command/dash' into feature/emscripten-update

commit 5cab816193
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 20:11:49 2019 +0200

    Generic IOCTLs mapping

commit 5a0dc0374c
Merge: 61cfed79 9d120ed3
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 17:15:02 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 61cfed7916
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:04:04 2019 +0200

    Fixed implementation for syscalls 200, 201 and 202

commit 91e26d1a0e
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:26 2019 +0200

    Improved debug messages

commit 53a8fbeb2a
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:04 2019 +0200

    [___syscall146] Move loop out of `unsafe` zone

commit d6dd3696f1
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:01:31 2019 +0200

    [___syscall140] Fixed types

commit c827a6a993
Merge: 2bc16826 5e18d04d
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 12:21:33 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 2bc16826b5
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:05:00 2019 +0200

    Implement `getpgid` syscall

commit d464954f58
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:04:36 2019 +0200

    [fcntl64] Replace mock for real implementation

commit 3fe0183d85
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:03:39 2019 +0200

    [ioctl] No-of for `TIOCSPGRP` command & code clean-up

commit cc83ec9ac1
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:47 2019 +0200

    [___syscall5] debug messages

commit 91587c8bde
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:20 2019 +0200

    [___syscall57] debug messages
2019-07-07 19:35:09 -07:00
.circleci Trying to fix CI builds 2019-07-06 10:41:45 -07:00
.github/ISSUE_TEMPLATE fix(github) Remove a duplicate issue template 2019-03-07 10:17:15 +01:00
docs Add Dockerfile and documentation 2019-04-09 01:35:48 -05:00
examples Cleanup internal logic. 2019-06-27 17:54:06 +08:00
integration_tests Added WASI integration tests 2019-04-22 17:06:42 -07:00
lib Squashed commit of the following: 2019-07-07 19:35:09 -07:00
media add images to installer and add wapm bin dir to path 2019-04-30 09:21:08 -07:00
scripts run the script and sudo 2019-03-23 17:20:43 -07:00
src Added emscripten sbrk implementation 2019-07-06 22:05:45 -07:00
wapm-cli@e2aefd4b6b update wapm tag 2019-07-05 16:33:26 -07:00
.appveyor.yml Removing build from normal tests 2019-07-06 10:57:24 -07:00
.dockerignore Add Dockerfile and documentation 2019-04-09 01:35:48 -05:00
.gitattributes Fixed spectests ignored by git attributes 2019-01-31 13:43:04 -08:00
.gitignore Improved install script 2019-04-11 15:05:14 -07:00
.gitmodules Fixed wapm-cli git module url location 2019-04-27 12:40:49 -07:00
ARCHITECTURE.md Update ARCHITECTURE.md 2019-05-29 15:12:45 -07:00
ATTRIBUTIONS.md Fix formatting and grammar in documentation 2019-02-19 17:01:44 -07:00
binary-name.sh Improved install script 2019-04-11 15:05:14 -07:00
bors.toml Added test-stable to the mix 2019-07-05 18:57:30 -07:00
Cargo.lock Merge branch 'master' into update-0.5.4 2019-07-06 00:53:02 -07:00
Cargo.toml update to version 0.5.4 2019-07-05 13:35:55 -07:00
CHANGELOG.md update to version 0.5.4 2019-07-05 13:35:55 -07:00
Dockerfile Add Dockerfile and documentation 2019-04-09 01:35:48 -05:00
install.sh unescape $INSTALL_DIRECTORY in message to user 2019-05-02 15:35:48 -07:00
LICENSE Update LICENSE author 2019-04-16 12:11:00 -07:00
logo.png Updated logo 2018-11-12 18:50:58 -08:00
Makefile Added emscripten sbrk implementation 2019-07-06 22:05:45 -07:00
README.md Fixed capi 2019-07-05 19:55:03 -07:00
rustfmt.toml Added support for 0 or 2 params in main emscripten function 2018-12-15 22:51:10 -08:00
SECURITY.md Fix security contact 2019-05-27 14:41:18 -07:00
update_version_numbers.sh update to version 0.5.4 2019-07-05 13:35:55 -07:00

Wasmer logo

Build Status License Join the Wasmer Community

Introduction

Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully compatible with WASI and Emscripten.

Install Wasmer with:

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

Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere :

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 run examples/lua.wasm

# Run PHP
wasmer run examples/php.wasm

# Run SQLite
wasmer run examples/sqlite.wasm

# Run nginx
wasmer run examples/nginx/nginx.wasm -- -p examples/nginx -c nginx.conf

With WAPM

Installing Wasmer through wasmer.io includes wapm, the WebAssembly package manager.

Wapm allows you to easily download, run, and distribute WebAssembly binaries.

# Install cowsay globally
wapm install -g cowsay

# Run cowsay
wapm run cowsay "Hello, world!"

For more information about wapm, check out the website and this example program.

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 to getting started with Wasmer

Dependencies

Building Wasmer requires rustup.

To build 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

If you have Homebrew installed:

brew install cmake

Or, in case you have MacPorts:

sudo port install cmake

Debian-based Linuxes

sudo apt install cmake pkg-config libssl-dev

FreeBSD

pkg install cmake

Windows (MSVC)

Windows support is highly experimental. Only simple Wasm programs may be run, and no syscalls are allowed. This means nginx and Lua do not work on Windows. See this issue regarding Emscripten syscall polyfills for Windows.

  1. Install Visual Studio

  2. Install Rust for Windows

  3. Install Python for Windows. The Windows x86-64 MSI installer is fine. Make sure to enable "Add python.exe to Path" during installation.

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

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

  6. Install LLVM 7.0

Building

Wasmer is built with Cargo, the Rust package manager.

Set Rust Nightly:

rustup default nightly

And install Wasmer

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

# install tools
# make sure that `python` is accessible.
make install

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 wasi
  • Middleware: make middleware
  • C API: make capi

Benchmarking

Benchmarks can be run with:

make bench

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 (in the works)
  • Support Rust ABI calls
  • Support Go ABI calls

Architecture

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

License

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

ATTRIBUTIONS