I’ve been learning Go this week, and on Tuesday I attended the London Go Gathering at Google’s London Campus.
As a learning exercise, I decided to port the winning QuantCup competition entry — implementing a fast stock exchange matching engine for a high-frequency trading bot — from C to Go.
You can check out my code here: https://github.com/rdingwall/go-quantcup
I focussed primarily on Go language features and idiomatic style. However, I stayed as true as possible to the memory access and CPU paths in the original implementation, so there are no heap allocations (besides unit tests) and it’s still single-threaded (so cannot take advantage of goroutines or channels).