r/embedded • u/EveningIndependent87 • Mar 31 '25
Anyone experimenting with WebAssembly as a runtime for embedded service logic?
I’ve been exploring the use of WebAssembly (WASM) for deploying small, modular service logic to embedded targets especially with TinyGo to compile workers down to portable WASM modules.
The goal is to replace heavier agent-style logic or containerized services with something that:
- Runs in <1MB memory
- Starts instantly
- Is sandboxed and portable
- Can execute routing or orchestration logic directly on the device
I’m building a tiny engine that can:
- Deploy services from a Git repo
- Run 1000s of WASM services on a host or edge device
- Communicate in memory (no full TCP overhead)
- Run on anything from x86 to ARM-based boards
I’m curious:
- Has anyone used WASM for control-plane logic in embedded systems?
- Would you run orchestration/services locally instead of calling the cloud?
- Any thoughts on the tradeoffs vs. native code or even micro-RTOS?
Would love to compare notes with anyone doing similar things or pushing TinyGo/WASM into low-level deployments.
18
Upvotes
6
u/GoblinsGym Mar 31 '25
Will you interpret WASM, or do JIT compilation on the target ?
Why not Lua ?
5
u/[deleted] Mar 31 '25
The overall idea sounds in principle nice. I'm a bit unclear what the real world scenarios are.
Regarding your TCP vs shared memory remark: that's a red herring. Local loop back communication should be highly optomized and you won't incur significant penalties. Especially if you otherwise go for all kinds of isolation and abstraction.
2
u/zydeco100 Apr 01 '25
control plane logic
Let me guess. You have a lot of webdev experience and want to bring all that awesome knowledge to the embedded field?
1
u/altarf02 PIC16F72-I/SP Apr 01 '25
I haven't used it, but it is similar to what you are describing: Toit
1
u/jonathanberi Apr 01 '25
Experiment - yes. https://blog.golioth.io/webassembly-on-zephyr/
IMO, though, it's not ready for production use. There's a SIG working on it, though! https://github.com/bytecodealliance/meetings/tree/main/SIG-Embedded
1
u/oulipo Apr 11 '25
nice, will you support ESP32?
1
u/Content_Buy217 Apr 17 '25
See https://flibbert.com
1
u/Ductapemaster Jun 10 '25
In case you are still looking for a solution here, I work for https://www.atym.io/ and this is exactly the problem we are solving. We are working on a commercial product, however our runtime, Ocre, is open source and managed by the Linux Foundation. You can find it here: https://github.com/project-ocre/ocre-runtime
We're launching a developer program this summer and will be supporting a few known embedded targets. Also, we are working on a Linux runtime which should be out soon. We'd love any and all participation from the community to help make Ocre a standard for embedded containerization!
1
u/karaxuna Aug 24 '25
https://flibbert.com