Building OctoGo: A Go-like Language Where Goroutines Are Cores
The last few posts here have been about pieces of a toolchain without saying what they were for. egg , the LL(1) parser generator. The flat AST and the ergonomics of walking one when you have decided that allocation is the enemy. And underneath both, ccgo, which turns C into Go. This post is what they were (also) for. OctoGo is a Go-like language for the Parallax Propeller 2. egg generates its parser. Its AST is a flat []int32 . Its backend is a C compiler that ccgo transpiled into the binary you install. And the thing that makes it worth writing about is not any of that plumbing - it is that on this target, a goroutine is not a scheduler entry. It is a core. The target, briefly Most readers will not have met a Propeller 2, so: it is an eight-core microcontroller with no interrupts in the usual sense, no MMU, and no operating system. The cores are called cogs. There are eight of them, they are symmetric, and they run genuinely in parallel. There is 512 KB of shared hub RAM, ea...