Marmot, an Alternative Go Compiler marmot.gaurav.zip · 9 points · 0 comments · H...
HN Best 200 @best
Marmot, an Alternative Go Compiler marmot.gaurav.zip · 9 points · 0 comments · HN thread
TL;DR Marmot is an experimental alternative Go compiler built on MLIR and LLVM that keeps Go source and go.mod unchanged while producing smaller, faster native binaries. The project claims it compiles real Go programs, including itself, and matches Go's output on its test programs, but it is not production-ready. The page also bundles its own build, test, fix and error-explanation tooling.
- Built on MLIR and LLVM, with a small go dialect that preserves Go semantics long enough to remove bounds checks and keep objects on the stack.
- Reported on an Apple M3 Pro: hello world with println is 201 KB versus 1.83 MB for go build; with fmt.Println, 698 KB versus 2.43 MB.
- Run time across 45 programs with -release: geometric mean 1.54x faster than Go, faster in 37 and slower in 8.
- Incremental builds of cmd/marmot (325 packages) are faster in the listed cases, e.g. a one-line edit in a deep package takes 0.72 to 0.76 s versus 1.18 to 1.23 s for Go.
- Errors include source spans, labels and fixes applicable via a marmot fix command, with JSON output for coding agents and 44 documented error codes.
- Tooling covers build, run, test, check, fix, fmt, watch, repl, bench, prof, size, generate, explain, doctor and an MCP server for coding agents.
Discussion No comments have been posted yet, so there is no discussion to summarize. The story has 9 points.