Measured against C, Go, Zig, Rust and C# on the same machine: 4.1 ms to build this program's own benchmark (--exe, no linker), a 33 KB executable, and a 1.2 MB single-file toolchain with no separate..
Developer toolsMonkey C · M4GitHub @minicompilerOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
A compiler small enough to read, written in itself.
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
A compiler small enough to read, written in itself.
mc compiles a schoolbook-C language — seven types, one opaque pointer, loop and if — for
macOS, Linux and Windows, on arm64 and x86-64. A 2,848-line C23 seed is compiled by clang
exactly once; after that mc compiles its own source, writes and signs (or directly writes) the
executable itself, and reaches a fixed point where one generation is byte-identical to the next.
Everything the core leaves out — while, for, +=, a second backend, a whole object model —
you teach it from ordinary mc source.Read the full README ↗A compiler small enough to read, written in itself.
mc compiles a schoolbook-C language — seven types, one opaque pointer, loop and if — for
macOS, Linux and Windows, on arm64 and x86-64. A 2,848-line C23 seed is compiled by clang
exactly once; after that mc compiles its own source, writes and signs (or directly writes) the
executable itself, and reaches a fixed point where one generation is byte-identical to the next.
Everything the core leaves out — while, for, +=, a second backend, a whole object model —
you teach it from ordinary mc source.
docs/plan.md: the language, the teaching surface, the
architecture, the budget and the milestonesdocs/build.md:
mc build, mc.toml, #include <name>, #embed, Linux and Windows targetsdocs/comparison.md: compile time, binary size and
run time against C, Go, Zig, Rust and C#docs/ci.mdexamples/docs/reference/hooks.md § 8); see docs/plan.md §
"What 1.0.0 promises, and what it does not"make stage0 # clang compiles the C23 seed, once and never again
make mc1 # the seed compiles src/mc.mc into the real compiler
make check # tests, the fixed point, the taught-surface demos, the examples
build/mc1 --exe src/mc.mc -o mc writes the signed, ld-free compiler in one step. Released
binaries are ad-hoc signed and not notarized, so a download needs
xattr -d com.apple.quarantine mc once — see docs/ci.md.