Skip to main content


Showing posts from December, 2013

Making a Piña Colada in Haskell: It's All About Concurrency

I was reading The Pragmatic Programmer this morning, and it got me to thinking about Haskell.Consider the following "function" for creating a piña colada:Open blenderOpen piña colada mixPut mix in blenderMeasure 1/2 cup white rumPour in rumAdd 2 cups of iceClose blenderLiquefy for 2 minutesOpen blenderGet glassesGet pink umbrellasServeIt's very easy to understand and very linear.Now consider the following diagram that conveys which parts can be done concurrently: This description of the recipe is quite a bit more complex, but it's a lot more obvious which things can be done concurrently.There are a lot of approaches to concurrency. For years, we've relied on our CPUs to give us some implicit concurrency. The CPU can look at the code at a very micro level and figure out which assembly instructions can be done concurrently because they're working with different parts of memory, etc.Threads and processes also provide concurrency, but they're at a very differe…

Books: The Soul of a New Machine

I just finished The Soul of a New Machine by John Tracy Kidder. In short, I loved it!Computers have changed since 1981, when Tracy Kidder memorably recorded the drama, comedy, and excitement of one companys efforts to bring a new microcomputer to market. What has not changed is the feverish pace of the high-tech industry, the go-for-broke approach to business that has caused so many computer companies to win big (or go belly up), and the cult of pursuing mind-bending technological innovations. The Soul of a New Machine is an essential chapter in the history of the machine that revolutionized the world in the twentieth century.This is an oldie, but a goodie. It even won the Pulitzer prize. The whole drama is still very relevant today. It reminded me a lot of Hackers: Heroes of the Computer Revolution and Steve Jobs' biography. It definitely had elements of both, so if you enjoyed those, you'll definitely enjoy this one.