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

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Dernier (20)

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

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.