Skip to content

Commit

Permalink
docs: explain that modules can be developed using TinyGo, Rust, or Zig
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Apr 7, 2024
1 parent 990fbb5 commit f023286
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ Mechanoid is a framework for WebAssembly applications on embedded systems and Io

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.

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/).
Mechanoid includes a command line interface tool that helps you create, test, and run applications on either simulators or actual hardware.

## Why would you want to do this?
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/).

- Devices that are extensible. Think app stores, downloadable add-ons, or end-user programmability.
- Environment is sandboxed, so bricking the device is less likely.
- Code you write being compiled to WASM is very compact.
- Devices that need a reliable way to update them.
- OTA updates via slow/high latency are more viable.
- 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.
- 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.
Mechanoid itself is written using [Go](https://go.dev/) and [TinyGo](https://tinygo.org/).

## Why run WebAssembly on embedded devices?

- Hardware devices that are extensible. Think app stores, downloadable add-ons, or end-user programming.
- WASM runtime environment is sandboxed for better device security.
- 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.
- Device code that is portable. Develop code in Go/Rust/Zig or any language that can compile to WASM.
- Application specific APIs for hardware. From games, to industrial control systems.

## Getting started

Expand Down Expand Up @@ -74,8 +76,6 @@ mecha new module -template=ping ping
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.

```go
//go:build tinygo
package main
//go:wasmimport hosted pong
Expand Down

0 comments on commit f023286

Please sign in to comment.