Skip to content

IoT Deployment ​

Project Links: GitHub · Cross.toml · rust-toolchain.toml

Overview ​

MaìLang supports devices from 64KB to GBs of memory through three-tier feature gating.

Feature Levels ​

Level 1: no_std (Minimal) ​

  • Memory: 64KB+
  • Devices: ARM Cortex-M0
  • Features: Stack-only values, no heap allocation

Level 2: no_std + alloc (Embedded) ​

  • Memory: 128KB+
  • Devices: RISC-V, ESP32
  • Features: Reference counting, heap allocation

Level 3: std (Standard) ​

  • Memory: 256KB+
  • Devices: Raspberry Pi, servers
  • Features: Full functionality

Cross Compilation ​

bash
# ARM Cortex-M4
cargo build --release --target thumbv7em-none-eabihf

# RISC-V
cargo build --release --target riscv32imc-unknown-none-elf

# Linux ARM (Raspberry Pi)
cargo build --release --target aarch64-unknown-linux-gnu

# WebAssembly
cargo build --release --target wasm32-unknown-unknown

Binary Size Optimization ​

toml
[profile.release]
opt-level = "z"
lto = "fat"
codegen-units = 1
panic = "abort"
strip = "symbols"

Supported Architectures ​

TargetRust TargetMin Memory
ARM Cortex-M0thumbv6m-none-eabi64KB
ARM Cortex-M4thumbv7em-none-eabihf256KB
RISC-Vriscv32imc-unknown-none-elf128KB
ESP32xtensa-esp32-none-elf512KB
WASMwasm32-unknown-unknownN/A
Linux ARMaarch64-unknown-linux-gnu16MB

Real Hardware (GPIO / ADC / delay) ​

SimulatedHal is host-only. To bind scripts to real ESP32-C3 / Cortex-M4 peripherals, see:

  • Real Hardware — build mailang-ffi, wire mailang_register_host_fn to a real HAL, ship .mailangbc
  • ESP32 Blink End-to-End — copy-paste IDF-style C host + expected serial output

Next Steps ​