Algol 68

ALGOL 68 is a programming language. Their design was based on the requirements that they should be suitable to represent algorithms and disseminate them effectively execute on a variety of computer systems and to help them to teach students.

The language ALGOL 68 represented a new start, but based on experience with ALGOL 60 and the principles of this language. Goal was a much wider scope and a more rigorous language definition. The definition was first published as Report on the Algorithmic Language ALGOL 68, 1968 and 1976 fundamentally revised in the Revised Report.

The report identifies as objectives: completeness and clarity of description, orthogonality of the design, safety, effectiveness.

Compared to ALGOL 60, some concepts were unified; was introduced the concept of a name, a value that references to other values ​​, the opportunity for definition of structures, and other types of data. From the lower acceptability of ALGOL 60 compared with FORTRAN was concluded that a definition of input and output could promote the spread.

Critics argued that the language was no longer the simplicity of Algol 60 and is too difficult to implement. Concepts, the further spread found in practically successful languages ​​like C , such as operator overloading, were first defined syntactically. In contrast to Algol 60 language is expressive oriented largely, therefore, also be regarded as an early example of a functional programming language.

In the description of programming a new description method, the 2-stage grammar, also van Wijngaarden grammar was called, developed. This made ​​it possible to formalize all context conditions.

Also new was the concept PRAGMAT, the tips to optimize for the compiler allowed without changing the semantics of a program, so that the programs portable remained despite optimization.

ALGOL 68 was considered by some as an academic project, because longer time lacked useful compiler which implemented the entire language level.

Reserved symbols

In ALGOL 68, there are 61 reserved symbols ( of some icons are there abbreviations ):

Fashion, op, prio, proc,   flex, heap, loc, long, ref, short,   bits, bool, bytes, char, compl, int, real, sema, string, void,   channel, file, format, struct, union,   of, at "@ " is ": = ", is not going to " :/ =: ", true, false, empty, nil " ∘ " skip " ~",   co " ¢ " comment " ¢ ", pr, pragmat,   case in ouse '' in '' out esac " (~ | ~ |: ~ | ~ | ~ ) "   for from to by while do od,   if then elif '' then '' else fi " (~ | ~ |: ~ | ~ | ~ ) "   par begin end " (~ ) ', '' go to'', goto, exit. data types

Algol 68 denotes data types as modes. The basic data types are real, int, compl, bool, char, bits and bytes. For example:

Int n = 2; co n is a constant with the value 2.co int m: = 3; co m is a newly agreed local variable with the initial value 3 co co This is a shorthand for: ref int m = loc int: = 3; co real avogadro = 6.0221415 ⏨ 23; co co Avogadro long long real pi = 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510; compl square root of minus one = 0 ⊥ 1 The declaration of real x; is a shorthand notation for ref real x = loc real;. This means that x is a constant name for a reference to a newly generated local real variable.

Instead modes such as float and double, or int, long and short, etc., there are modifiers in Algol 68. For example, is written instead of double or long long long real real. Type attributes like max and min real long int are used to programs adapt to different implementations.

All variables must be declared. The agreement must not be made before the first Verweindung.

Compiler directives and comments

Compiler directives are inserted into the program. They typically contain instructions for the compiler. For example:

Pragmat heap = 32 pragmat pr heap = 32 pr Comments can be inserted in several ways:

¢ The original way to add a comment (analogous to the English phrase: Adding your 2 cents ) ¢ comment " bold " comment comment co 1 comment form co # Comment # 2 form £ This comment uses the hash / pound sign of a UK keyboard £ Normally comments in Algol 68 can not be nested. This limitation can be circumvented if different comment symbols are used (eg The hash is used only for short periods Delete).

47924
de