A compiler small enough to read, written in itself.
翻译准备中
取自仓库 README
正在加载完整 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.查看完整 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.