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
- Host: GitHub
- URL: https://github.com/appcypher/wasmo-old
- Owner: appcypher
- License: apache-2.0
- Created: 2018-12-12T01:06:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-06T21:31:03.000Z (about 4 years ago)
- Last Synced: 2025-03-05T15:03:26.089Z (over 1 year ago)
- Topics: runtime, rust, vm, wasm, webassembly
- Language: Rust
- Homepage:
- Size: 1.98 MB
- Stars: 37
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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.