Search This Blog

Sunday, June 23, 2013

Functional Programming invades the Mainstream

Kewl-kids in love with their favorite language will often bring up how wonderful is some non-trivial app written in their language.

Kewl, Kewt, Ardent… And the producer of yawns…

So sometimes it is good to invert the perspective and ask about cross-fertilization:  What ideas/features of these fashionable languages are becoming compelling enough to enter the mainstream?

This post is about how the boring mainstream is giving in – feature-by-feature – to Functional Programming
  • Almost every modern language supports garbage collection. Origin Lisp
  • From that followed the fact that any value not just scalars can be first-class.
  • As widely disparate systems as Python, R, Groovy, VBA, Mathematica share a common idea – using the interpreter interactively as an exploratory tool. Started with Lisp's REPL.
  • Comprehensions and lambdas have come into Python. From where? Haskell 
  • Lambda has even got into C++ !!
  • Unpacking assignment in python – pattern matching
  • LINQ in C# – inspired by comprehensions  
  • Generics were not there in C# and Java early editions.  Now they've been retrofitted – origin ML
  • Hottest DBMSes today are the NoSQL ones – a number of these, eg couchdb, simpledb, riak etc are written in Erlang 
  • Numpy is just APL with Python syntax
  • XML? Lisp called it S-expression 40 years before XML
  • Git cherry-pick inspired by darcs – Haskell
  • A modern trend is to avoid APIs and frameworks in place of DSLs.  Started with Lisp combining the data-universality of s-exprs with the code-universality of turing-complete macros on a malleable foundation of homoiconicity
  • Knuth – Vol 1 is a gigantic exercise on how to do lisp without lisp – also called Greenspun's 10th law
  • And heard of google? Uses something called map-reduce. Map comes from Lisp, Reduce from APL

No comments:

Post a Comment