Functional Programming — Crossing The Chasm?
Journal of Object Technology
Once again the computing community is coming to appreciate the expressive power of functional programming (FP) [1, 2] . Technical gatherings are buzzing with talk and, of course, debates about Haskell, Lisp/Scheme, Erlang and their younger hybrid cousins O'Caml, Scala, F# and Clojure. At the same time, popular OO languages Java and C# are being extended to support functional constructs with even C++ adding lexical closures. Why would even state full sinners stray away from their much loved
... t-oriented languages? The answers, of course, are multi-core parallelism and massive cloud databases. Parallelism is plagued by shared state, hence pure functional programming and immutability promise increased concurrency. First class functions support popular idioms such as map reduce, which allow the program to be "sent" to the data and evaluated there as opposed to "sending" all of the data to the function for evaluation. Map Reduce [Google, Hadoop] provides a simple expression of data parallelism which elegantly hides the complexity of the data distribution and parallel execution. Increasingly, business and science are relying on massive data sets and smart algorithms as a means for information and even for discovery. Complex data queries can be concisely expressed using functional combinators and higher order functions. Haskell machinery underpins MS LINQ extensions for C# and VB, enabling unified access to relational and non-relational data sources. It also enables more expressive query languages such as Q, which extends SQL via functions to be a computationally complete language. Lazy evaluation enables the elegant expression of programs that compute over infinite streams of data using only a small sliding window of computation. It also provides a mechanism for deferring unnecessary computations. Complex Event Processing systems are increasingly turning to streaming SQL dialects to be able to express the queries needed for processing web and packet logs, RFID streams and financial market feeds.