Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building MountX: A Self-Hosted Dynamic Language Compiling to C99

Description and use

MountX is a self-hosted dynamic language that compiles to pure C99, achieving 5–20× speedups over Python and passing 343 regression tests.

Problem

How to build a self-hosted dynamic language that achieves native performance without external runtimes.

Outcome

MountX achieves 5x–20x speedups over Python, passes 343 regression tests, and runs as a standalone binary with only libc and SQLite3 as dependencies.

Workflow

  • 1. Write a reference implementation in Python (host/).
  • 2. Rewrite lexer, parser, and interpreter in MountX (gate1/).
  • 3. Translate the MountX interpreter to C99 and add a lightweight runtime substrate (gate2/g1/).
  • 4. Compile the emitted C with GCC to produce a native binary.
  • 5. Run regression tests (host/fbtest.mx) to verify correctness and performance.

Evidence

Over the past months, I built and verified MountX— a dynamically-typed scripting language with a self-hosted tree-walking interpreter that emits pure, standard C99.

Source

The project is fully open-source, passes a comprehensive 343-check regression suite, and runs between 5x and 20x faster than standard Python.

Source

MountX didn’t start in C. It followed a structured bootstrap pipeline: 1. Python Oracle (host/). 2. Self-Hosted Frontend (gate1/). 3. C99 Emitter & Substrate (gate2/g1/). 4. Native Executable.

Source

The runtime is continuously tested against a strict regression suite (host/fbtest.mx) spanning 343 assertions: Covers built-ins, collections, math, regex, exception handling (setjmp/longjmp), TCP networking, and SQLite queries. The native binary passes 100% of all 343 checks cleanly.

Source

  • Record date: 2026-10-13T19:40:54.293Z