Marmot:基于 MLIR 和 LLVM 的实验性 Go 编译器
Marmot 是一款基于 MLIR 和 LLVM 构建的新型 Go 编译器,无需修改现有 Go 代码和 go.mod 即可生成原生二进制文件,并给出标注源码位置、附带修复建议的错误信息。项目方称它能编译包括自身在内的真实 Go 程序,并用 Go 对照校验测试程序,但尚未达到生产可用状态。其在 Apple M3 Pro 上的自测数据称 release 二进制体积小于 go build,45 个程序的运行时间几何平均快 1.54 倍,构建也更快;MLIR 中的 Go dialect 让语义保留得足够久,从而移除边界检查、把对象留在栈上。工具链还提供类似 go 的子命令(build、run、test、check、fix、fmt、watch、repl 等)以及 MCP 服务,让编码智能体可以直接构建、运行、测试和修复代码。
项目方给出的体积与构建速度数据明显优于标准 Go 工具链,且诊断信息与 MCP 服务直接面向编码智能体场景,对使用 AI 智能体开发 Go 项目的团队有参考价值。需注意所有性能与能力数字均来自项目方自测,尚无独立验证。
Go, lowered to machine code
marmot is a Go compiler built on MLIR and LLVM. Keep your Go code and your go.mod, switch the compiler, and get small, fast native binaries and errors that show you the fix.
Experimental: marmot compiles real Go programs, including itself, and checks every test program against Go, but it is not ready for production.
- Go