1 / 49

F A L L and R I S E

The. F A L L and R I S E. of FP. Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL. Motivation for this talk:. FP is a well respected programming paradigm. Almost four decade old. Why FP languages are not of widespread use today?

haruko
Download Presentation

F A L L and R I S E

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The FALLandRISE of FP Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL

  2. Motivation for this talk: • FP is a well respected programming paradigm. • Almost four decade old. • Why FP languages are not of widespread use today? • Understanding the past one can find a better way for the future!

  3. Title Inspired by: • The Fall and Rise of R.I.Perrin. • BBC comic series. • Aired from 1976/79 Leonard Rossiter as R.I.P

  4. 1960: The Birth of a New ParadigmLISP - John McCarthy • Theorem prover • Formal differentiation and integration. • Symbolic engineering calculations. • Programming the Advice Taker.

  5. 1960: The Birth of a New ParadigmLISP - John McCarthy • First programming language to implement the -Calculus. • Programming with functions. • Lists as primitive types. • Garbage Collection.

  6. From 1960 to 1978:The LISP eraWhat is a functional language? • Programming with functions. • Lists as primitive data type. • Garbage Collection.

  7. The LISP era: • LISP was born pure. • To make LISP faster and more acceptable for users: imperative features were added. • This became a trend followed by other FP languages.

  8. From 1960 to 1978 -The LISP eraOther Functional Languages: • APL - Iverson (1962) • ISWIM - Landin (1966) • PAL - Evans (1968) • McG - Burge (1968) • Gedanken - Reynold (1969)

  9. Stachey’s Seven Questions: • What are DLs? • What is their relationship to imperative languages? • Why do we need DLs? • How can we use them to program? • How can we implement them? • How can we do this efficiently? • Should we mix DLs with imperative languages?

  10. From 1960 to 1978 -Signs of a New EraSASL - Turner 1976: • Based on PAL - Evans (1968) • No imperatives. • Referential transparency. • Nicer syntax. • Lazy semantics!!!

  11. FP time line: The LISP era General Interest on FP The LISP era time 1960 1978

  12. Meanwhile, the world... • Cold war increased (1980s). • Star war programme. • Need for Software reliability. • Backus Turing lecture (1978). • Massive investments in functional programming and formal methods.

  13. FP time line: the FP boom General Interest on FP The FP boom The LISP era time 1960 1978 1989

  14. From 1978 to 1987:The FP BoomWhat is a functional language? • Higher-order functions. • Lazy evaluation. • Referential transparency (pure) • Garbage Collection.

  15. From 1978 to 1987:The FP Boom Promises • Higher level of abstraction and semantic elegance (Higher-order functions and lazy evaluation) • Easier to write than their imperative counterparts • Easier to read (compact notation)

  16. From 1978 to 1987:The FP Boom Promises • Easier to prove correct (-Calculus) • Easier to go parallel: (referential transparency) • Executable specifications

  17. Meanwhile, the world... • End of the Cold War (1989). • SW reliability did not matter! • New name of the game: efficiency • Projects had to become products within 6 months!!!

  18. FP: The Fall • Low performance figures: “A minor detail”. • Parallelism is the way out! • The world is functional: imperative programmers are blindly wrong!

  19. FP: The Fall • The purity of the paradigm: no compromising to meet users’ needs. • Let the mountain come to Mohammed!

  20. FP: The Fall • Higher-order function and lazy evaluation=> Inefficient sequential code • Unable to cope with Input/Output • Function composition make programs intricate to read

  21. FP: The Fall • Size of large programs: comparable to the imperative equivalent • Correctness: not easy at all ! • Referential transparency:too fine granularity

  22. The Fall: Parallelism • Evaluation of actual parameters before replacing them. • Combinator argument level. • Problems: -Too fine grained parallelism - Too high level abstract machines

  23. Applicative Language Idealised Computing Engine • 40 transputer-based agents • Pocket pools • Connected by a multi-stage switching network • Performance disappointing • Granularity too fine • Use of small packets

  24. The Fall: Bechmarking • Too small benchmarks: - Inefficiency of the implementations - Limitations of architectures -fibs per second

  25. The Fall: Bechmarking • Parallel:Classicdivide-and-conquer program, a variant on the naive Fibonacci program: nfib n = if n <= 1 then 1 else 1 + nfib(n-1) + nfib(n-2)

  26. FP time line: the Fall General Interest on FP The FP boom The Fall The LISP era time 1960 1978 1989 1993

  27. FP: The Rise DTI workshop (London/93) • Learnedhow to compilefunctional languages in sequential machines. • Need for larger benchmarks. • Monads: easier to express I/O and state.

  28. FP: The Rise DTI workshop (London/93) • “Real-world” applications: • AMACO:oil reservoir • ECRC:chemical pollution • SISAL:numerical computation

  29. The Rise:The G-Machine - Johnsson & Augustson (1987) - Chalmers - Works as an interpreteter with lazy graph generation - First fast implementation for lazy functional languages - Graph generated only if needed

  30. Lazy Graph Generation

  31. The Rise:The G-Machine - Served as the Basis for: • Spineless G-Machine • Spineless Tagless G-Machine • TIM • GM-C

  32. The Rise:Haskell • Developed by a committee: Augustson, Hudak, Hughes, Johnsson, Peyton-Jones, et al. • First widely accepted lazy functional language one had access to source code.

  33. The Rise:Haskell • Glasgow Haskell: • FAST • Robust • Monads: neat I/O

  34. The Rise: Parallelism • 1980’s proved that: • Special purpose Hw is costly and too slow meet the development of general purpose Hw • New parallel machines and languages are based on available parallel architectures.

  35. The Rise: Parallelism • Built on top of efficient sequential compilers. • Tested on large benchmarks and real-world applications.

  36. The Rise:Concurrent Haskell • Suport I/O-performing programs • Implicit, semantically transparent parallelism. • Version available now uses explicit parallelism.

  37. The Rise: GUM • Portable • PVM • Available on shared-memory and distributed-memory • Initial performance figures demonstrate speedups to best sequential compiler technology

  38. The Rise: Pseudoknot • Organised by Pieter Hartel and Martin Alt. • “Real World”problem from molecular chemistry. • Medium-size: several thousands operations performed.

  39. The Rise: Pseudoknot • First benchmark used to compare over 20 different languages and implementations. • First real exercise in cooperation amongst the FP community.

  40. The Rise: Haskell NoFib Suite • Organised by Will Partain • Written in standard Haskell. • Someone trying to get a job done. • Useful tasks!

  41. The Rise: Haskell NoFib Suite • Not too small, not too big. • Able to run on today’s workstations. • Subsets: Real, Imaginary & Spectral

  42. The Rise: New Applications of FP • Erlang (Ericsson) Phone switches • Natural Expert (Software AG) database-oriented environment 20 custumer sites. Factor of ten in productivity

  43. The Rise: Some like it HOT! • Bob Harper called FP Higher-Order and Typed. • Broader reading of terms. • HOT languages: Java, Haskell, ML and Scheme

  44. FP time line: the Rise General Interest on FP The FP boom The Rise The Fall The LISP era time 1960 1978 1989 1993 2000

  45. Conclusions • FP: a lot to offer to software engineering: - Easier to prove programs correct than in any other paradigm - Executable specifications: prototypes for free - Program transformation: Code optimization mechanisms in sequential and parallel architectures

  46. The FALLandRISE of FP Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL

  47. 3rd LatinAmerican Conference on Functional Programming 7 to 9th March 1999 Recife - Brazil together withIFIP WG2.8 Working Meeting

  48. Where is Recife? State: Pernambuco Population: 2.000.000 inh. Historic Cities: Recife - 1600 Olinda - 1535 (Patrimony of mankind UNESCO) Cultural Heritage: Portuguese, African, Native indians, Dutch, Jewish. Recife Rio

More Related