320 likes | 545 Views
A brief history of programming languages. Gary Marsden Semester 2 – 2001. What is a programming language?. Originally, computers were hard-wired to perform one task only Von Neumann realised that instructions could be stored with data, making computers general purpose
E N D
A brief history of programming languages Gary Marsden Semester 2 – 2001
What is a programming language? • Originally, computers were hard-wired to perform one task only • Von Neumann realised that instructions could be stored with data, making computers general purpose • “Machine language” was therefore the first programming language
Low level • Originally, languages were bit patterns (1st generation) • 101010101100010111110100110101 • Eventually, mnemonics were used to produce a human readable version of the above • LDA (2), #45 • At least this is now readable by humans as well as machines
Moving from low level • As humans programmed in low level languages, it became apparent to them that they were expressing the same ideas over and over; e.g. iteration • Low level languages could not express such concepts • Furthermore conceptually identical programs looked radically different as LLL are closely tied to individual machine architectures
Becoming abstract • It became clear that programming languages would need to express the types of abstractions humans dealt with • This required languages to be come more human readable, hence the term • high level language • These HLLs need to be translated into a LLL to be executed – more later.
What abstractions • What are the abstractions which people want? • There are two basic types • Control Abstractions • Data Abstractions • We can examine these abstractions in terms of • Basic abstractions • Structure abstractions • Unit abstractions
Basic Data abstractions • The most basic data abstraction is the variable • Variables have a type (e.g. integer, real) • Variables are allocated a name during declaration • var x: integer; (Pascal/Modula*) • int x; (C/C++/Java) • Dim x as Integer (Visual Basic)
Structure Data Abstractions • Data structures allow related data types to be collected together and dealt with as a unit • Common to most languages is the array • a: array [1..10] of integer; (Pascal) • INTEGER a(10) (Fortran) • int a[10]; (C/C++/Java)
Unit Data Abstractions • Especially useful for programming in the large, unit abstractions allow grouping (and abstraction) of everything which deals with one data type • These were originally called abstract data types (Clean, Modula-2) but you would know them as objects • Package (Ada)
Basic Control Abstractions • Basic abstractions are those that combine a few machine instructions into a HLL equivalent • GOTO statement (BASIC, FORTRAN) replacing “Jump” instructions • Assignment statement (all imperative languages) replacing memory->register->memory statements • := (Pascal derivatives) • = (C derivatives) • put the value of field “x” into field “y” (HyperTalk)
Structured control abstractions - branching • At a higher level than GOTO is the notion of a conditional branch • This can be an “if..then..else” or a “switch” statement • When should one be used in preference to the other? • What about dangling elses?
Structured control abstractions – iteration • Within imperative programming there is the idea of repeating code a number of times • This may be a fixed number of times • for loops • Or may depend on a condition • while loops • until loops • Or may be infinite • LOOP..EXIT..END (Modula-2)
Structured control abstractions – packages • Originally, there were labelled subroutines – execution jumped to these code blocks • The idea evolved to functions and procedures (and event handlers) which can have • declarations with optional parameters • calls or invocations, where they can be passed • arguments, or actual parameters
Unit Control Abstractions • Really, a unit control abstraction suggests different chunks of program which can run independently • Java has threads, but other languages have co-routines • Process (Modula-2) • Task (Ada)
History • Now that we have looked at the key abstractions of programming languages, it is worth looking at where they came from and how they developed
FORTRAN • The first high level language was developed at IBM by John Backus (important chap) in 1957 • Name stands for FORmula TRANslation • Is still around as FORTRAN90 because • compilers are very efficient • only language engineers learn • Introduced • arrays • for loops • branching if statements
COBOL • COmmon Business Oriented Language, developed by the DoD in 1960 by Grace Hopper • Designed to keep track of lots of data (network database model) • Verbose language which could not specify complex calculation, but did provide • record structure • separation of data specs from code • advanced formatting
Algol 60 • ALGOrithmic Language was designed by committee in 1960 • Aimed at allowing algorithms to be expressed • Influence felt in every language • Introduced • blocks • first structured statements • type declarations • call-by-value • stack based run time implementation
Lisp • LISt Processing language was written by John McCarthy in late 50’s • McCarthy was a big figure at MIT • Aimed at list processing as a tool for AI • Based on lambda calculus – not Von Neumann • Introduced • run time environment • garbage collection
The sixties • The 4 languages we looked at have had tremendous impact on subsequent language development • In the sixties it became popular to design your own language and there followed hundreds of (thankfully) defunct languages • We shall briefly look at the exceptions
PL/1 • IBM decided to create the definitive programming language – one language for all purposes • Consequently they created a language with many advanced concepts, such as concurrency and exceptions. • As these concepts were not well understood, implementations were slow and unreliable • Through market domination, IBM made PL/1 a ‘success’ and still support it
BASIC • Beginners All Purpose Symbolic Language started life as a teaching alternative to FORTRAN • Designed at Dartmouth college for an interactive time sharing system • Hence it became the de-facto standard on interactive terminals • Still hugely popular thanks to Microsoft • Dijkstra has some thoughts on the language
Dijkstra on Basic “It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of recognition.”
Other oddities • Although SNOBOL is no longer with us, its children are • It was the first language to process strings, giving us the joys of awk and perl. • Simula67 was created as a superset of Algol60 in Norway • Built for programming simulations, it was the first language to group data and functions together in a “class” • It is widely credited as the first object-oriented language
The seventies • The seventies was really a reaction to the confusion of the sixties • Languages designers sought to re-think language design • This led to ‘lean’ languages like • Pascal – derived from Algol-W as a concise powerful teaching language • C – again, an Algol derivative, this time aimed at being a small clean system implementation language (greatly helped by the success of Unix)
The eighties • As large programming tasks became common, language design was driven to manage complexity • The eighties also saw a renewed interest in alternative programming paradigms, resulting in languages like • Prolog • Scheme • SQL
ADA • Ada was commissioned by the US DoD. All DoD projects now need to be written in Ada. • Compilers need to be accredited – an expensive process involving men in dark suits with libraries of test programs • Implemented abstract data type mechanism, called a ‘package’ • Had exception handling and concurrent execution
Object orientation • ADT languages eventually gave way to object-oriented languages • The first of these was really SmallTalk, designed by Alan Kay at XEROX PARC • These ideas were developed in two ways • Shoehorned into existing languages – C++, Objective-C • Developed into elegant but incredibly inefficient languages – Eiffel
Generations • You will hear languages referred to as being from a particular “generation” • This is an inexact classification, but is roughly as follows • First generation languages are assembly langs • Second generation are really COBOL and FORTRAN1, which have no high level abstraction • Third generation are languages like C, Pascal, C++ etc. • Fifth generation languages are very high level, basically Prolog • I doubt there will be a widely accepted 6th generation
Fourth generation • Missing from the last slide is the fourth generation of languages • This group includes all high level application languages. Examples include • macro languages • SQL • There has been almost no academic study of this generation, as the language design people see them as a subset of 3GL’s • They are worth studying from a usability aspect