WASM Apps
Wendy Lite firmware variants with WASM support can run Swift, Rust, C/C++, AssemblyScript, or WAT guests as a smaller, portable, sandboxed alternative to native ESP-IDF apps. Guest
WASM Apps
Wendy Lite firmware variants with WASM support can run Swift, Rust, C/C++, AssemblyScript, or WAT guests as a smaller, portable, sandboxed alternative to native ESP-IDF apps. Guests call into hardware and platform features through Wendy's host-imported APIs — see host-api.md for the full function reference.
Optional WASM Guest Languages
| Language | Entry point | Library |
|---|---|---|
| Swift | @main on WendyLiteApp | SwiftPM: WendyLite (this repo) |
| Rust | #[no_mangle] pub extern "C" fn _start() | Cargo: wendy-lite (this repo) |
| C / C++ | void _start(void) | Include Sources/CWendyLite/include/wendy.h |
| AssemblyScript | export function _start() | @external("wendy", ...) declarations |
| WAT | (export "_start" ...) | Direct import from "wendy" module |
Building and Running WASM Apps
For Swift projects, wendy run builds the package for wasm32-unknown-wasip1, uploads the .wasm application, and attaches to its console. For other guest languages, or to embed a .wasm app directly into a firmware build, see Manually Embedding a WASM App below.
Manually Embedding a WASM App
For low-level firmware development, a WASM guest can still be embedded directly:
- Build your app to
.wasm. - Convert the binary to a C header array:
./wasm_apps/wasm2header.sh my_app.wasm main/demo_wasm.h - Rebuild the firmware:
idf.py build - Flash:
idf.py flash
See host-api.md for the full function reference, swift-sdk.md for Swift-specific internals, stdio.md for console I/O, native-apps.md for the native app build-to-device flow, and wendy-com.md for the WendyCom protocol reference.
Swift SDK Internals
The WendyLite SwiftPM library is an Embedded Swift target compiled to wasm32-unknown-wasip1. This document covers how the async runtime, entry point protocol, timers, and callback
WendyCom Protocol
WendyCom is a lightweight request-response protocol used to control Wendy Lite devices. It runs over two transports: USB (via the ESP32 USB Serial JTAG peripheral) and mTLS (over t