SlideShare une entreprise Scribd logo
1  sur  13
Can programming be 
liberated from the 
von Neumann style? 
Backus J. Can programming be liberated from the von Neumann style?: 
a functional style and its algebra of programs. 
Commun ACM 1978;21:613–41. 
Oriol López Massaguer 
Barcelona CompSci Club meetup 
8/10/2014
Background 
• Who was John Backus? 
• Creator of FORTRAN. IBM 1954. First high level language compiler 
• Member of the ALGOL committee 
• BNF formalism (syntax of programming languages) 
• Programming languages & software development in the 70s 
• OO languages not in widespread use 
• Programming languages used: Fortran, COBOL and Algol 
• High level languages became wide and increasingly complex: Ada, 
Algol, etc.. 
• Software crisis: increasing difficulty of software projects 
• Turing award 
• Recipients give a lecture during the ACM meeting 
• Since 1966 
• Recipients: Knuth, Dijkstra, Codd, John McCarthy, Hoare, Cerf, Kay, 
etc.
Von Neumann computer & languages 
What are Von Neumann Languages? 
• Conventional languages are Von Neumann languages 
because they are high level versions of Von Neumann 
computer 
• The most important statement is assignment. To compute 
something is to store the result in a memory cell 
• All the other constructs are auxiliary to make assignments 
• Assignment is both: 
• performance bottleneck 
• intellectual bottleneck 
• Despite the evolution from FORTRAN to ALGOL 
(essentially the same) and even to today (2014) 
programming languages they are essentially the same
Models of Computing systems 
Simple 
Operational 
Models 
Applicative models Von Neumann 
models 
Examples Turing machines 
automata 
Lambda calculus 
Combinators 
Pure LISP, 
FP systems. 
Von Neumann 
comps, 
Conventional 
programming 
languages 
Semantics State transition 
(simple state) 
Reduction semantics 
(no state) 
State transition 
(complex state) 
Program clarity Unclear 
Not conceptually 
helpful 
Clear 
Conceptually 
helpful 
Clear 
Not very useful 
conceptually
Solution proposed 
Functional programming systems (FP systems) 
Structure / Syntax: 
• A set of objects O 
• A set of functions F. Map objects into objects 
• An operation, application 
• A set of functional forms. Combine F and O to build new functions 
in F 
• A set of definitions that define some functions in F and assign a 
name to each definition 
Behavior / Operational: 
• Computation of some f:x is the evaluation of the expression 
according to the described rules 
Semantics: 
• Semantics is a reduction semantics. No state. The expression has 
the whole meaning of the computation.
Solution proposed 
FP systems: 
• A set of objects O 
• Atoms: 1, 2, ┴, T, F 
• Sequences: <x1, x2,…, xn> 
• Application: 
• Given function f and object o: 
• f:x denotes the application of f to o
Solution proposed 
• Functions: 
• Selector: 
• 1: < 푥1,, 푥2, … , 푥푛 >→ 푥1 
• Tail: 
• 푡푙: 푥 ≡ < 푥1,, 푥2, … , 푥푛 >→: < 푥2, … , 푥푛 > 
• Atom predicate, equality predicate, null predicate 
• Reverse (reverse a sequence) 
• Distribute (pair an element with all elements of a sequence) 
• Transpose (matrix transposition) 
• Arithmetic operators, logical operators, etc.
Solution proposed 
• Functional forms: 
• Composition: 
• 푓 ∘ 푔 : 푥 ≡ 푓: (푔: 푥) 
• Condition: 
• 푝 → 푓; 푔 ∶ 푥 ≡ 푝 ∶ 푥 = 푇 → 푓: 푥 ; 푝 ∶ 푥 = 퐹 → 푔: 푥 
• Constant 
• 푥 : 푦 ≡ 푦 = ⊥ → ⊥ ; 푥 
• Insert (aka fold): 
• /푓: 푥 ≡ 푥 = < 푥1 > → 푥1; 푥 =< 푥1, … , 푥푛 > & 푛 ≥ 2 → 푓: < 푥1,/푓: < 푥2, … , 푥푛 > > ; ⊥ 
• Apply to all (aka map) 
• While 
In summary a set of predefined higher-order functions.
Solution proposed 
• Definitions: 
• 퐷푒푓 푓 ≡ 푟(푓) 
• l is a unused functional symbol 
• r is a functional form which may depend on f (in case of recursion) 
• Example (function to obtain the last element of a list) 
• 퐷푒푓 푙푎푠푡 ≡ 푛푢푙푙 ∘ 푡푙 → 1 ; 푙푎푠푡 ∘ 푡푙 
• Haskell syntax: 
• last [x] = x 
• last (_:xs) = last xs 
• Example (inner product) 
• 퐷푒푓 퐼푃 ≡ (/+) ∘ ∝× ∘ 푡푟푎푛푠 
• Haskell syntax: 
• ip l1 l2 = foldl (+) 0 (map2 (*) l1 l2)
Limitations of FP systems 
Limitations of FP systems: 
• can not compute an FP program 
• since functions expressions are not objects 
• can not define new functional forms 
• no state concept. no I/O 
Extensions 
• Formal systems for functional programming (FFP) 
• FP systems + possibility of creating new functional forms 
• Applicative State Transition (AST) Systems 
• Proposes an hybrid language that 
• An applicative subsystem (such as FFP) 
• A state D (the set of definitions of the applicative subsystem) 
• A set of transition rules to define the I/O transformations and the D state transitions
Goals of the solution 
Improve reasoning about the software developed 
• Programs as a certain kind of algebraic expressions 
• Verify correctness by following equational reasoning on 
the programs 
• This algebra is mathematically simpler than the classical 
approach to verify program correctness in von Neumann 
languages (Dijkstra, Hoare, etc.) 
Improve the research on new architectures to execute 
applicative languages more efficiently 
• Some attempts of graph reduction machines in the early 
80s, but failed
Today, has programming been liberated 
from von Neumann style? 
Global failure of the program 
• FP is not mainstream 
• We didn’t have new architectures for applicative languages 
But: 
• Some FP constructs / ideas are becoming mainstream 
• Closures / Higher order functions / Pattern matching / for comprehensions 
• Some people claim that concurrency may be easier by using FP 
techniques (due to stateless nature) 
• Multicore architectures require new programming tools. Some people 
claim that FP will ease development 
• But some questions remain open in the FP paradigm 
• Lazy evaluation / strict evaluation: Haskell vs ML 
• Modelling imperative computations: I/O, state, etc. 
• Pure functional language + Monads: Haskell approach 
• Hybrid / impure approach: Scala, ML, F#, OCAML
References 
• Backus J. Can programming be liberated from the von Neumann style?: a 
functional style and its algebra of programs. Commun ACM 1978;21:613–41. 
• Hudak P. Conception, evolution, and application of functional programming 
languages. ACM Comput Surv 1989;21:359–411. 
• Wadler P. The essence of functional programming. Proc. 19th ACM 
SIGPLAN-SIGACT Symp. Princ. Program. Lang., 1992, p. 1–14. 
• Wadler P. Comprehending monads. Math Struct Comput Sci 1992;2:461. 
• Hughes J. Why functional programming matters. Comput J 1989:1–23. 
• Bird R, Moor O de. The algebra of programming. 1997.

