Skip to content

Very early experiment on WASI, WIT, and Wasm Component Model with Rust and C#

License

Notifications You must be signed in to change notification settings

thangchung/wasi-wit-wasm-component-experiment

Repository files navigation

Add solution

This repository is for experiment wasm-component-sdk.

Run on Windows 11 only. It couldn't work on Ubuntu or MacOS 😂

wasm/wasi component with C#

> dotnet new sln -n calculator
> dotnet sln calculator.sln add MyApp/MyApp.csproj 
> dotnet sln calculator.sln add Adder/Adder.csproj
> cd Adder 
> dotnet build

You should see the wasm/wasi component at bin\Debug\net8.0\wasi-wasm\native\Adder.component.wasm

wasm/wasi component with Spin (Rust)

> cd rust-host
> spin build
> spin run
> curl http://127.0.0.1:3000/?"x=10&y=40"

wasm-tools (compose and run Adder on MyApp - C#)

> wasm-tools component wit Adder\bin\Debug\net8.0\wasi-wasm\native\Adder.component.wasm
> wasm-tools compose -o composed.wasm MyApp\bin\Debug\net8.0\wasi-wasm\native\MyApp.component.wasm -d Adder\bin\Debug\net8.0\wasi-wasm\native\Adder.component.wasm
> wasmtime --wasm component-model composed.wasm

Refs

About

Very early experiment on WASI, WIT, and Wasm Component Model with Rust and C#

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published