programming languages third edition
Post on 01-Jan-2016
56 Views
Preview:
DESCRIPTION
TRANSCRIPT
Programming LanguagesThird Edition
Chapter 1 – Part 1The Origins of Programming Languages
First … a QUIZ !!!
Programming Languages, Third Edition 2
Computer Hardware Milestones
Predecessor of “modern day” computer?
• mid 1800’s – Analytical Engine designed by Charles Babbage – “Father of the computer”
• Analytical Engine Emulator
Programming Languages, Third Edition 3
First computer programmer?
• mid 1800’s – Augusta Ada Byron King, Countess of Lovelace, (aka Ada Lovelace)– daughter of poet Lord Byron– lifelong friend of Charles Babbage– wrote an algorithm for Analytical Engine
Programming Languages, Third Edition 4
First “modern day” computer? *
• Actually, lots of contenders, all circa 1940’s• Three important characteristics:
• electronic• general purpose• programmable
(note: no mention of “memory” or “storage”)
* From The Innovators, by Walter Isaacson
Programming Languages, Third Edition 5
First “modern day” computer?
• Mark-1 (used for calcs for atomic bomb in WWII)• Harvard, Navy, IBM• “programmed” by Grace Hopper (more later)• electromechanical, not completely electronic
Programming Languages, Third Edition 6
First computer bug!
First “modern day” computer?
• Colossus (UK for breaking German codes in WWII)• not to be confused with electromechanical machine Alan
Turing built to decode German Enigma codes in The Imitation Game
• binary, electronic, semi-programmable but not general-purpose
Programming Languages, Third Edition 7
First “modern day” computer?
• ENIAC (electronic numerical integrator and calculator)• electronic (vacuum tubes), programmable, general-
purpose• programmable by rewiring it – took forever!• fun fact: not binary but base 10• basis for subsequent computers!
Programming Languages, Third Edition 8
Note this woman in the picture
First commercial “personal computer”?
• 1970’s – Apple
Programming Languages, Third Edition 9
IBM PC introduced - Predecessor of today’s Windows machines?
• 1981
Programming Languages, Third Edition 10
Apple Macintosh introduced?
• 1984
Programming Languages, Third Edition 11
End of Quiz!
Next– A bit about computer architecture– Some history of programming language
development
Programming Languages, Third Edition 12
The First Stored Programs (EDVAC – Electronic Discrete Variable Automatic Calculator)
• John von Neumann
Programming Languages, Third Edition 13
CPU should be wired with small set of GENERALPURPOSE instructions
Memory would hold BOTH data and instructions
Machine Language
Programming Languages, Third Edition 14
BOTTOM LINE:
Machine language programmingwas tedious
and error prone !!!
“Real” Programmers
Programming Languages, Third Edition 15
Real Programmers Don't Write SpecsAlso see Real Men Don’t Eat Quiche https://en.wikipedia.org/wiki/Real_Men_Don%27t_Eat_Quiche
Programming Languages, Third Edition 16
Link to O’Reilly programming language poster
Assembly Language
• 1950’s• a set of mnemonic symbols for instruction codes
and memory locations
Programming Languages, Third Edition 17
This:
MOV EAX, VAR1ADD EAX, 25MOV VAR2, EAX
Sure beats this:
00110101 00010111 0000101010111101 00010111 0001100100110101 00010101 00010111
Assembly Language (cont’d.)
Programming Languages, Third Edition 18
So … Assembly Language is an improvement, but …
has some drawbacks:• Lacks abstraction
– Doesn’t look like conventional mathematical notation
Programming Languages, Third Edition 19
Y=X+3
• Lacks portability– Each type of computer hardware architecture has its
own machine language instruction set and requires its own dialect of assembly language
So … Assembly Language is an improvement, but …
has some drawbacks:
Programming Languages, Third Edition 20
So … Assembly Language is an improvement, but …
has some drawbacks:
Programming Languages, Third Edition 21
One assembly language
statement
ONEmachine language
statement=
Next Improvement:High-Level Languages!
Programming Languages, Third Edition 22
One high-level language
statement
MANYmachine language
statements=
High-Level Languages
Programming Languages, Third Edition 23
This:
VAR2 = VAR1 + 25
Beats This:
MOV EAX, VAR1ADD EAX, 25MOV VAR2, EAX
• higher level of abstraction
High-Level Languages
• Programs are more portable– Same program can be translated into the machine
code of many different computers by using different translator programs
Programming Languages, Third Edition 24
Some Legendary Languages
Programming Languages, Third Edition 25
FORTRAN and Algebraic Notation
• FORmula TRANslation language– Developed by John Backus in the early 1950s– Lacked the structured control statements and data
structures of later high-level languages– Designed with one computer in mind (IBM 704)
which dictated some of its syntax– Primary goals efficiency and acceptance– Popular with scientists and engineers for its support
for algebraic notation and floating-point numbers– Sample FORTRAN code :
http://en.wikibooks.org/wiki/Fortran/Fortran_examples
Programming Languages, Third Edition 26
The ALGOL Family
• ALGOrithmic Language released in 1960– Unlike FORTRAN, machine independent– Included structured control statements for
sequencing (begin-end blocks), loops (for loop), and selection (if and if-else statements)
– Supported different numeric types – Introduced the array structure– Supported procedures, including recursive
procedures– Sample ALGOL code:
http://en.wikipedia.org/wiki/ALGOL_60
Programming Languages, Third Edition 27
The ALGOL Family (cont’d.)
• ALGOL was the first language to receive a formal specification or definition– Included a BNF grammar that defined its features
for both programmers and for compiler writers• Large number of high-level languages descended
from ALGOL, including:– Pascal: language for teaching programming in the
1970s– Ada: for embedded applications of U.S. Dept. of
Defense
Programming Languages, Third Edition 28
COBOL• COmmon Business-Oriented Language
– Designed for “data processing” around 1960– Natural language readability– Machine-independent / portable– “record” data structure– File handling features– Required language on DOD computers at one time– Standardized– Grace Murray Hopper – key designer / legend– Sample COBOL code: http://people.sju.edu/~
jhodgson/cobol/sample.html– http://
www.zdnet.com/article/50-years-and-still-going-strong-will-we-ever-be-ready-to-kill-off-cobol/Programming Languages, Third Edition 29
C and C++
• C developed at Bell Telephone Labs in late 60’s – early 70’s– For systems programming– “high-level” replacement for assembly language –
sort of the “best of both worlds”– Although Unix operataing system originally written in
assembly language, was later written in C• C++ also developed at Bell Labs – late 70’s – 80’s
– Essentially C with object-oriented features (classes)
Programming Languages, Third Edition 30
BASIC
• Beginner’s All-purpose Symbolic Instruction Code– Developed in late 60’s – For time-sharing systems– For “beginners” – easy to learn– Interactive / Interpreted– Sample BASIC code:
http://en.wikipedia.org/wiki/BASIC
Programming Languages, Third Edition 31
Pascal• Developed by Nicklaus Wirth in late 1960’s
– Named for famous mathematician / philosopher Blaise Pascal
– Conceptually simpler successor to ALGOL 60– Popular as a teaching language in late 70’s - 80’s– Control structures reflect notion of “structured
programming” – algorithms only require 3 fundamental logic patterns• Sequence• Selection• Iteration (repetition or loops)
– Sample Pascal code: http://en.wikipedia.org/wiki/Turbo_Pascal
32
Ada• Developed by DOD in late 70’s – early 80’s
– Named for Ada Lovelace (daughter of poet Lord Byron) – corresponded with Charles Babbage and wrote “programs” for his Analytical Engine and is known as “world’s first computer programmer”
– For “embedded systems” – computers built into other machines – previously programmed in assembly language
– Concurrency constructs– Sample Ada code:
http://sandbox.mc.edu/~bennet/ada/examples/f2_adb.html
33
top related