Back

Mo

An experimental systems programming language and compiler: safe as Rust, simple as Go, no GC.

Notes

Mo is my current language design rabbit hole: an experimental systems programming language with a compiler, runtime, standard library and package model.

The slogan in the docs is almost the whole idea: safe as Rust, simple as Go, no GC.

The compiler is written in Rust and the language is still pre-alpha. The interesting constraint is to keep ownership, moves, borrows and deterministic drops in the language model, but avoid turning normal user code into a lifetime annotation exercise. The ordinary syntax should stay closer to Go than Rust, while the compiler still tracks enough information to make memory safety the default.

The implementation is deliberately guided by a concrete target program: a production-shaped web server. That forces early work on boring but important things:

  • -a backend-independent compiler pipeline with a Mo IR before Cranelift or LLVM,
  • -core, alloc, std and userland package layers,
  • -owned String, borrowed Str, buffers, vectors, maps and boxes,
  • -async functions and first future bridges,
  • -filesystem, networking, threads, time and process APIs,
  • -typed HTTP request/response handling,
  • -a userland Express-like router,
  • -a Pokemon REST server benchmark with runtime memory counters.

Recent Codex work has been less about syntax sketches and more about making the compiler earn its claims: package roots like std/, core/ and lib/, automatic drop behavior, runtime allocation accounting, userland route composition, async TCP futures, and load tests that compile and run real Mo programs.

It is still very far from a language anyone should use, but it has crossed the nice psychological line where examples compile, run, serve HTTP, allocate, free, and get benchmarked as a whole system.

Project on GitHub