“ A language that doesn’t affect the way you think about programming, is not worth knowing”

Slides:



Advertisements
Similar presentations
Computational Models The exam. Models of computation. –The Turing machine. –The Von Neumann machine. –The calculus. –The predicate calculus. Turing.
Advertisements

Adapted from Scott, Chapter 6:: Control Flow Programming Language Pragmatics Michael L. Scott.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Overview of Programming Paradigms
COMP205 Comparative Programming Languages
Compiler Design Lexical Analysis Syntactical Analysis Semantic Analysis Optimization Code Generation.
Programming Languages Structure
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
CS 331, Principles of Programming Languages Introduction.
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Overview. Copyright © 2006 The McGraw-Hill Companies, Inc. Chapter 1 Overview A good programming language is a conceptual universe for thinking about.
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
G Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness types and their operations.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
Programming languages1 Programming paradigms Families of programming languages.
Chapter 1. Introduction.
AS Computing Introduction to Programming. What is a Computer Program? A list of instructions that a computer must work through, in a logical sequence,
Evolution of Programming Languages Generations of PLs.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Chapter 1 - Introduction
By Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion (Algol,
Programming History. Who was the first programmer?
1 Programming Language History and Evolution In Text: Chapter 2.
Comp Programming Languages Proposal 1 All humans possess a common logical structure which operates independently of language Proposal 2 Language.
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05.
Programming Languages
CS 331, Principles of Programming Languages Chapter 1.
Logical and Functional Programming
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Copyright © 2009 Elsevier Chapter 6:: Control Flow Programming Language Pragmatics Michael L. Scott.
A Short History of PL's (MacLennan 1999) “Zeroth Generation” (1940's-50's): machine language / assembly: if/then, read/write, store, goto
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
Software Engineering Algorithms, Compilers, & Lifecycle.
Review for Test 2 Chapters 5 (start at 5.4), 6.1, , 12, 13, 15.1, Python.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming Language History and Evolution
Chapter 1. Introduction.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Programming Languages 2nd edition Tucker and Noonan
The language focusses on ease of use
Concepts of Programming Languages
Introduction to programming languages, Algorithms & flowcharts
Concepts of Programming Languages
Why study programming languages?
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
CS 363 – Chapter 1 What is a programming language? Kinds of languages
课程名 编译原理 Compiling Techniques
Programming Languages and Translators
Programming Language History and Evolution
Evolution of programming languages
Developing Applications
Introduction to programming languages, Algorithms & flowcharts
Chap. 6 :: Control Flow Michael L. Scott.
Programming Language Design
Chap. 6 :: Control Flow Michael L. Scott.
Programming Languages 2nd edition Tucker and Noonan
Principles of Programming Languages
Overview of Programming Paradigms
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Presentation transcript:

“ A language that doesn’t affect the way you think about programming, is not worth knowing”

Some Initial Thoughts, and Recap From the Church-Turing thesis all computers are equivalent to a Turing Machine and therefore are equivalent to each other. Computer manufacturers admit this; they do not say “our machine has some magic instruction which makes our computer more powerful than the competition”. Their advertising goes like this: “Our machines are faster, cheaper, easier to program and are more greener” From the Church-Turing thesis all programs can be constructed using two registers and two instructions, so all programming languages are equivalent in expressibility (power,…) Language developers admit this; they do not say “our language has some magic feature which allows our language to do more than in any other language”. Instead, their advertising goes like this. “Our language is more user-friendly, our compilers are faster and they produce smaller executable files, and are more greener” Why are these two instructions so fundamental? decjmpreg reg,lab inc reg

What languages do we know ?

Java Ada ALGOL 60 Assembler Basic FORTRAN Lisp Scheme Joy Haskell Clean COBOL Erlang Prolog FP F# Lua Occam Oz Pascal Python C++ SmallTalk C# C PHP Tcl

Lang Paradigm

Programming Paradigms What is a “Paradigm” ? Important Paradigms Imperative (procedural) Declarative Functional Logic Object Oriented Event Driven

OO Functional Logic Imperative

Imperative vx. Declarative float x; float function square(float a) { float b; b = a x a; return b; } x = square(3); (define (square a) (x a a)) (square 3)

Matlab Lisp C Java C++ Event Driven ActionScript Prolog Functional Object Oriented Logic Imperative Assembler

Generations 1stMachine – level (switches) 2ndAssembler 3rd Programmer-friendly: C++, Java, FORTRAN, COBOL 4thApplication: SQL, SPSS 5thConstraint: Prolog, OPS5 (AI)

Paradigms: Imperative Focus on dynamic aspect of computation – operational semantics Specifies step-by step what must be done

Pure Forms Godel’s purely descriptive recursive function formalism Realized by Mc.Carthy’s Lisp Turing’s Imperative formalism

Paradigms: Functional

Paradigms: Logic

Paradigms: Object Oriented

Paradigms: Event Driven

Using conditional expressions to define recursive functions Thesis: All computable functions can be defined by the recursive use of conditional expressions. if p then a else b n! = g(n,1) where g(n,s) = if n = 0 then s else g(n – 1, n x s)

Equivalence of imperative and functional programming

Flow Diagrams: Turing Von Neumann and McCarthy

Prolog Syntax SheetFacts and Rules parent(abraham, isaac). Fact. Lower case for names. parent(isaac, esau). Fact. Lower case for names. grandfather(X,Y) :- parent(X,A),parent(A,Y). Rule. If X is the grandfather of Y then X is the parent of A and A is the parent of Y. For example, if george “X” is the parent of colin “A” and colin “A” is the parent of tristan “Y” then george “X” is the grandparent of Tristan “Y”. Queries ?- parent(abraham,X). The capital X designates an “output” variable which will be all sons of Abraham. ?- grandfather(abraham,X). The capital X designates an “output” variable which will be all grandchildren of Abraham.

Recursion See Recursion On page 269 of Kernighan and Richie’s book The C Programming language recursion86,139,141,182,202,269 Recursion in Language: 5 th C BC Panini Sanskrit Grammar Rules 20 th C Chomsky theorizes that unlimited extension of English is possible through the use of recursion. … try Googling “Recursion”

There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we now know we don’t know. But there are also unknown unknowns. These are things we do not know we don’t know US Defense Secretary Donald Rumsfeld on February 12, 2002

Recursion in Language begin articleadjectivenoun end ornate noun begin ornate noun relative pronoun verb end preposition fancy noun verb fancy noun fancy noun fancy noun

Recursion in Language begin articleadjectivenoun end ornate noun begin ornate noun relative pronoun verb end preposition fancy noun verb fancy noun fancy noun fancy noun

Recursion in Language begin articleadjectivenoun end begin ornate noun relative pronoun verb end preposition fancy noun verb fancy noun fancy noun

Recursion is not Self-Reference A recursive function makes reference to a simplified version of itself: (I am) better than what (I was) I’m the humblest person I know I never make misteaks “I never make predictions. I never have and I never will” This sentence contains five words This sentence no verb

()A A + var A Compilers - Parsing

( ) + var A

=expression term var num ()expression Statement Expression Term

Back to the “Timeline” Our contemporary languages have evolved (?) or have developed (?) from languages of the past. What will our future languages look like? In other words what are our future computing needs (or desires) ?

Monty Python Holy Grail witch(X) :- burns(X),female(X). burns(X) :- wooden(X). wooden(X) :- floats(X). wooden(woodBridge). stone(stoneBridge). floats(bread). floats(apple). floats(cherry). floats(X) :- sameweight(duck, X). female(girl). sameweight(duck,girl). ?- witch(girl)

Monty Python Holy Grail Yes [trace] 12 ?- witch(girl). Call: (7) witch(girl) ? creep Call: (8) burns(girl) ? creep Call: (9) wooden(girl) ? creep Call: (10) floats(girl) ? creep Call: (11) sameweight(duck, girl) ? creep Exit: (11) sameweight(duck, girl) ? creep Exit: (10) floats(girl) ? creep Exit: (9) wooden(girl) ? creep Exit: (8) burns(girl) ? creep Call: (8) female(girl) ? creep Exit: (8) female(girl) ? creep Exit: (7) witch(girl) ? creep Yes

Coda It is easier to write an incorrect program than to read a correct one. There are two ways to write error-free programs, only the third one works. It is easier to change the specification to fit the program than vice-versa Why did the Roman Empire collapse? What is the Latin for “office automation” ?

to tree :size setpencolor [ ] if :size < 5 [stop] fd :size lt 30 tree :size*0.7 rt 60 tree :size*0.7 lt 30 bk :size end