Presentation is loading. Please wait.

Presentation is loading. Please wait.

FALL and RISE Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL The of of FP.

Similar presentations


Presentation on theme: "FALL and RISE Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL The of of FP."— Presentation transcript:

1 FALL and RISE Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL The of of FP

2 Motivation for this talk: n FP is a well respected programming paradigm. n Almost four decade old. n Why FP languages are not of widespread use today? n 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 Paradigm LISP - John McCarthy n Theorem prover n Formal differentiation and integration. n Symbolic engineering calculations. n Programming the Advice Taker.

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

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

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

8 From 1960 to The LISP era Other Functional Languages: n APL - Iverson (1962) n ISWIM - Landin (1966) n PAL - Evans (1968) n McG - Burge (1968) n Gedanken - Reynold (1969)

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

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

11 FP time line: The LISP era General Interest on FP time The LISP era

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

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

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

15  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) From 1978 to 1987: The FP Boom Promises

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

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

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

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

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

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

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

23 A pplicative L anguage I dealised C omputing E ngine n 40 transputer-based agents n Pocket pools n Connected by a multi-stage switching network n Performance disappointing Granularity too fine Use of small packets

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

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

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

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

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

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

30 Lazy Graph Generation

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

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

33 The Rise: Haskell n Glasgow Haskell: FASTFAST RobustRobust n Monads: neat I/O

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

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

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

37 The Rise: GUM n Portable n PVM n Available on shared-memory and distributed-memory n 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 H igher- O rder and T yped.  Broader reading of terms.  HOT languages: Java, Haskell, ML and Scheme

44 FP time line: the Rise General Interest on FP time The LISP era 1989 The FP boom The Rise The Fall

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

46 FALL and RISE Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL The of of FP

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

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

49


Download ppt "FALL and RISE Rafael Dueire Lins Departamento de Informática Universidade Federal de Pernambuco Recife - PE - BRAZIL The of of FP."

Similar presentations


Ads by Google