GithubHelp home page GithubHelp logo

hhy5277 / wasmer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wasmerio/wasmer

0.0 1.0 0.0 11.7 MB

Universal Binaries Powered by WebAssembly

Home Page: https://wasmer.io

License: MIT License

Makefile 0.25% Shell 2.58% HTML 0.01% Rust 90.15% WebAssembly 0.10% CMake 0.27% C 4.53% C++ 1.79% Inno Setup 0.34%

wasmer's Introduction

Wasmer logo

Build Status License Join the Wasmer Community

Introduction

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

Install Wasmer with:

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

NEW โœจ: You can now embed Wasmer in your Rust application, check our example repo to see how!

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 nginx and Lua!):

# Run Lua
wasmer run examples/lua.wasm

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

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

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 Python for Windows. The Windows x86-64 MSI installer is fine. Make sure to enable "Add python.exe to Path" during installation.

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

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

Building

Wasmer is built with Cargo, the Rust package manager.

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

# install tools
# make sure that `python` is accessible.
cargo install --path .

Testing

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

Tests can be run with:

make test

If you need to regenerate the Rust tests from the spec tests you can run:

make spectests

You can also run integration tests with:

make integration-tests

Benchmarking

Benchmarks can be run with:

cargo bench --all

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

wasmer's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.