wasmo-old

[WIP] An embeddable high performance WebAssembly engine

APACHE-2.0 License

Stars
37
Committers
1

🚀 GOALS

  • Useable as a standalone WebAssembly runtime.
  • Can serve as a backend for languages compiling to WebAssembly.
  • Provide options for taking advantage of the LLVM backend with JIT and AOT support.
  • Provide options for increasing performance by turning off safety checks.
  • Must be embedabble within projects written in other languages.

🛠 BUILDING THE PROJECT

REQUIREMENTS

  • Rust and Cargo

    Rust and Cargo can be installed by following the instructions here

  • LLVM 8.0.1

    You can download an LLVM installer for Windows or pre-compiled binaries for your Unix platform here

STEPS

  • Clone the repository.

    git clone https://github.com/appcypher/wasmo.git
    
  • Change directory

    cd wasmo
    
  • Create an LLVM_SYS_80_PREFIX environment variable and set its value to your installed LLVM path. The syntax for this depends on the shell you are using

    • Posix (Bash, Zsh, ...)

      export LLVM_SYS_80_PREFIX="/path/to/llvm"
      
    • Fish

      setenv LLVM_SYS_80_PREFIX "/path/to/llvm"
      
    • Cmd

      set LLVM_SYS_80_PREFIX="/path/to/llvm"
      
    • Powershell

      setx LLVM_SYS_80_PREFIX "/path/to/llvm"
      
  • Build the project

    cargo build
    
  • Run wasmo executable

    target/debug/wasmo --help
    

▶️ USAGE

  • Run a WebAssembly file WIP

    target/debug/wasmo sample.wasm
    
  • Print help messages

    target/debug/wasmo --help
    

↔️ API WIP

// AOT
let module: ModuleAOT = Module::create_aot(&wasm_code);

let instance: InstanceAOT = module.instantiate(&imports);

instance.execute(&args)?;

// JIT
let module: Module = Module::create(&wasm_code);

let instance: Instance = module.instantiate(&imports)

instance.execute(&args)?;

👍 ATTRIBUTIONS

  • Inkwell [Apache-2.0] - Inkwell provides a type-safe interface for llvm-sys, and this project's llvm library is mostly based on it.