I have been hearing about functional programming these days.
In an article titled “Can Your Programming Language Do This?” Joel discusses about the MapReduce algorithm which makes Google so massively scalable.
According to Google,
MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key. Many real world tasks are expressible in this model, as shown in the paper.
Programs written in this functional style are automatically parallelized and executed on a large cluster of commodity machines. The run-time system takes care of the details of partitioning the input data, scheduling the program’s execution across a set of machines, handling machine failures, and managing the required inter-machine communication. This allows programmers without any experience with parallel and distributed systems to easily utilize the resources of a large distributed system.
Our implementation of MapReduce runs on a large cluster of commodity machines and is highly scalable: a typical MapReduce computation processes many terabytes of data on thousands of machines. Programmers find the system easy to use: hundreds of MapReduce programs have been implemented and upwards of one thousand MapReduce jobs are executed on Google’s clusters every day.
But MapReduce can be implemented only using Functional Programming languages. Did I say “only”?? But how they implemented MapReduce in Google using C++?
Without understanding functional programming, you can’t invent MapReduce, the algorithm that makes Google so massively scalable. The terms Map and Reduce come from Lisp and functional programming. MapReduce is, in retrospect, obvious to anyone who remembers from their 6.001-equivalent programming class that purely functional programs have no side effects and are thus trivially parallelizable. The very fact that Google invented MapReduce, and Microsoft didn’t, says something about why Microsoft is still playing catch up trying to get basic search features to work, while Google has moved on to the next problem: building Skynet^H^H^H^H^H^H the world’s largest massively parallel supercomputer. I don’t think Microsoft completely understands just how far behind they are on that wave.
The moral of the story is that there is a lot of interest towards functional programming. Many functional programming languages are getting attention. Some popular languages are Erlang, Microsoft F#, Haskell.
But the real hero among these languages is Lisp. Lisp is a programmable programming language which can support functional and object oriented programming. Read The Truth About Lisp by Secret Geek and Why Isn’t Everyone Using Lisp? by Peter.