Vous êtes sur la page 1sur 30

ALGOL

ALGOL 58, ALGOL 60 and ALGOL 68

HISTORY
ALGOL was developed jointly by a committee of European and American
computer scientists in a meeting in 1958 at Zurich

ALGOL (ALGOrithmic Language) First formalized in a report titled ALGOL 58 Progressed through reports named ALGOL 60 ALGOL 68. It was designed by an international committee to be a universal
language.

ALGOL 58

HISTORY ALGOL 58
Released in December 1958 with great reception. Americans look at it as a collection of languages instead of an universal language. Inspired three majordesigns:
MAD-Michigan Algorithmic Decoder NELIAC-Navy Electronics Laboratory International ALGOL Compiler JOVIAL-Jules Own Version International Programming Algorithmic LanguageUsed by U.S Air Force by Jules I.Schwart.

Objectives
Close to standard mathematical notation and readable with little further
explanation Possible to use it for the description of numerical processes in publications Readily translatable into machine code by the machine itself

Three different syntaxes


reference syntax publication syntax implementation syntax.

Design Process

Syntax should be as close as possible to standard scientific notation. Readable. Easy to learn and easy to understand.

Simplicity for periodical publications describing the computing process.


Programs should be mechanically translatable into machine language.

3 Complication of Algol 58
developing new compilers

training new personnel


motivate people to a new language

ALGOL 60

ALGOL 60
ALGOL 60 (short for ALGOrithmic Language 1960) is a member of the ALGOL family
of computer programming languages. It gave rise to many other programming languages, including: BCPL B PASCAL Simula C ALGOL 60 was the first language implementing nested function definitions with lexical scope.

ALGOL 60 Reserved words and restricted identifiers


There are 35 such reserved words in the standard Burroughs large systems sub-language:

ALPHA ARRAY BEGIN BOOLEAN COMMENT CONTINUE DIRECT`

DO DOUBLE ELSE END EVENT FALSE FILE

FOR FORMAT GO IF INTEGER LABEL LIST

LONG OWN POINTER PROCEDURE REAL STEP SWITCH

TASK THEN TRUE UNTIL VALUE WHILE ZIP

There are 71 such restricted identifiers in the standard Burroughs large systems sub-language:

ACCEPT AND ATTACH BY CALL CASE CAUSE CLOSE DEALLOCATE DEFINE DETACH DISABLE DISPLAY DIV DUMP

ENABLE EQL EQV EXCHANGE EXTERNAL FILL FORWARD GEQ GTR IMP IN INTERRUPT IS LB

LEQ LIBERATE LINE LOCK LSS MERGE MOD MONITOR MUX NEQ NO NOT ON OPEN

OR OUT PICTURE PROCESS PROCURE PROGRAMDUMP RB READ RELEASE REPLACE RESET RESIZE REWIND RUN

SCAN SEEK SET SKIP SORT SPACE SWAP THRU TIMES TO WAIT WHEN WITH WRITE

ALGOL SAMPLE CODE


BEGIN FILE F (KIND=REMOTE);

EBCDIC ARRAY E[0:11];


REPLACE E BY HELLO WORLD !; WRITE(F, *, E); END .

A SIMPLIER PROGRAM USING INLINE FORMAT:


BEGIN FILE F (KIND=REMOTE);

WRITE(F, <HELLO WORLD!>);


END.

SIMPLIER PROGRAM USING THE DISPLAY STATEMENT


BEGIN DISPLAY(HELLO WORLD!) END.

An alternative example, using Elliott Algol I/O is as follows. Elliott Algol used different characters for "open-string-quote" and "close-string-quote", represented here by and .
Program hi Folks; begin

print Hello world


end;

ALGOL 68

Is an imperative computer programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously defined syntax and semantics.

Its features include expression-based syntax, user-declared types and structures/tagged-unions, a reference model of variables and reference parameters, string, array and matrix slicing, and also concurrency. was designed by IFIP Working Group 2.1

was defined using a two-level grammar formalism invented by Adriaan van Wijngaarden
was the first (and possibly one of the last) major language for which a full formal definition was made before it was implemented.

Main aims and principles of design of ALGOL 68


Completeness and clarity of description

Orthogonal design,
Security, Efficiency:

Static mode checking Mode-independent parsing


Independent compilation

Loop optimization Representations - in minimal & larger character sets

In 1970, ALGOL 68R became the first working compiler for ALGOL 68.

In the 1973 revision, certain features - such as proceduring, gommas and formal bounds - were omitted.

Operating Systems written in ALGOL 68

Cambridge CAP computer Eldon 3 Flex machine VME

Program representation
Representation language - used to describe algorithms in printed
work

Strict language - rigorously defined in the Report Reference language - intended to be used in actual compiler
input.

int a real int = 3 ;

Stropping regimes - methods to denote identifiers

The basic data types (called modes in Algol 68 parlance) are : >Real >Int >compl (complex number) >Bool >Char >bits and bytes.

Primitive-declarer:

bits - a "packed vector" of bool. bytes - a "packed vector" of char. string - a flexible array of char. Sema - a semaphore which can be initialised with
the operator level.

flex - declare the array to be flexible, i.e. it can grow in

length on demand. heap - allocate variable some free space from the global heap. loc - allocate variable some free space of the local stack. ref - declare the variable to be a pointer, similar to using "&" in a C declaration. long - declare an int, real or compl to be of a longer size. short - declare an int, real or compl to be of a shorter size

Example:

int max=99; mode newtype = [0:9][0:max]struct ( real a, b, c, short int i, j, k, ref real r );

long

THANK YOU!
RAINNALYN CAPARAS KRISTINE DIANNE TECSON MARINEL NOCON HERMOGENES AMORES ADRIAN AMOR PEREYRA

Vous aimerez peut-être aussi