← Sun, Nov 29 digest

Marmot, an Alternative Go Compiler

read article ↗ hn thread ↗

Marmot is an experimental alternative Go compiler built on MLIR and LLVM that replaces Go's code generator to deliver smaller binaries, vectorization, and richer error messages.

summary is enough The project page outlines an interesting use of MLIR/LLVM for Go, but the rapid AI-generated development and early stage make skimming the claims and comments sufficient.

summary

Marmot is an experimental Go compiler that preserves Go's front end while swapping code generation for MLIR and LLVM. It aims to improve loop vectorization, reduce binary sizes, and provide actionable error messages with JSON outputs for coding agents. However, commenters are deeply skeptical of its AI-assisted pedigree, questioning the maturity of its custom runtime and garbage collection compared to established alternatives.

key points

  1. Marmot integrates Go with MLIR and LLVM, enabling optimizations like loop vectorization and bounds-check elimination.
  2. Initial benchmarks claim faster execution on certain test programs and significantly smaller binary sizes compared to standard Go builds.
  3. Commenters scrutinize the project's rapid, AI-driven development velocity and question the reliability of its custom runtime and concurrency primitives.

who should read it

Go developers and compiler engineers interested in alternative backends and LLVM integration.

discussion skeptical

consensus

Commenters are fascinated by the LLVM/MLIR approach but heavily skeptical of the project's stability and design maturity due to signs of rapid, AI-generated development.

pushback

A minority notes that compiler output is deterministic and testable, and the project even helped unearth a legitimate bug in the upstream Go compiler.

best comment by YuechenLi ↗

Ok, the issue with alternative compiler isn't that individual features fail but when multiple features interact with each other in combination and fail or randomly gets really slow, and this only has fairly trivial benchmarks currently.

The bigger issue is that Marmot implements it's own Go runtime as well, including GC, channels, and goroutine scheduler, and you can immediately see from their own benchmark that Marmot's performance falling off a cliff whenever there is allocation pressure. And an alternative Go with a bad GC and concurrency primitive isn't really worth using since that's …

It highlights that an alternative Go compiler with a weak garbage collector and concurrency runtime undermines Go's core value proposition.

Generated by an LLM from the article and thread. Check the sources before relying on it.