Skip to content
vic

mech-lang/mech

🦾 Mech is a programming language for building data-driven systems like robots, games, and interfaces. Start here!

mech-lang/mech.json
{
"createdAt": "2018-08-13T16:54:37Z",
"defaultBranch": "main",
"description": "🦾 Mech is a programming language for building data-driven systems like robots, games, and interfaces. Start here! ",
"fullName": "mech-lang/mech",
"homepage": "http://mech-lang.org",
"language": "Rust",
"name": "mech",
"pushedAt": "2025-11-17T18:37:53Z",
"stargazersCount": 249,
"topics": [
"compiler",
"data-processing",
"embedded",
"game-programming",
"iot",
"live-programming",
"programming-environment",
"programming-language",
"reactive-programming",
"robotics"
],
"updatedAt": "2025-11-19T11:18:30Z",
"url": "https://github.com/mech-lang/mech"
}

Mech Logo

Mech is for building data-driven, reactive systems like robots, games, embedded devices and more.

It simplifies data distribution, transformation, and analysis so you can focus on your project.

The following code implements FizzBuzz in Mech:

The classic FizzBuzz program expressed in Mech: x := 1..=10;~out<[string]>:=x;ix2:=(x % 2) == 0;ix3:=(x % 3) == 0;out[ix2]="✨";out[ix3]="🐝";out[ix2 && ix3]="✨🐝";

See the docs for an extended version that runs live in your browser.

Some notable features of Mech are demonstrated in this short program:

  • Concise Syntax: Expressive and flexible, with no need for keywords or semicolons; Mech programs are generally shorter than in other languages.
  • Broadcast Operations: Vector operations apply elementwise automatically, removing explicit loops and enabling efficient vectorization.
  • Logical Indexing: Vector elements are conditionally selected using broadcast logic operations, enabling declarative iteration and parallel execution.
  • Type Inference: Variable and expression types are inferred, so explicit type declarations are often unnecessary.
  • Immutable: Variables are immutable unless specified, promoting safer code and easier reasoning.
  • Rich Text: Mech programs support rich formatting and literate programming through Mechdown, a Markdown dialect.

Download the precompiled latest release for your platform.

To build Mech from source, you’ll first need to install Rust (make sure to install a recent version on the nightly release channel, currently we are developing against nightly-2025-07-31).

Then follow the instructions below to compile the Mech toolchain, bundled in a single executable called mech:

Terminal window
git clone https://gitlab.com/mech-lang/mech
cd mech
cargo build --bin mech --release

Alternatively, you can install Mech directly via Rust’s Cargo utility:

Terminal window
cargo install mech

New to Mech? Start with Learn Mech in Fifteen Minutes.

Comprehensive documentation is available at docs.mech-lang.org and open-sourced on GitHub.

The Mech community stays active at a few places around the Internet:

Feel free to stop by and introduce yourself — we’re happy to meet new users and answer questions!

Mech v0.2 is currently beta status, meaning most intended features are implemented, but rough edges abound and there is a general lack of documentation. Development is focused on testing and documentation.

A Brief Roadmap:

  • ☑️ v0.1 - proof of concept system - minimum viable language implementation
  • 📍 v0.2 - data specification - formulas, defining and manipulating data
  • ☐ v0.3 - program specification - functions, modules, state machines
  • ☐ v0.4 - system specification - tools, distributed programs, capabilities

For more details, read the ROADMAP.

A new version of Mech is released every week.

Mech should be considered unstable and therefore unfit for use in critical systems until v1.0 is released.

Licensed under Apache 2.0.