Solod: A Minimal Subset of Go That Transpiles to C for Embedded Systems
Solod is an open-source project that takes a carefully chosen subset of the Go programming language and transpiles it to C, enabling Go developers to write embedded systems code without needing a full Go runtime. The project addresses a long-standing gap in the Go ecosystem for resource-constrained environments.
The Problem
Go is an excellent systems programming language, but its runtime requirements — garbage collector, goroutine scheduler, and reflection support — make it impractical for many embedded systems where:
- RAM is measured in kilobytes, not gigabytes
- No operating system is available (bare metal)
- Every byte of code space matters
- Deterministic execution is required
How Solod Works
Solod defines a strict subset of Go that:
- Removes runtime dependencies — No garbage collection, no goroutines, no reflection
- Provides C interop — Generated C code can call existing C libraries directly
- Maintains Go syntax — Developers write standard Go code within the supported subset
- Outputs readable C — The transpiled C code is intended to be human-readable and maintainable
Use Cases
- Microcontrollers — Programming ARM Cortex-M and similar MCUs with Go-like syntax
- OS kernels — Writing kernel components without a heavy runtime
- Safety-critical systems — Where Go's memory safety is valued but its GC is not acceptable
- Legacy integration — Adding Go-based modules to existing C codebases
Community Reception
The project has garnered significant interest on Hacker News (148 points), with embedded systems developers particularly enthusiastic about the possibility of using Go's syntax and tooling for bare-metal programming.
Solod represents a growing trend of "Go for everywhere" — extending Go's reach beyond servers and cloud to the most resource-constrained corners of computing.