1 / 6

Algol 68

Algol 68. Third language in the Algol Language Family An extension to Algol 60's capabilities Code blocks Variable Scopes Algol 68 was known for its orthogonality The goal was to develop a language with few language restrictions. Intended to make the language easier to learn. Algol 68.

jirair
Download Presentation

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. Algol 68 • Third language in the Algol Language Family • An extension to Algol 60's capabilities • Code blocks • Variable Scopes • Algol 68 was known for its orthogonality • The goal was to develop a language with few language restrictions. • Intended to make the language easier to learn

  2. Algol 68 • Algol 68 Basic Features • Common Language Services: IF ... THEN ... [ELSE,ELSE-IF], WHILE, DO ... WHILE, FOR ... NEXT • Procedural Abstraction: Can define new procedures and functions for generalizing tasks. • Dynamic Arrays: Arrays, of any type, can shrink and grow dynamically. This is also called “flex arrays”. Arrays can be of any dimensions. • Array Slicing: Using special syntax, new arrays can be created from old arrays.

  3. Algol 68 • Algol 68 Basic Features • Operator Definition And Overloading: Users can create new operators, overload existing operators using user types and change the priority of operators. • Highly Orthogonal. Examples: • 3 * (a := c + 4) + 2 ; • X := IF a < 2 THEN 3.2 ELSE 5.2 FI ; • IF a < 2 x THEN y FI := 3.5 ; • Strong Type Checking • Users can use system-provided modes or can define new modes through new structures or unions.

  4. Algol 68 • Algol 68 Basic Features • Support for call-by-value as well as call-by-reference. • All procedures defined are values, with their names as values: Can use Algol 68 for some functional programming. • Algol 68 Library Support • I/O facilities provided through architecture-independent “transput” (unlike what was provided with Algol 68.) • Current implementations provide support for scientific code libraries.

  5. Algol 68 • Examples: PROC factorial = (INT x)INT: BEGIN (x = 1 OR x = 0|x|x * factorial(x-1)) END; PROC map and print = ([]INT x, PROC (INT)INT proc)VOID: BEGIN FOR i FROM LWB x TO UPB x DO print(proc(x[i]) OD; END

  6. Algol 68 • More Examples of Orthogonality: REF INT size = LOC INT; read(size); REF[]INT a = LOC[1:size]INT could also be done as: REF[]INT r = LOC[1:(REF INT i=LOC INT; read(i);i)]INT

More Related