Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Functional Leap of Faith

Tomer Gabel
September 06, 2014

Functional Leap of Faith

Keynote talk given at JDay Lviv 2014 in Ukraine (http://www.jday.com.ua/)

Some say that there's nothing new under the sun. However, looking back on five to six decades of computing, it's easy to see that things progress at their own leisurely pace. Structured programming, originating in the '60s, did not gain mainstream adoption until the '80s; object-oriented programming was hotly debated in the '70s and '80s but only gained widespread acceptance in the '90s. Every couple of decades sees an engineering leap that radically improves the software engineering discipline across the board.

I believe we are now at such an inflection point, with functional programming concepts slowly sifting into the mainstream. After this talk, I hope you will too.

Tomer Gabel

September 06, 2014
Tweet

More Decks by Tomer Gabel

Other Decks in Programming

Transcript

  1. Through the Looking Glass 20 years ago… •  C/C++ rule

    the market [1] •  First release of Java [1]  TIOBE  Index  (historical  data)  
  2. … since then?* •  C and Java are neck-and-neck • 

    Virtual machines are everywhere •  Garbage collection is everywhere •  OOP is everywhere *  Not  exhaus<ve  
  3. Garbage Collection 1960 Formalized[1] 1970s Research 1994 JVM 2014 Everywhere!

    [1]  Recursive  Func<ons  of  Symbolic  Expressions  and  Their  Computa<on  by  Machine,  Part  I  
  4. Market Growth[1] 0 500 1000 1500 2000 2500 3000 1975

    1980 1985 1990 1995 2000 2005 2010 2015* 2020* Units (Millions) [1]  eTForecasts  Worldwide  PC  Market  Research  Report  
  5. 0 500 1000 1500 2000 2500 3000 1975 1980 1985

    1990 1995 2000 2005 2010 2015* 2020* Units (Millions) Market Growth •  Structured Programming •  Module Systems •  Dynamic Memory Allocation
  6. 0 500 1000 1500 2000 2500 3000 1975 1980 1985

    1990 1995 2000 2005 2010 2015* 2020* Units (Millions) Market Growth •  Garbage Collection •  OOP •  VMs and JIT
  7. 0 500 1000 1500 2000 2500 3000 1975 1980 1985

    1990 1995 2000 2005 2010 2015* 2020* Units (Millions) Market Growth You are here!
  8. The Market has Shifted •  SaaS is the norm • 

    Shorter time to market •  Latency requirements are stricter •  Availability is business-critical
  9. The Free Lunch is Over[1] [1]  The  Free  Lunch  is

     Over,  Herb  StuOer  (Dr.  Dobb's  Journal,  2005)   •  CPUs aren’t getting (much) faster •  Rather, they’re getting parallel •  Concurrency is the new kid on the block
  10. Datasets are Getting Bigger •  Terabyte-scale data is common • 

    Computation demand –  NoSQL –  Big Data •  Specialized hardware (SAN) is a hindrance
  11. Complexity is the Mind Killer •  Complex system è bigger

    codebase •  More code è more bugs •  We want less code •  We want correct code
  12. Control flow describes the how List<Person>  adults(List<Person>  in)  {  

         ArrayList<Person>  out  =  new  ArrayList<>();        for  (Person  p  :  in)          if  (p.getAge()  >=  18)                out.add(p);        return  out;   }  
  13. Data flow describes the what List<Person>  adults(List<Person>  in)  {  

       return  in.stream()                        .filter(p  -­‐>  p.age  >=  18)                        .collect(Collectors.toList());   }  
  14. “What” is Better •  Focuses on the problem •  Reduces

    accidental complexity •  Decouples intent from execution
  15. Distribution 101 1.  Take a core computation 2.  Split it

    out 3.  Run on many nodes 4.  Profit
  16. Why is this hard? •  Behavior-as-data •  Side effects • 

    High-performance frameworks è Lambdas è Immutability è Akka, Hadoop, Storm…