Thursday, August 18, 2011

Go perk

Preferring to read than to listen or watch, I don't often sit through hour-long tech-talk videos, but several months ago I happened upon this one given by Rob Pike, and it captured my attention.

The lecture is about Newsqueak, a language Rob invented in the 80s, and its channels feature. Though I don't know Newsqueak, I know about channels because they're a part of another one of Rob's languages: Go.

Go is qualitatively different from all other traditional languages I know, such as C and Python. Most of this difference stems from channels and how they change the way I implement concurrency. In short, I have yet to use any conventional synchronizations objects, such as mutexes, in a Go program. As the Go documentation says:

Don't communicate by sharing memory; share memory by communicating.

The lecture linked to above explains what this means and how it works. In most cases, it's more elegant than what we write in traditional languages. It's also a fun way to look at an old problem.

No comments: