Skip to Content
marmot

What a modern compiler toolchain is expected to have, how the best ones do it, and where marmot stands. "Have" means it works today, "partial" means a part works, "missing" means nothing exists. The evidence is from the code at main (cf0e9b27). The ranking at the end is by value to users against cost.

FeatureBest practicemarmotEvidence
Query-based incremental compilationrustc (red-green query graph, salsa), Zig (incremental at declaration level)partialPackage level: a dev build type checks and builds SSA only for packages whose module is not in the MLIR cache, the rest come from cached export data (internal/driver/incremental.go). No reuse below the package.
Fine-grained and remote cacheBazel and Buck2 remote execution, sccache, Go's GOCACHEPROGpartialA local content-addressed object and MLIR cache, every MARMOT_ switch in the key (internal/driver/stamp.go, cache.go). No remote or shared cache.
Parallel compilation at function levelrustc codegen units, LLVM ThinLTO backends, Go per packagehaveLarge packages split into parts of 40000 SSA instructions that generate and compile in parallel (internal/driver/parts.go, MARMOT_PART_INSTRS).
Reproducible and hermetic buildsGo (reproducible by default), Bazel (hermetic)partial-trimpath works, and two cold builds are byte-identical with MARMOT_PART_ORDER=1 (TestReproducibleBuild). Part order is off by default until its perfcmp passes, so default builds are not yet reproducible.
Cross compilation with sysrootsGo (GOOS and GOARCH, no sysroot for pure Go), Zig (bundled libc for every target)have-target, marmot sysroot fetches headers and libraries, -static with musl (cmd/marmot/sysroot.go, internal/driver/crosslink.go).
PGO, instrumentedClang -fprofile-instr-generate, rustc -Cprofile-generatehave--pgo-gen and --pgo with an indexed LLVM profile (internal/driver/driver.go).
PGO, samplingGo default.pgo from pprof (2 to 14% in Go's reports), AutoFDO and BOLTmissingNo pprof or perf profile input.
LTOThinLTO (LLVM), whole-program in Go's linker for dead codehave-release is whole-program optimization (WholeProgram.cpp, thinlink tests).
Sanitizers (address, thread, undefined)Clang and Go -race (ThreadSanitizer), -asan, -msanmissingNo -race and no -fsanitize for Go code (sanitizer flags exist only in cgo flag checks). The runtime has debug modes (poison, gcstress) that find memory errors in the runtime.
FuzzingGo native fuzzing (go test -fuzz, coverage guided), libFuzzer, AFL++partialmarmot test passes flags to the test binary, but there is no coverage instrumentation for -fuzz. tests/fuzz is a compiler fuzzer (differential against gc), not user fuzzing.
Debug info and debuggerDWARF 5 for gdb, lldb and Delve, DAP for editorsmissingA dev build has no .debug sections. A pc table gives tracebacks with file:line (Pcln.cpp). No DWARF variables, no Delve or DAP support.
Language servergopls, rust-analyzer (incremental, salsa)partialmarmot check runs gopls's checks among others. marmot mcp serves the compiler's tools over the Model Context Protocol (cmd/marmot/mcp.go). No LSP server with marmot's own diagnostics, go to definition or rename.
Diagnostics, error recovery and fix-itsRust and Elm diagnostics, Clang fix-itshaveDiagnostics with spans, codes (marmot explain), suggested fixes and marmot fix, JSON Lines output (internal/diag, internal/check/fix.go).
Formatter and lintergofmt, go vet, staticcheck, clippyhavemarmot fmt (gofmt plus goimports) and marmot check (fmt, vet, lint, modernize, vuln, tidy, cross, deadcode).
Stable IR and plugin passesMLIR dialects, LLVM pass pluginspartialThe go MLIR dialect is the IR of -release (--emit mlir), and the loop passes build as an LLVM pass plugin (backend/lib/Loops/Plugin.cpp). The dialect is not versioned or documented as stable. No plugin interface for user passes.
Wasm targetGo wasip1, Rust, Zig, TinyGohave-target wasip1/wasm with goroutines on Asyncify or JSPI, run in the browser playground.
GPU targetMLIR gpu dialect, CUDA, Triton, MojopartialAn NVPTX path in the backend and a GPU runtime (backend/lib/Driver/Gpu.cpp, runtime/core/gpu). Not a user-facing feature yet (SPEC M8 is the plan).
REPL and playgroundSwift REPL, Jupyter kernels, Go playgroundhavemarmot repl, marmot play, and the docs playground that compiles and runs edited programs in the browser with no server.
Self-hostingGo, Rust, Zig compile themselvesin progressSPEC M7. The stage probe of tonight records the state (selfhost.md).

Ranking: top 10 of the missing and partial features

Value is for marmot users (Go developers who want faster and smaller binaries). Cost is rough engineering time.

  1. Debug info and a debugger (missing). Value: high. A compiler people use for real work must let them step through code. DWARF line tables first (cheap: LLVM emits them from locations marmot already has), then variables and Delve or lldb support. Cost: medium for line tables, high for variables and goroutines.
  2. Race detector (missing). Value: high. Go users run go test -race routinely, and marmot's concurrent GC and scheduler make races likely to matter. ThreadSanitizer instrumentation through LLVM plus runtime hooks. Cost: high.
  3. Reproducible builds by default (partial). Value: high for releases, caches and trust. MARMOT_PART_ORDER=1 already gives byte-identical cold builds. It needs its perfcmp to pass, then a flip. Cost: low.
  4. Language server (partial). Value: high for daily use: editors show marmot's own diagnostics (escape, allocation and verify findings) next to gopls. A thin LSP server that reuses marmot check and the diagnostics JSON. Cost: medium.
  5. Native fuzzing in marmot test (partial). Value: medium to high. go test -fuzz needs coverage counters (LLVM SanitizerCoverage) and the testing package's fuzz engine. Cost: medium.
  6. Sampling PGO (missing). Value: medium. Go's PGO guide reports about 2 to 14% from default.pgo. marmot has instrumented PGO, so a pprof to LLVM sample profile converter plus -fprofile-sample-use is the step. Cost: medium.
  7. Shared and remote cache (missing). Value: medium for teams and CI: marmot's cold builds are slower than go's, so a shared cache helps more. A GOCACHEPROG-like protocol over the existing content-addressed cache. Cost: medium.
  8. Finer incremental compilation (partial). Value: medium. Reuse below the package (per function or per part) for one-line edits in large packages. The parts already give a unit. Cost: high.
  9. Address and undefined behavior sanitizers for cgo code (missing). Value: medium for users with C code. Clang's sanitizers on the C side plus runtime support. Cost: medium.
  10. A stable, documented go dialect and a pass plugin interface (partial). Value: medium for research users and tooling. Version the dialect, document it, and load passes as plugins. Cost: medium.

These are not in the list, because marmot has them: function-level parallel compilation, cross compilation, instrumented PGO and LTO. Also diagnostics with fix-its, a formatter and linter, the wasm target, the REPL and the playground. GPU and self-hosting have their own milestones (SPEC M8 and M7).

On this page

Was this page helpful?

Report an issueOpen issues