A small cli demo of rust&wasm hostcall framework.

Overview

A Cli Example for Rust and WebAssembly Hostcall

Usage

# build wasms for ervery module in the `wasm` directory and move them to the root directory
# example:
cd wasm/module_A
cargo build --target wasm32-wasi --release

cp target/wasm32-wasi/release/module_A.wasm ../../

# build and run the Cli
cd ../../src
cargo run

Add new wasm modules

Just follow what was done in module_A.

demostrate how hot-update works

load module_A.wasm A
output:
    Loading module from module_A.wasm
    load module module_A.wasm success, and registry as A
call A modulef1 {"message":"hello_from_cli"}
output:
    Calling function modulef1 in module A with param {"message":"hello_from_cli"}
    enter module a, message: "hello_from_cli"
    enter host f1, message: "implemented in host"
load module_B.wasm A
output:
    Loading module from module_B.wasm
    load module module_B.wasm success, and registry as A
call A modulef1 {"message":"hello_from_cli"}
output:
    Calling function modulef1 in module A with param {"message":"hello_from_cli"}
    enter module b, message: "hello_from_cli"
    enter host f1, message: "implemented in host"

with test

output:
    call from test thread
    module or function not found
    load module_B.wasm A
    Loading module from module_B.wasm
    module or function not found
    load module module_B.wasm success, and registry as A
    enter module b, message: "hello_from_cli"
    enter host f1, message: "implemented in host"

    enter module b, message: "hello_from_cli"
    enter host f1, message: "implemented in host"

    enter module b, message: "hello_from_cli"
    enter host f1, message: "implemented in host"
You might also like...
A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault
A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault

vaultssh A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault vaultssh is a small CLI wrapper for automatically fetching and usin

Small and simple CLI app to generate .editorconfig based on a given settings.

add-editorconfig Small and simple CLI app to generate .editorconfig based on a given settings. Usage # Will create an .editorconfig in the current dir

zman is a CLI year (time) progress that small, fast, and just one single binary.
zman is a CLI year (time) progress that small, fast, and just one single binary.

zman zman is a CLI year (time) progress that small, fast, and just one single binary. Features Show year progress Show month, and week progress Show r

Kana - a small CLI program for transliterating romaji text to either hiragana (ひらがな) or katakana (カタカナ).

Kana About Kana is a small CLI program for transliterating romaji text to either hiragana (ひらがな) or katakana (カタカナ). How it works Internally, it uses

Yet Another Texture Packer - a small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet

YATP (Yet Another Texture Packer) A small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet. Installation

call-me-maybe is a small CLI tool to notify you of the completion of a command

call-me-maybe call-me-maybe is a small CLI tool to notify you of the completion of a command By default, the tools consumes stdin for a message's cont

A minimal CLI framework written in Rust
A minimal CLI framework written in Rust

seahorse A minimal CLI framework written in Rust Features Easy to use No dependencies Typed flags(Bool, String, Int, Float) Documentation Here Usage T

CarLI is a framework for creating single-command and multi-command CLI applications in Rust

CarLI is a framework for creating single-command and multi-command CLI applications in Rust. The framework provides error and IO types better suited for the command line environment, especially in cases where unit testing is needed.

Owner
BC2022
BC2022
Demo app duplicated in 5 languages (Go/JavaScript/Python/Ruby/Rust) showing how to go from source code to container image using melange+apko

hello-melange-apko ?? This repo contains an example app duplicated across 5 languages showing how to: Package source code into APKs using melange Buil

Chainguard 16 Jan 23, 2023
rust+slint+candle+openchat3.5 demo

Slint Chatbot Demo This is a demo of Rust + Slint + Candle + OpenChat LLM, it looks like this: Do it by yourself Make sure you have downloaded opencha

null 12 Dec 13, 2023
Cornucopia is a small CLI utility resting on tokio-postgres and designed to facilitate PostgreSQL workflows in Rust

Cornucopia Generate type checked Rust from your SQL Install | Example Cornucopia is a small CLI utility resting on tokio-postgres and designed to faci

Louis Gariépy 1 Dec 20, 2022
A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

Andrew Vitale 2 Apr 25, 2022
Polyexen demo of Plonkish Arithmetiation Format (Plaf) on the zkevm-circuits

Plaf demo This is a demo of Plaf: Plonkish Arithmetiation Format on the zkevm-circuits Steps to run this: Clone these three repositories in the same f

Eduard S. 17 Apr 6, 2023
A demo for a cross-chain lending using chainsight

demo-crosschain-lending A demo of crosschain lending, using chainsight. Overview This demo shows how to use the chainsight protocol to deposit assets

HorizonX 5 Jun 5, 2023
A simple demo to bind a TCP port with k8s exec channel.k8s.io websocket API.

k8s-webterm-connector Tired with web terminals? Let's use it with CLI! This is just a simple demo to bind a TCP port with k8s exec websocket API, whic

Chielo 4 Aug 11, 2023
A set of demo projects for the Fyrox Game Engine.

Fyrox Demo Projects A set of demo projects for the Fyrox Game Engine. Most of the projects located in this repository in the respective folders. Navig

Fyrox Engine 8 Oct 4, 2023
GraphQL Summit 2023 Workshop Demo for Federated Subscriptions in GraphOS.

Kahoot Clone Demo App - Subgraphs Welcome to the project for GraphQL Summit 2023 "Federated Subscriptions in GraphOS" workshop! ⚠️ Before the workshop

Apollo GraphQL 4 Oct 10, 2023
Small CLI for escaping and unescaping characters in strings

?? esc Small CLI for escaping characters in strings. Install cargo install esc Usage cat LICENSE-MIT | esc escape | pbcopy pbpaste | esc unescape | pb

Seth 1 Nov 26, 2021