Contenu connexe

Tendances

9781285852744 ppt ch16
9781285852744 ppt ch169781285852744 ppt ch16
9781285852744 ppt ch16Terry Yoast
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12Terry Yoast
 
Monadic genetic kernels in Scala
Monadic genetic kernels in ScalaMonadic genetic kernels in Scala
Monadic genetic kernels in ScalaPatrick Nicolas
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA ProCNIT 126 5: IDA Pro
CNIT 126 5: IDA ProSam Bowne
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingMukesh Tekwani
 
9781285852744 ppt ch08
9781285852744 ppt ch089781285852744 ppt ch08
9781285852744 ppt ch08Terry Yoast
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilationHuawei Technologies
 
9781285852744 ppt ch17
9781285852744 ppt ch179781285852744 ppt ch17
9781285852744 ppt ch17Terry Yoast
 
Julia Computing - an alternative to Hadoop
Julia Computing - an alternative to HadoopJulia Computing - an alternative to Hadoop
Julia Computing - an alternative to HadoopShaurya Shekhar
 
9781285852744 ppt ch01
9781285852744 ppt ch019781285852744 ppt ch01
9781285852744 ppt ch01Terry Yoast
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity CalculationAkhil Kaushik
 
Scala for Machine Learning
Scala for Machine LearningScala for Machine Learning
Scala for Machine LearningPatrick Nicolas
 
Functions ppt ch06
Functions ppt ch06Functions ppt ch06
Functions ppt ch06Terry Yoast
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02Terry Yoast
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTWAdriano Bonat
 
9781285852744 ppt ch18
9781285852744 ppt ch189781285852744 ppt ch18
9781285852744 ppt ch18Terry Yoast
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)hrajak5
 

Tendances (20)

9781285852744 ppt ch16
9781285852744 ppt ch169781285852744 ppt ch16
9781285852744 ppt ch16
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12
 
Monadic genetic kernels in Scala
Monadic genetic kernels in ScalaMonadic genetic kernels in Scala
Monadic genetic kernels in Scala
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA ProCNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro
 
