I'm struggling to find again a c++ implementation of this I saw on github a while back. Does HN the hive mind remember?
The core of Primitive is open source, written in Go.
https://github.com/fogleman/primitive
Only the UI is closed source. It's written in Objective-C and basically shells out to the Go code.