Threads, Unix, and Rob Pike - a curated reading list



You've gotten a few messages from me by now, so I thought it was time to share some of my sources. I love learning almost as much as I love teaching, so I'm always digging deeper to find out more. Along the way I've realized that no one person has all the answers or can teach a subject fully, there's just too many details. In light of that, it would only be fair for me to share some of the jewels that I've found over the past months, some of which is Ruby-related, some of which is not. Whatever your preference, there's something here for everyone.
Kent Beck provides an excellent case for continued learning for software developers. Starting from a Smalltalk example, he shows how he searches the 'space' of possible solutions. He concludes that more experience means there are more solutions 'within reach'. "The greater my knowledge, the freer I feel."

John Pignata shows a great example of leveraging a UDP feature in Ruby to build a chat system. If you've read Working With TCP Sockets, but were hungry to learn about UDP specifics, here's a great start.
 
...as told by Rob Pike. Whether you realize it or not, UTF-8 and character encodings are central to what we do everyday, especially on the multi-lingual web. This is a fascinating, technical account of how UTF-8 was designed on the back of a napkin :)
 
Duff's device implements an "unrolled version of a loop by interlacing the structures of a switch and a loop". If this mystifies you, read on just to see what's possible (in C). 
 
Different methods of visualizing TCP packets as they cross the network. Plotting things in this way can reveal data points that are otherwise hard to tease out when looking at raw data from something like tcpdump(1).
 
This is a mailing about Unix programming with Ruby from the author of the Unicorn web server. Some of my favourites: System calls in UnixAn introduction to the Unix pipe.

This is a great article on performance testing in general. In wanting to do some load testing for Sprout I came across this and found it ripe with wisdom. Load testing is hard.
 
Rob Pike is a long-time contributor to stuff like Unix and Plan 9 (and one of my programming heroes). He also co-created the Go programming language. This article tells you about his workflow and his ideal setup. The screencast of acme, a text editor he invented, is of particular interest.

The TTY Demystified

This is a fascinating look at the TTY subsystem. This subsystem is central to Unix, but I wasn't even aware of it until I read this article. It gives some perspective on shells, signals, and includes some fun shell commands to really stir things up.
 
Multithreaded Ruby was a hot topic at this year's Rubyconf. Tony Arcieri (author of the excellent Celluloid project) provides some insightful suggestions that would make multithreaded programming in Ruby a whole lot easier.
 
The Art of Unix Programming is a book about the philosophy behind good program design, taking specific examples from the history of Unix. The whole book is a great read to really 'get' the Unix philosophy. If you want a bite-size chunk, this chapter on application protocol design will give you an inside look at protocols that you're certainly dependent upon every day.
 
This is a favourite piece of mine, mostly about Unix history (can you tell that I like that topic?) Besides just history, it also gives you an inside look at some of the early design choices. If you dig around, you'll find out how stderr came to be, as well as an account of the first experience of using Unix pipes. 

Ruby Under a Microscope
Pat Shaugnessy's ebook about MRI internals is a really fun read. Pat's style is really casual, with lots of diagrams to make things easy to understand. I haven't finished this one yet, but I already got a better understanding of Ruby's parser and the internal structure of the Object hierarchy.


Grow Your Unix Beard Using Ruby
My talk from Rubyconf 2012. It covers the the fork + exec pattern: how the Unicorn server uses it for a few of its features, and how it's at the core of process spawning in Ruby.

There and Back Again -or- How I Set out to Benchmark an Algorithm and Ended Up Fixing Ruby
Another one from Rubyconf. Follow Joshua Ballanco as he deep dives into MRI using tools like gdb and libgmalloc.
 
This book is my preferred reference for all things Unix. At 1500+ pages, it's not something to read cover-to-cover, but it's a really complete reference to programming with sockets, threads, processes, and more. Warning: author assumes you're a C programmer.
 
That's all for me. Until next week,
Jesse
http://workingwithcode.com

comments powered by Disqus