1 / 23

CSCE 330 Project Algol 68

CSCE 330 Project Algol 68. Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel. History . ALGO rithmic L anguage Developed in Europe by an international group, consisting of 7 different countries, in the late 1950’s Very similar to FORTRAN

Mercy
Télécharger la présentation

CSCE 330 Project Algol 68

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCE 330 Project Algol 68 Joe Puzio Wael AL-Fayez Gaurav Shah Ronak Patel

  2. 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

  3. 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.

  4. Design Goals • Design goals: • general purpose, rigorously-defined language • Clears up trouble spots in ALGOL60 • (but, Pascal more like A60 than A68 is) • orthogonality, extensibility

  5. Features • Supports a Block Structure • Two types of Parameter Passing • Value • Name • Recursion • Arrays • Reserved Words

  6. 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.

  7. 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

  8. Key Ideas (Continued) • Mode requirement for formals • Casting: user-specified mode conversion • Redefinition of operator precedence • Semaphores • W-grammars - two-level grammar

  9. 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

  10. Organization • Declarations: • 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

  11. Algol 68 Modes Primitive modesCompound Modes • int --arrays • Real --structures • Char --procedures • bool --sets • string --pointers • Compl(complex) • bits • bytes • Sema (semaphore) • Format (I/O) • file

  12. 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

  13. Basic Syntax • Addition : “ + ” • Subtraction : “ - ” • Multiplication : “ * ” • Division : “ / ” • Exponentiation : “ ** ” • Assignment : “ := ” • Boolean Expressions • = , > , < , <= , >= , /=

  14. 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.

  15. Block Structure example • 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

  16. 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 + 2 + 5 + (x+6))

  17. Recursion • Algol 68 Supports recursion Example: real procedure factorial (n); begin if n = 1 then factorial := 1; else factorial := n* factorial(n-1); end;

  18. 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)

  19. 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.

  20. 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.

  21. 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.

  22. References • http://portal.acm.org/citation.cfm?id=155365&coll=portal&dl=ACM&CFID=14638885&CFTOKEN=99793879 • http://www.occl-cam.demon.co.uk/whitepaper.html#FirstExample:Animal • http://www.stanford.edu/class/cs242/slides/ml.pdf

  23. Any Questions?

More Related