Graphical programming
Graphical programmingGraphical programming
Graphical programming
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
 
9781285852744 ppt ch08
9781285852744 ppt ch089781285852744 ppt ch08
9781285852744 ppt ch08
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilation
 
9781285852744 ppt ch17
9781285852744 ppt ch179781285852744 ppt ch17
9781285852744 ppt ch17
 
Julia Computing - an alternative to Hadoop
Julia Computing - an alternative to HadoopJulia Computing - an alternative to Hadoop
Julia Computing - an alternative to Hadoop
 
9781285852744 ppt ch01
9781285852744 ppt ch019781285852744 ppt ch01
9781285852744 ppt ch01
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
 
Scala for Machine Learning
Scala for Machine LearningScala for Machine Learning
Scala for Machine Learning
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
 
Cd unit i
Cd unit iCd unit i
Cd unit i
 
Functions ppt ch06
Functions ppt ch06Functions ppt ch06
Functions ppt ch06
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
 
9781285852744 ppt ch18
9781285852744 ppt ch189781285852744 ppt ch18
9781285852744 ppt ch18
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)
 

Similaire à Can programming be liberated from the von neumann style?

Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementationBilal Maqbool ツ
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesSchwannden Kuo
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming LanguageReham AlBlehid
 
Imperative programming
Imperative programmingImperative programming
Imperative programmingEdward Blurock
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification PosterSaulo Aguiar
 
Introduction to computing and Programming (ppt)
Introduction to computing and Programming (ppt)Introduction to computing and Programming (ppt)
Introduction to computing and Programming (ppt)arumemartin7
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingRutvik Pensionwar
 
Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02riddhi viradiya
 
Presentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingPresentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingFilip De Sutter
 
Compiler Design
Compiler DesignCompiler Design
Compiler DesignMir Majid
 

Similaire à Can programming be liberated from the von neumann style? (20)

Plc part 1
Plc part 1Plc part 1
Plc part 1
 
Funtional Programming
Funtional ProgrammingFuntional Programming
Funtional Programming
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 
02paradigms.ppt
02paradigms.ppt02paradigms.ppt
02paradigms.ppt
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
 
IN4308 1
IN4308 1IN4308 1
IN4308 1
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
 
Mcs lec2
Mcs lec2Mcs lec2
Mcs lec2
 
Paradigms
ParadigmsParadigms
Paradigms
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
Modern Programming Languages classification Poster
Modern Programming Languages classification PosterModern Programming Languages classification Poster
Modern Programming Languages classification Poster
 
Introduction to computing and Programming (ppt)
Introduction to computing and Programming (ppt)Introduction to computing and Programming (ppt)
Introduction to computing and Programming (ppt)
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02
 
Presentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingPresentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional Programming
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 

Dernier

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 

Dernier (20)

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 

