»  Home · About · Posts by Topic

The examples from Tony Hoare's 1978 paper "Communicating sequential processes" in Go

May 9, 2013 ·  Tony Hoare's "Communicating sequential processes" is not only a very influential Computer Science paper, but it was also a main inspiration for Go. It is full of examples written in a pseudo-code designed for the paper. I translated all these examples to Go, with unit tests.

The code is on github as usual. I documented it pretty extensively, and you can read the documentation nicely formatted on godoc.org, so there’s not much left to say here.

The point of this exercise was not to produce something usable in production code, but to fully understand Hoare’s paper. It’s easy to convince yourself you understood something after reading it, but only doing or teaching makes you fully grasp it. It was an enlightening experience, and it’s impressive to see how far ahead of his time Hoare was when writing this. Concurrency became a big topic outside of academia only in the last few years.

This little project was submitted to Hacker News and Reddit (not by me) and attracted some good comments.