APL – a progamming language

10
APL – a progamming language

description

APL – a progamming language. Kenneth E. Iversion(1). 17.12.1920-19.10.2004 Kanadischer Mathematiker 1954 an Harvard-Universität in Mathematik promoviert Lehrte 1955 bis 1960 an Harvard als Assistent Professor Angewandte Mathematik Bis 1980 Forschung bei IBM - PowerPoint PPT Presentation

Transcript of APL – a progamming language

Page 1: APL – a progamming language

APL – a progamming language

Page 2: APL – a progamming language

Kenneth E. Iversion(1)

17.12.1920-19.10.2004 Kanadischer Mathematiker 1954 an Harvard-Universität in Mathematik

promoviert Lehrte 1955 bis 1960 an Harvard als

Assistent Professor Angewandte Mathematik Bis 1980 Forschung bei IBM Ab 1980 bei I. P. Sharp Associates in Toronto 1987 Ruhestand

Page 3: APL – a progamming language
Page 4: APL – a progamming language

Kenneth E. Iversion(2)

1962 Buch A Programming Language 1965 erster APL-Interpreter für

Stapelverarbeitung 1966 interaktive System APL\360 Entwurf weiterer Programmiersprachen,

darunter ab 1990 gemeinsam mit Roger Hui die Sprache J

Page 5: APL – a progamming language

Besonderheiten

Interaktivität Datentypen Speicherverwaltung Array-Verarbeitung Ausführung und Rangfolge Funktionen und Operatoren Rangfolge von rechts nach links

Page 6: APL – a progamming language

Structure of the APL2C SystemWorkspace

APL Variables + Functions + Operators

Interpreter / FrameworkDefinition and execution of functions,

Workspace handling, Session manager

APL-Primitives Functions + Operators

implemented in C

Graphical User Interface MFC / Windows NTMotif / Unix, Linux

ISO Standard C Library

Operating System

Page 7: APL – a progamming language

APL2C Data Structure

typedef struct { long length; // Total length (bytes)unsigned char type; // SIMPLE or NESTEDunsigned char rank; // Rankunsigned char eltype; // INT, ..., PNTRunsigned char reserved; // ...long lnkcnt; // no. of referenceslong number; // Number of elementslong dim[1]; // Dimensions, per axis// ... // Data (dynamic size)} aplarray;

Data header definition of an APL variable in C:

Page 8: APL – a progamming language

Data Structure - Examples (simple)

length type eltype res. number

20 SIMPLE INTG 0 1 5

rank

0

length type eltype res. number

23 SIMPLE CHAR 0 3 ‘a’

rank

1 ‘b’ ‘c’

dim[0]

3

X

X'abc'

lnkcnt

1

lnkcnt

1

Page 9: APL – a progamming language

Data Structure - Example (nested)

length type eltype res. number

28 NESTED PNTR 0 2

rank

1

dim[0]

2

length type eltype res. number

28 SIMPLE INTG 0 2 1

rank

1 2

dim[0]

2

length type eltype res. number

28 SIMPLE INTG 0 2 3

rank

1 4

dim[0]

2

Adr. Adr.

X(1 2) (3 4)lnk.

1

lnk.

1

lnk.

1

Page 10: APL – a progamming language

APL2C Symbol Table

Symbol Name Address

‘M’

‘TEST’

‘MYOP’

‘DX’

Type

Variable

Function

Operator

Variable

Central management of all APL Objects

Allows the definition of local and pseudo-local variables.