Skip to content

Commit 1b52249

Browse files
committed
docs: explain that modules can be developed using TinyGo, Rust, or Zig
Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent 990fbb5 commit 1b52249

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ Mechanoid is a framework for WebAssembly applications on embedded systems and Io
66

77
Mechanoid is an open source framework for building and running WebAssembly applications on small embedded systems and tiny IoT devices. It is intended to make it easier to create applications that are secure and extendable, and take advantage of all of the latest developments in both WebAssembly and embedded development.
88

9-
Mechanoid includes a command line interface tool that helps you create, test, and run applications on either simulators or actual hardware, in part thanks to being written using [Go](https://go.dev/) and [TinyGo](https://tinygo.org/).
9+
Mechanoid includes a command line interface tool that helps you create, test, and run applications on either simulators or actual hardware.
1010

11-
## Why would you want to do this?
11+
You can write WASM modules for Mechanoid using any language that can compile to WebAssembly, including [TinyGo](https://tinygo.org/), [Rust](https://www.rust-lang.org/), and [Zig](https://ziglang.org/).
1212

13-
- Devices that are extensible. Think app stores, downloadable add-ons, or end-user programmability.
14-
- Environment is sandboxed, so bricking the device is less likely.
15-
- Code you write being compiled to WASM is very compact.
16-
- Devices that need a reliable way to update them.
17-
- OTA updates via slow/high latency are more viable.
18-
- Specific APIs can be provided by the host application to guest modules, so application-specific code matches the kind of code you are trying to write. Games, industrial control systems.
19-
- Develop code in Go/Rust/Zig or any language that can compile to WASM, and run it on the same hardware, using the same APIs.
13+
Mechanoid itself is written using [Go](https://go.dev/) and [TinyGo](https://tinygo.org/).
14+
15+
## Why run WebAssembly on embedded devices?
16+
17+
- Hardware devices that are extensible. Think app stores, downloadable add-ons, or end-user programming.
18+
- WASM runtime environment is sandboxed for better device security.
19+
- All devices need updates. By only updating the WASM code "bricking" the device is less likely. Also WASM code is compact, so is well suited for slow/high latency connections.
20+
- Device code that is portable. Develop code in Go/Rust/Zig or any language that can compile to WASM.
21+
- Application specific APIs for hardware. From games, to industrial control systems.
2022

2123
## Getting started
2224

@@ -34,7 +36,8 @@ Mechanoid includes a command line interface tool that helps you create, test, an
3436
mecha new example.com/myproject
3537
```
3638

37-
- Make something amazing!
39+
- Make something amazing! Take a look at our examples repo at <https://github.com/hybridgroup/mechanoid-examples>
40+
3841

3942
## Example
4043

@@ -74,8 +77,6 @@ mecha new module -template=ping ping
7477
This is the Go code for the `ping.wasm` module. It exports a `ping` function, that calls a function `pong` that has been imported from the host application.
7578

7679
```go
77-
//go:build tinygo
78-
7980
package main
8081
8182
//go:wasmimport hosted pong
@@ -98,6 +99,10 @@ Building module ping
9899
9 0 0 | 9 0
99100
```
100101

102+
Want to see the same `ping` module but written in Rust? See our examples repo here <https://github.com/hybridgroup/mechanoid-examples/tree/main/filestore/modules/pingrs>
103+
104+
Want to see the same `ping` module but written in Zig? See our examples repo here <https://github.com/hybridgroup/mechanoid-examples/tree/main/filestore/modules/pingzig>
105+
101106
### Mechanoid host application
102107

103108
This is the Go code for the Mechanoid host application that runs directly on the hardware. It loads the `ping.wasm` WebAssembly module and then runs it by calling the module's `Ping()` function. That `Ping()` function will then call the host's exported `Pong()` function:

0 commit comments

Comments
 (0)