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

How I Built a Systems Programming Language in 100% Pure x86-64 Assembly (And Made It Self-Host)

说明与用途

Rubix 是一个完全用 x86‑64 汇编编写的系统语言编译器,体积 55 KB,编译时间 0.15 s,启动时间 0.3 ms,内存占用 <2 MB。它证明了可以在不使用 C、libc 或 LLVM 的情况下构建现代静态类型语言,并实现自托管。

问题

Build a fast, modern, statically typed systems programming language without relying on C, libc, or LLVM, and implement the compiler in pure x86‑64 assembly.

结果

Rubix demonstrates that a modern, statically typed systems language can be built entirely in assembly, achieving a 55 KB compiler, sub‑0.15 s compile time, and sub‑0.3 ms binary start time, while successfully self‑hosting.

工作流

  • 1. Write a 100% pure x86‑64 assembly compiler that links against no libc.
  • 2. Implement OS‑specific syscalls for console I/O, process management, and memory allocation on Linux, Windows, and macOS.
  • 3. Compile Rubix source (.ix) with the assembly compiler to produce native binaries.
  • 4. Build a Rubix‑written bootstrap compiler (rubixc_bootstrap) that parses, type‑checks, and emits assembly.
  • 5. Use the native compiler to compile the bootstrap compiler into a native executable (rubixc_native).
  • 6. Run the native executable to compile Rubix source, verifying that all 17/17 regression tests pass.
  • 7. Publish the project on GitHub and Dev.to to attract contributors.

证据

The entire native compiler binary is ~55 KB

来源

It compiles from source assembly in under 0.15 seconds

来源

Emitted binaries start up in 0.3 ms with less than 2 MB of RAM

来源

All 17/17 core regression test suites pass cleanly

来源

  • 记录日期: 2026-10-19T11:41:03.159Z