All Projects → wapc → wapc-rust

wapc / wapc-rust

Licence: Apache-2.0 License
Rust-based WebAssembly Host Runtime for waPC-compliant modules

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to wapc-rust

imgalign
Webapplication for image stitching and aligning
Stars: ✭ 162 (+116%)
Mutual labels:  webassembly, wasm
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-2.67%)
Mutual labels:  webassembly, wasm
vmrp
mrp emulator, virtual machine, mrp模拟器
Stars: ✭ 126 (+68%)
Mutual labels:  webassembly, wasm
simpleRPC
Simple RPC implementation for Arduino.
Stars: ✭ 28 (-62.67%)
Mutual labels:  rpc, rpc-framework
cabasa
Haxe Framework for WebAssembly
Stars: ✭ 30 (-60%)
Mutual labels:  webassembly, wasm
nerve-rpc
Nim RPC framework
Stars: ✭ 32 (-57.33%)
Mutual labels:  rpc, rpc-framework
gearoenix
Cross-platform C++ 3D game engine.
Stars: ✭ 33 (-56%)
Mutual labels:  webassembly, wasm
wasm-linker-js
A simple WebAssembly Linker in JavaScript
Stars: ✭ 14 (-81.33%)
Mutual labels:  webassembly, wasm
node-wasi
WASI for Node.js
Stars: ✭ 64 (-14.67%)
Mutual labels:  webassembly, wasm
image-hub
Image Hub is a sample application for exploring WebAssembly modules used as Envoy filters.
Stars: ✭ 56 (-25.33%)
Mutual labels:  webassembly, wasm
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (-48%)
Mutual labels:  webassembly, wasm
rustwasmc
Tool for building Rust functions for Node.js. Combine the performance of Rust, safety and portability of WebAssembly, and ease of use of JavaScript.
Stars: ✭ 97 (+29.33%)
Mutual labels:  webassembly, wasm
wasmsign2
PoC implementation of the WebAssembly Modules Signatures proposal.
Stars: ✭ 18 (-76%)
Mutual labels:  webassembly, wasm
warpy
WebAssembly interpreter in RPython
Stars: ✭ 54 (-28%)
Mutual labels:  webassembly, wasm
jasper
🧳 Single-binary packaging for Ruby applications that supports native and Wasm targets
Stars: ✭ 29 (-61.33%)
Mutual labels:  webassembly, wasm
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-56%)
Mutual labels:  webassembly, wasm
vrcpu
Code, documentation, schematics, notes for my Ben Eater inspired breadboard computer and emulator
Stars: ✭ 98 (+30.67%)
Mutual labels:  webassembly, wasm
wasm-ops
Chart of WebAssembly Instructions
Stars: ✭ 46 (-38.67%)
Mutual labels:  webassembly, wasm
Pudding
Pudding 是一款迷你级分布式服务框架
Stars: ✭ 24 (-68%)
Mutual labels:  rpc, rpc-framework
block-aligner
SIMD-accelerated library for computing global and X-drop affine gap penalty sequence-to-sequence or sequence-to-profile alignments using an adaptive block-based algorithm.
Stars: ✭ 58 (-22.67%)
Mutual labels:  webassembly, wasm


This repository has moved

Please update your links to the wapc/wapc-rs repository.



Rust crates.io license

waPC

This is the Rust implementation of the waPC standard for WebAssembly host runtimes. It allows any WebAssembly module to be loaded as a guest and receive requests for invocation as well as to make its own function requests of the host. This library allows for both "pure" (completely isolated) wasm modules as well as WASI modules

This crate defines the protocol for RPC exchange between guest (WebAssembly) modules and the host runtime. That protocol can be satisfied by any engine that implements the right trait. This allows you to choose the WebAssembly low-level "driver" that best suits your needs, whether it be JITted or interpreted or bespoke.

Example

The following is a simple example of synchronous, bi-directional procedure calls between a WebAssembly host runtime and the guest module.

extern crate wapc;
use wasmtime_provider::WasmtimeEngineProvider;
use wapc::prelude::*;

pub fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    let module = load_file();
    let engine = WasmtimeEngineProvider::new(&module, None);
    let mut host = WapcHost::new(
       engine,
       |id: u64, bd: &str, ns: &str, op: &str, payload: &str|{
        println!("Guest {} invoked '{}->{}:{}' with payload of {} bytes", id, bd, ns, op, payload.len());
        Ok(vec![])
    }, &module, None)?;

    let res = host.call("wapc:sample!Hello", b"this is a test")?;
    assert_eq!(res, b"hello world!");
    Ok(())
}

For running examples, take a look at the examples available in the individual engine provider repositories:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].