Experimental

Go → C11

An exploratory compiler from Go to portable C11: readable output that any C11 compiler can build, and that sits next to C without cgo.

1983 / 2018upstream Go tests passing ($GOROOT/test, excluding skips)
generics, reflecttype parameters, range-over-func, reflect.Call, MakeFunc, Select
stdlib from sourcefmt, time, sync, os, errors, log, …

What it does

Why C

Try it

go install github.com/quaadgras/gd-compiler@latest
cd your/go/package
gd-compiler build
gd-compiler test

The output needs a garbage collector: link with Boehm GC, or build with a C compiler that has one, such as Fil-C. Set the compiler with GD_CC.

Status

Experimental. Conformance is measured against Go's own test suite on every change; the remaining failures are mostly runtime internals and gc-specific behaviour.