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

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

A demo for a cross-chain lending using chainsight
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

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

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

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

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

Owner
BC2022
BC2022
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
Demo Rust Cursive crate for terminal user interface (TUI)

Demo Rust Cursive Demonstration of the Rust programming language and Cursvie crate for terminal user interface (TUI). Setup Create: cargo new demo Add

Joel Parker Henderson 5 Dec 27, 2022
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
Demo Repo for BSides 2024 Live Training: "Blue Crab Shells: Getting Started with Offensive Rust Programming"

Blue Crab Shells: Getting Started with Offensive Rust Programming This repository contains example code for the live training provided for BSides San

The Taggart Institute 6 Apr 9, 2024
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
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

Joshua Gilman 50 Dec 10, 2022
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

Reinaldy Rafli 3 Jan 16, 2022
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

azzamsa 17 Dec 21, 2022
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

Gabriel Sanches 3 Dec 27, 2022