Improved Wasmer Backends documentation

This commit is contained in:
Syrus
2019-07-24 18:06:59 -07:00
parent 0191de4e50
commit 76daa7b3fd
6 changed files with 73 additions and 3 deletions

View File

@ -6,6 +6,7 @@ license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer"
edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" }

View File

@ -28,4 +28,26 @@ Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully
compatible with Emscripten, Rust and Go. [Learn
more](https://github.com/wasmerio/wasmer).
This crate represents the Cranelift backend.
This crate represents the Cranelift backend integration for Wasmer.
## Usage
### Usage in Wasmer Standalone
If you are using the `wasmer` CLI, you can specify the backend with:
```bash
wasmer run program.wasm --backend=cranelift
```
### Usage in Wasmer Embedded
If you are using Wasmer Embedded, you can specify
the Cranelift backend to the [`compile_with` function](https://docs.rs/wasmer-runtime-core/*/wasmer_runtime_core/fn.compile_with.html):
```rust
use wasmer_clif_backend::CraneliftCompiler;
// ...
let module = wasmer_runtime_core::compile_with(&wasm_binary[..], &CraneliftCompiler::new());
```

View File

@ -3,6 +3,7 @@ name = "wasmer-llvm-backend"
version = "0.5.7"
authors = ["Lachlan Sneff <lachlan.sneff@gmail.com>"]
edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" }

View File

@ -28,4 +28,26 @@ Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully
compatible with Emscripten, Rust and Go. [Learn
more](https://github.com/wasmerio/wasmer).
This crate represents the LLVM backend.
This crate represents the LLVM backend integration for Wasmer.
## Usage
### Usage in Wasmer Standalone
If you are using the `wasmer` CLI, you can specify the backend with:
```bash
wasmer run program.wasm --backend=llvm
```
### Usage in Wasmer Embedded
If you are using Wasmer Embedded, you can specify
the LLVM backend to the [`compile_with` function](https://docs.rs/wasmer-runtime-core/*/wasmer_runtime_core/fn.compile_with.html):
```rust
use wasmer_llvm_backend::LLVMCompiler;
// ...
let module = wasmer_runtime_core::compile_with(&wasm_binary[..], &LLVMCompiler::new());
```

View File

@ -6,6 +6,7 @@ description = "Wasmer runtime single pass compiler backend"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" }

View File

@ -28,4 +28,27 @@ Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully
compatible with Emscripten, Rust and Go. [Learn
more](https://github.com/wasmerio/wasmer).
This crate represents the singlepass backend.
This crate represents the Singlepass backend integration for Wasmer.
## Usage
### Usage in Wasmer Standalone
If you are using the `wasmer` CLI, you can specify the backend with:
```bash
wasmer run program.wasm --backend=singlepass
```
### Usage in Wasmer Embedded
If you are using Wasmer Embedded, you can specify
the LLVM backend to the [`compile_with` function](https://docs.rs/wasmer-runtime-core/*/wasmer_runtime_core/fn.compile_with.html):
```rust
use wasmer_singlepass_backend::SinglepassCompiler;
// ...
let module = wasmer_runtime_core::compile_with(&wasm_binary[..], &SinglepassCompiler::new());
```