No description
Find a file
Dirk Hoyer 93adb326c2 fix: add .gitignore, remove committed target/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 21:04:26 +01:00
examples feat: Complete WASM SDK implementation (Mission I159) 2026-03-06 23:14:18 +01:00
src chore: Fix clippy warning + cargo fmt 2026-03-07 10:44:38 +01:00
.gitignore fix: add .gitignore, remove committed target/ 2026-03-18 21:04:26 +01:00
Cargo.lock chore: Remove unused serde/serde_json dependencies 2026-03-07 09:55:16 +01:00
Cargo.toml chore: bump version to 0.16.2 2026-03-18 21:04:10 +01:00
LICENSE feat: Initial WASM SDK scaffolding (Mission I159) 2026-03-06 22:15:21 +01:00
README.md feat: Initial WASM SDK scaffolding (Mission I159) 2026-03-06 22:15:21 +01:00

IXT WASM Module SDK

Ergonomic SDK for building WASM modules that run in the IXT runtime.

Quick Start

#![no_std]
use ixt_sdk_wasm::prelude::*;

struct Echo;

impl Default for Echo {
    fn default() -> Self { Self }
}

impl WasmModule for Echo {
    fn handle(&mut self, payload: &[u8], _ctx: &MsgContext) -> HandleResult {
        HandleResult::reply(payload)
    }
}

ixt_wasm_module!(Echo);

Build: cargo build --target wasm32-unknown-unknown --release

The resulting .wasm file goes into your module bundle at bin/wasm/any/module.wasm.

What the SDK Does For You

Concern Without SDK With SDK
Memory allocation Manual ixt_alloc/ixt_free in every module Provided by SDK
Panic handling Manual #[panic_handler] in every module Provided by SDK
Host functions Raw extern "C" with i32 pointers Safe host::send(), host::kv_get_str(), etc.
ABI exports Manual #[no_mangle] pub unsafe extern "C" fn ixt_wasm_module!(MyModule)
Message context Not available ctx.topic(), ctx.sender()

Host Functions

// MessageBus
host::send("topic", payload)?;
let response = host::request("topic", payload)?;

// KV Store
host::kv_set_str("key", "value")?;
let val = host::kv_get_str("key")?;
host::kv_del("key")?;

// Events
host::subscribe("events.*")?;
host::publish("events.my-event", payload)?;

// Logging
host::log_info("hello");
host::log_error("something went wrong");

// Assets
let path = host::resolve_asset("data/model.bin")?;

License

MIT