APL – a progamming language
description
Transcript of APL – a progamming language
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
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
Besonderheiten
Interaktivität Datentypen Speicherverwaltung Array-Verarbeitung Ausführung und Rangfolge Funktionen und Operatoren Rangfolge von rechts nach links
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
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:
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
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
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.