Can programming be liberated from the von neumann style?

  • 1. Can programming be liberated from the von Neumann style? Backus J. Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs. Commun ACM 1978;21:613–41. Oriol López Massaguer Barcelona CompSci Club meetup 8/10/2014
  • 2. Background • Who was John Backus? • Creator of FORTRAN. IBM 1954. First high level language compiler • Member of the ALGOL committee • BNF formalism (syntax of programming languages) • Programming languages & software development in the 70s • OO languages not in widespread use • Programming languages used: Fortran, COBOL and Algol • High level languages became wide and increasingly complex: Ada, Algol, etc.. • Software crisis: increasing difficulty of software projects • Turing award • Recipients give a lecture during the ACM meeting • Since 1966 • Recipients: Knuth, Dijkstra, Codd, John McCarthy, Hoare, Cerf, Kay, etc.
  • 3. Von Neumann computer & languages What are Von Neumann Languages? • Conventional languages are Von Neumann languages because they are high level versions of Von Neumann computer • The most important statement is assignment. To compute something is to store the result in a memory cell • All the other constructs are auxiliary to make assignments • Assignment is both: • performance bottleneck • intellectual bottleneck • Despite the evolution from FORTRAN to ALGOL (essentially the same) and even to today (2014) programming languages they are essentially the same
  • 4. Models of Computing systems Simple Operational Models Applicative models Von Neumann models Examples Turing machines automata Lambda calculus Combinators Pure LISP, FP systems. Von Neumann comps, Conventional programming languages Semantics State transition (simple state) Reduction semantics (no state) State transition (complex state) Program clarity Unclear Not conceptually helpful Clear Conceptually helpful Clear Not very useful conceptually
  • 5. Solution proposed Functional programming systems (FP systems) Structure / Syntax: • A set of objects O • A set of functions F. Map objects into objects • An operation, application • A set of functional forms. Combine F and O to build new functions in F • A set of definitions that define some functions in F and assign a name to each definition Behavior / Operational: • Computation of some f:x is the evaluation of the expression according to the described rules Semantics: • Semantics is a reduction semantics. No state. The expression has the whole meaning of the computation.
  • 6. Solution proposed FP systems: • A set of objects O • Atoms: 1, 2, ┴, T, F • Sequences: <x1, x2,…, xn> • Application: • Given function f and object o: • f:x denotes the application of f to o
  • 7. Solution proposed • Functions: • Selector: • 1: < 푥1,, 푥2, … , 푥푛 >→ 푥1 • Tail: • 푡푙: 푥 ≡ < 푥1,, 푥2, … , 푥푛 >→: < 푥2, … , 푥푛 > • Atom predicate, equality predicate, null predicate • Reverse (reverse a sequence) • Distribute (pair an element with all elements of a sequence) • Transpose (matrix transposition) • Arithmetic operators, logical operators, etc.
  • 8. Solution proposed • Functional forms: • Composition: • 푓 ∘ 푔 : 푥 ≡ 푓: (푔: 푥) • Condition: • 푝 → 푓; 푔 ∶ 푥 ≡ 푝 ∶ 푥 = 푇 → 푓: 푥 ; 푝 ∶ 푥 = 퐹 → 푔: 푥 • Constant • 푥 : 푦 ≡ 푦 = ⊥ → ⊥ ; 푥 • Insert (aka fold): • /푓: 푥 ≡ 푥 = < 푥1 > → 푥1; 푥 =< 푥1, … , 푥푛 > & 푛 ≥ 2 → 푓: < 푥1,/푓: < 푥2, … , 푥푛 > > ; ⊥ • Apply to all (aka map) • While In summary a set of predefined higher-order functions.
  • 9. Solution proposed • Definitions: • 퐷푒푓 푓 ≡ 푟(푓) • l is a unused functional symbol • r is a functional form which may depend on f (in case of recursion) • Example (function to obtain the last element of a list) • 퐷푒푓 푙푎푠푡 ≡ 푛푢푙푙 ∘ 푡푙 → 1 ; 푙푎푠푡 ∘ 푡푙 • Haskell syntax: • last [x] = x • last (_:xs) = last xs • Example (inner product) • 퐷푒푓 퐼푃 ≡ (/+) ∘ ∝× ∘ 푡푟푎푛푠 • Haskell syntax: • ip l1 l2 = foldl (+) 0 (map2 (*) l1 l2)
  • 10. Limitations of FP systems Limitations of FP systems: • can not compute an FP program • since functions expressions are not objects • can not define new functional forms • no state concept. no I/O Extensions • Formal systems for functional programming (FFP) • FP systems + possibility of creating new functional forms • Applicative State Transition (AST) Systems • Proposes an hybrid language that • An applicative subsystem (such as FFP) • A state D (the set of definitions of the applicative subsystem) • A set of transition rules to define the I/O transformations and the D state transitions
  • 11. Goals of the solution Improve reasoning about the software developed • Programs as a certain kind of algebraic expressions • Verify correctness by following equational reasoning on the programs • This algebra is mathematically simpler than the classical approach to verify program correctness in von Neumann languages (Dijkstra, Hoare, etc.) Improve the research on new architectures to execute applicative languages more efficiently • Some attempts of graph reduction machines in the early 80s, but failed
  • 12. Today, has programming been liberated from von Neumann style? Global failure of the program • FP is not mainstream • We didn’t have new architectures for applicative languages But: • Some FP constructs / ideas are becoming mainstream • Closures / Higher order functions / Pattern matching / for comprehensions • Some people claim that concurrency may be easier by using FP techniques (due to stateless nature) • Multicore architectures require new programming tools. Some people claim that FP will ease development • But some questions remain open in the FP paradigm • Lazy evaluation / strict evaluation: Haskell vs ML • Modelling imperative computations: I/O, state, etc. • Pure functional language + Monads: Haskell approach • Hybrid / impure approach: Scala, ML, F#, OCAML
  • 13. References • Backus J. Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs. Commun ACM 1978;21:613–41. • Hudak P. Conception, evolution, and application of functional programming languages. ACM Comput Surv 1989;21:359–411. • Wadler P. The essence of functional programming. Proc. 19th ACM SIGPLAN-SIGACT Symp. Princ. Program. Lang., 1992, p. 1–14. • Wadler P. Comprehending monads. Math Struct Comput Sci 1992;2:461. • Hughes J. Why functional programming matters. Comput J 1989:1–23. • Bird R, Moor O de. The algebra of programming. 1997.