Download presentation
Presentation is loading. Please wait.
1
History of Computing – Algol
Prof. Steven A. Demurjian Computer Science & Engineering Department The University of Connecticut 371 Fairfield Way, Box U-255 Storrs, CT (860) 486–4818 (Office) (860) (CSE Office)
2
Algol Compilers http://algol68.sourceforge.net/ Alternative Compilers
Algol 68 Genie Algol 68 Compiler, Interpreter & Runtime Genie seems to be most referenced Download Algol 68 Genie algol68g-2.8.4 Linux/BSD Source code November 2016 algol68g-2.8.3 Documentation March 2016 WIN32 Precompiled
3
Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel
CSCE 330 Project Algol 68 Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel
4
History ALGOrithmic Language
Developed in Europe by an international group, consisting of 7 different countries, in the late 1950’s Very similar to FORTRAN Peter Naur and J.W. Backus worked on the project. Was the debut of the BNF syntax. Designed specifically for programming scientific computations
5
History (Continued) Never became as commercially popular as FORTRAN or COBOL Was not compatible with IBM Is considered the most important programming language in terms of influence on later language development Many similar languages can (and are) referred to as “ALGOL-like” JAVA, C, C++, Pascal, Ada, FORTRAN, etc.
6
Design Goals Design goals: (but, Pascal more like A60 than A68 is)
general purpose, rigorously-defined language Clears up trouble spots in ALGOL60 (but, Pascal more like A60 than A68 is) orthogonality, extensibility
7
Features Value Name Supports a Block Structure
Two types of Parameter Passing Value Name Recursion Arrays Reserved Words
8
Failures and Shortcomings
The prime cause of the failure of ALGOL 68 was that too much was expected of it. It was not widely implemented or not soon enough implemented. Its formal definition was too complex to implement. ALGOL 68 is known to be ‘unreadable’. ALGOL 68 report was not properly typed hence too difficult to read. ALGOL 68 semantic model was too big with lots of extensions ALGOL 68 was a very mathematical language fairly difficult to understand, difficult to implement. The language was considered to complex for its time.
9
Key Ideas User type declarations (modes)
Reference mode (pointers of a sort) United modes (predecessor to variant records) Auto declaration of FOR LOOP index User-specified operator overloading
10
Key Ideas (Continued) Mode requirement for formals
Casting: user-specified mode conversion Redefinition of operator precedence Semaphores W-grammars - two-level grammar
11
Structure ALGOL68 is block structured w/ static scope rules
ALGOL68's model of computation: static stack: block/procedure AR's; local data objects heap: “heap” -- dynamic-- data objects ALGOL68 is an expression-oriented language
12
Organization Declarations: Imperatives (units)
Must be given (FOR LOOP index only exception) Can name new types (modes) Imperatives (units) 15 major unit types Assignment is allowable side-effect of units
13
Algol 68 Modes Primitive modes Compound Modes int --arrays
Real structures Char procedures bool sets string pointers Compl(complex) bits bytes Sema (semaphore) Format (I/O) file
14
Other features of Algol 68
Storage management • Local storage on stack • Heap storage, explicit alloc and garbage collection Parameter passing • Pass-by -value • Use pointer types to obtain Pass-by -reference Assignable procedure variables • Follow “orthogonality ” principle rigorously Source: Tanenbaum, Computing Surveys
15
Basic Syntax Addition : “ + ” Subtraction : “ - ”
Multiplication : “ * ” Division : “ / ” Exponentiation : “ ** ” Assignment : “ := ” Boolean Expressions = , > , < , <= , >= , /=
16
Block Structure First language to implement a block structure
Similar in form to pascal begin ….. end; Each block can have its own variables, visible only to that block (local variables). After the block is exited the values of all the local variables are lost.
17
Block Structure example
begin own integer i; integer j,k; i := j + k; end; The integer i will have the value of j+k stored the next time the block is entered By using the “own” statement the variable will retain its value for the next time the block is entered
18
Parameter Passing Two types of parameter passing: by Value, by Name
Pass by Value works the same as in most other languages Pass by Name is similar to pass by reference, but it adds flexibility All parameters are pass by name unless otherwise specified Example: can make a call “sum(i,2,5,x+6)” to the procedure sum procedure sum(i,j,k,l); value i,j,k; begin i := i + j + k + l end; (will execute as i := i (x+6))
19
Recursion Algol 68 Supports recursion Example:
real procedure factorial (n); begin if n = 1 then factorial := 1; else factorial := n* factorial(n-1); end;
20
Arrays Three types of arrays: real, integer, Boolean
Each array must contain all the same types All arrays are of type real unless specified Can have multidimensional arrays Declarations: array name1[1:100]; (1D array of type real) real array name2(-3:6,20:40); (2D array of type real) integer array name3, name4(1:46); (2 1D arrays of type integer) Boolean array name5(-10:n); (1D array of type Boolean) (Allocated Dynamically)
21
Algol 68 presented the following innovations (among many):
A new level in language description with the semantics defined to mathematical precision as well as the syntax. A formal method for describing, constructing and manipulating data types embodied in the language. An abstract model of computation that can be applied across radically different (single and multi) processor designs (in direct contrast to C). User-definable operators (in fact all the operators we normally take for granted as "built-in" are merely part of the Standard Prelude). Support for parallel programming with the parallel-clause and Dijkstra semaphores.
22
Conclusion General purpose algorithmic language with a clean consistent and unambiguous syntax. Comprehensive fully-checked type-system covering structures, unions, pointers, arrays and procedures. Procedures may be nested inside procedures and can deliver values of any type without you having to worry about where the storage is coming from. User-defined operators including user-defined operator symbols. Powerful control structures can deliver values of any type.
23
Conclusion Dynamic sized arrays know their current bounds.
Array and structure displays can be used in any context. Parallel programming with semaphores. Complex arithmetic. Declarations can be interleaved with statements. Clear distinction between value semantics and reference semantics. No distinction between compile-time constants and run-time values.
24
References
25
Any Questions?
26
CSE341 Programming Languages
The ALGOL Family CSE341 Programming Languages
27
Overview Historical perspective ALGOL Goals BNF (Backus-Naur Form)
Success and Failure of ALGOL Conclusion
28
History ALGOrithmic Language
Developed in Europe by an international group, consisting of 7 different countries, in the late 1950’s Very similar to FORTRAN Peter Naur and J.W. Backus worked on the project. Was the debut of the BNF syntax. Designed specifically for programming scientific computations
29
History (Continued) Never became as commercially popular as FORTRAN or COBOL Was not compatible with IBM Is considered the most important programming language in terms of influence on later language development Many similar languages can (and are) referred to as “ALGOL-like” JAVA, C, C++, Pascal, Ada, FORTRAN, etc.
30
ALGOL Goals To be as close as possible to standard math notation
Also very readable without much more explanation Should be possible to use it to describe algorithms in publications A form of it is still used today Should be mechanically translatable into machine language programs
31
BNF (Backus-Naur Form)
Was first to use BNF (Backus-Naur Form) Same Backus that created Fortran He also was one of the main creators of Algol And he created functional programming And won the Turing award in ’77 Right. Back to BNF BNF example: <value> := <number> | <variable> | <expression> <number> := <integer> | <float> <integer> := <integer><digit> | <digit> <digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Language was designed by committee Report is a “paradigm of brevity and clarity” Most languages today require 1000’s of pages Brevity and clarity contributed to reputation as simple, elegant language
32
Three Language Versions
Reference language Used by the committee, described in the report, and used in official Algol publications Publication language Allowed for differences in the character set for different languages Europeans and Americans couldn’t decide on which character to use for the decimal point! Hardware representations Condensed languages for machine input
33
ALGOL 58 The beginning June 1957 – ACM requested a committee to look into a universal programming language European and American groups got together in Zurich. No current language covers everything Creating more non-ideal languages doesn’t help the situation Each passing month more people start using other languages How can the logical structure of existing languages be adjusted
34
ALGOL 58 New Features Types Formal vs Actual parameters Declaration
Integer Real Boolean Formal vs Actual parameters Declaration for statements Switch Compound statements Begin end delimiters Three level language description Call by name
35
ALGOL 58 Function vs Procedure
Nature of the body Expression Compound statement Parameter evaluation mechanism Value of any actual parameter Text of any actual parameter Identifier collision Non-parameter identifiers are global to the definition Communication only through parameters Place of use An operand in an expression A statement or an operand in an expression
36
Call by name vs. by value Call by name is default
Call by name: re-evaluate the actual parameter on every use For actual parameters that are simple variables, it’s the same as call by reference For actual parameters that are expressions, the expression is re-evaluated on each access No other language ever used call by name…
37
Call by name begin integer n; procedure p (k: integer) print (k);
n := n+1; end; n := 0; p (n+10); parameter is n+10 (not just 10) prints n+10, which is 10 n is still 0; thus, n becomes 1 prints n+10, which is 11 n is set to 0 parameter is n+10 (not just 10)
38
Example Computing Illustrate ( Compute The Mean ):
// the main program (this is a comment) begin integer N; Read Int(N); real array Data[1:N]; real sum, avg; integer i; sum:=0; for i:=1 step 1 until N do begin real val; Read Real(val); Data[i]:=if val<0 then -val else val end; sum:=sum + Data[i]; avg:=sum/N; Print Real(avg) end
39
Example(Continued) I/O Illustrate: because ALGOL had no IO facilities. The following code could run on an ALGOL implementation for a Burroughs A-Series mainframe. BEGIN FILE F (KIND=REMOTE); EBCDIC ARRAY E [0:11]; REPLACE E BY "HELLO WORLD!"; WHILE TRUE DO WRITE (F, *, E); END; END.
40
Problems with Algol58 Didn’t include a I/O library
Thus, each implementation had a different means for I/O This caused compatibility problems And no standard way to write a Hello World program
41
ALGOL 60 Basic Language of 1960
Simple imperative language + functions Successful syntax, BNF -- used by many successors statement oriented begin … end blocks (like C { … } ) if … then … else Recursive functions and stack storage allocation Type discipline was improved by later languages Very influential but not widely used in US Tony Hoare: “Here is a language so far ahead of its time that it was not only an improvement on its predecessors but also on nearly all of its successors.”
42
ALGOL 60 Proposed Changes
The empty statement was adopted Modifications to operation hierarchy Unary operators having higher precedence than binary operators was adopted Implied multiplication was rejected Relation sequences were rejected The else clause was adopted Strings, lists, trees, matrices, and complex numbers were rejected as types Multiple assignment statements were adopted Created a new problem, A[i] := i := e Recursion became possible in obvious ways Constants were rejected
43
ALGOL 60 What’s New Block Call by value/name Typed procedures
Declaration scope Dynamic arrays Side effects Global and local variables Step, until, while, if then else Activation records Recursive decent parsers No I/O
44
Algol 60 Sample real procedure average(A,n); real array A; integer n;
begin real sum; sum := 0; for i = 1 step 1 until n do sum := sum + A[i]; average := sum/n end; no array bounds no ; here set procedure return value by assignment
45
Algol Oddity Question: Is x := x equivalent to doing nothing?
Interesting answer in Algol integer procedure p; begin …. p := p end; Assignment here is actually a recursive call
46
Problems with Algol60 Holes in type discipline
Parameter types can be arrays, but No array bounds Parameter types can be procedures, but No argument or return types for procedure parameters Problems with parameter passing mechanisms Pass-by-name “Copy rule” duplicates code, interacting badly with side effects Pass-by-value expensive for arrays Some awkward control issues goto out of block requires memory management
47
ALGOL 68 Considered difficult to understand
Idiosyncratic terminology Types were called “modes” Arrays were called “multiple values” Used vW grammars instead of BNF Context-sensitive grammar invented by van Wijngaarden Elaborate type system Complicated type conversions Fixed some problems of Algol 60 Eliminated pass-by-name Not widely adopted
48
ALGOL 68 What’s New Many new types, called modes
Primatives Bits Bytes String Sema (a semaphore) Complex File Pipe Channel format Additional Flex (Flexible array) Heap (space on the heap) Loc (local space on the stack) Ref (pointer) Long (bigger ints/reals) Short (smaller ints/reals) Declaration of custom types/modes
49
Algol 68 Modes Primitive modes Compound Modes int --arrays
Real structures Char procedures bool sets string pointers Compl(complex) bits bytes Sema (semaphore) Format (I/O) file Rich, structured, and orthogonal type system is a major contribution of Algol 68.
50
Other Features of Algol 68
Storage management Local storage on stack Heap storage and garbage collection Parameter passing Pass-by-value Use pointer types to obtain pass-by-reference Assignable procedure variables
51
Structure ALGOL68 is block structured w/ static scope rules
ALGOL68's model of computation: static stack: block/procedure AR's; local data objects heap: “heap” -- dynamic-- data objects ALGOL68 is an expression-oriented language
52
Basic Syntax Addition : “ + ” Subtraction : “ - ”
Multiplication : “ * ” Division : “ / ” Exponentiation : “ ** ” Assignment : “ := ” Boolean Expressions = , > , < , <= , >= , /=
53
Recursion Algol 68 Supports recursion Example:
real procedure factorial (n); begin if n = 1 then factorial := 1; else factorial := n* factorial(n-1); end;
54
Arrays Three types of arrays: real, integer, Boolean
Each array must contain all the same types All arrays are of type real unless specified Can have multidimensional arrays Declarations: array name1[1:100]; (1D array of type real) real array name2(-3:6,20:40); (2D array of type real) integer array name3,name4(1:46);(2 1D arrays of type integer) Boolean array name5(-10:n); (1D array of type Boolean) (Allocated Dynamically)
55
Block Structure First language to implement a block structure
Similar in form to pascal begin ….. end; Each block can have its own variables, visible only to that block (local variables). After the block is exited the values of all the local variables are lost.
56
Block Structure example
begin own integer i; integer j,k; i := j + k; end; The integer i will have the value of j+k stored the next time the block is entered By using the “own” statement the variable will retain its value for the next time the block is entered
57
Parameter Passing Two types of parameter passing: by Value, by Name
Pass by Value works the same as in most other languages Pass by Name is similar to pass by reference, but it adds flexibility All parameters are pass by name unless otherwise specified Example: can make a call “sum(i,2,5,x+6)” to the procedure sum procedure sum(i,j,k,l); value i,j,k; begin i := i + j + k + l end; (will execute as i := i (x+6))
58
ALGOL Successes and Failures
Programming computers – Partial Success Core language is strong, no I/O is a serious shortcoming Publication of algorithms – Very Successful Stimulus to compiler design – Success with a seed of corruption It only stimulated compiler design because it was difficult Stimulated formal language research – Success Not the goal of the ALGOL effort Description of ALGOL 60 – Failure Difficult to understand for the uninitiated reader Needs an informal explanation
59
Conclusion General purpose algorithmic language with a clean consistent and unambiguous syntax. Comprehensive fully-checked type-system covering structures, unions, pointers, arrays and procedures. Procedures may be nested inside procedures and can deliver values of any type without you having to worry about where the storage is coming from. User-defined operators including user-defined operator symbols. Powerful control structures can deliver values of any type.
60
Conclusion (Continued)
Dynamic sized arrays know their current bounds. Array and structure displays can be used in any context. Parallel programming with semaphores. Complex arithmetic. Declarations can be interleaved with statements. Clear distinction between value semantics and reference semantics. No distinction between compile-time constants and run-time values.
61
References Lindsey, C.H., “A History of ALGOL 68.” History of Programming Languages, ACM Press Naur, Peter, “Successes and failures of the ALGOL effort”, ALGOL Bulletin #28, Computer History Museum Thomson, C.M., “Algol 68 as a Living Language”, ALGOL Bulletin #47, Computer History Museum Perlis, Alan, “The American side of the development of Algol”, The first ACM SIGPLAN conference on History of programming languages, ACM Press Naur, Peter. “The European side of the last phase of the development of ALGOL 60”, The first ACM SIGPLAN conference on History of programming languages, ACM Press
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.