Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Marmot, an alternative Go compiler

Marmot is a novel Go compiler that utilizes MLIR and LLVM. To use Marmot, simply replace the compiler in your existing Go code and go.mod without any code modifications. The benefits include smaller, faster native binaries and more informative error messages. Currently, Marmot is experimental and primarily designed for testing and development purposes, as it has not yet been optimized for production use.

Marmot successfully compiles real Go programs, including its own source code, and validates the results against the official Go compiler. The compiler has been tested on an Apple M3 Pro processor to ensure optimal performance. Marmot's error messages are designed to be user-friendly, highlighting the source code, pinpointing the exact location of the issue, providing contextual information, and offering actionable fixes.

Error messages from Marmot appear as plain lines in the terminal, similar to those generated by the go tool. However, when integrated with a coding agent, the messages are presented in JSON format, including the spans, surrounding code, and suggested edits for corrections. Each error is assigned a consistent code, making it easier to track and resolve issues.

Marmot operates similarly to the standard go command and leverages the majority of the Go toolchain, including the type checker, SSA builder, and the Go standard library, with the exception of the code generation components.

The compiler's unique approach involves converting Go programs into a small dialect that is represented in MLIR, allowing for various optimizations such as eliminating bounds checks, managing objects on the stack, and enabling direct calls to interface methods. This innovative process enhances the overall performance and efficiency of Go programs while maintaining their functionality.

Rewritten by urgent.news; may contain errors — check the original.

Source: marmot.gaurav.zip

Read the original at marmot.gaurav.zip →

Report a problem with this story

More in Tech

More from Friday, 27 November 2026 →