An open API service indexing awesome lists of open source software.

https://github.com/appcypher/wasmo-old

[WIP] An embeddable high performance WebAssembly engine
https://github.com/appcypher/wasmo-old

runtime rust vm wasm webassembly

Last synced: 4 months ago
JSON representation

[WIP] An embeddable high performance WebAssembly engine

Awesome Lists containing this project

README

          



Wasabi Logo

WASMO

--------------

### 🚀 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](https://doc.rust-lang.org/cargo/getting-started/installation.html)

- LLVM 8.0.1

You can download an LLVM installer for Windows or pre-compiled binaries for your Unix platform [here](https://github.com/llvm/llvm-project/releases/tag/llvmorg-8.0.1)

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


Read more

- 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_
```rust
// 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](https://github.com/TheDan64/inkwell) [Apache-2.0] - Inkwell provides a type-safe interface for [llvm-sys](https://bitbucket.org/tari/llvm-sys.rs), and this project's llvm library is mostly based on it.