You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,19 @@ Mechanoid is a framework for WebAssembly applications on embedded systems and Io
6
6
7
7
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.
8
8
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.
10
10
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/).
12
12
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.
20
22
21
23
## Getting started
22
24
@@ -34,7 +36,8 @@ Mechanoid includes a command line interface tool that helps you create, test, an
34
36
mecha new example.com/myproject
35
37
```
36
38
37
-
- Make something amazing!
39
+
- Make something amazing! Take a look at our examples repo at <https://github.com/hybridgroup/mechanoid-examples>
40
+
38
41
39
42
## Example
40
43
@@ -74,8 +77,6 @@ mecha new module -template=ping ping
74
77
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.
75
78
76
79
```go
77
-
//go:build tinygo
78
-
79
80
package main
80
81
81
82
//go:wasmimport hosted pong
@@ -98,6 +99,10 @@ Building module ping
98
99
9 0 0 | 9 0
99
100
```
100
101
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
+
101
106
### Mechanoid host application
102
107
103
108
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