ws structure & where can i get gostscript APL font ? 
Author Message
 ws structure & where can i get gostscript APL font ?

APL uses work spaces but i have never found a book discribing the
structur of a work space ( for that matter i know nouthing of the
internal workings of APL ) can some one give o brief overview.

alsow does aneyond have a gostscript APL font?

 see that is right folks i do not have FTP privilages from this account..

--



Wed, 20 Dec 1995 18:45:36 GMT  
 ws structure & where can i get gostscript APL font ?

Quote:

> APL uses work spaces but i have never found a book discribing the
> structur of a work space ( for that matter i know nouthing of the
> internal workings of APL ) can some one give o brief overview.

Other people could probably give a better overview than this, but I'll
take a stab at it (being a fellow Edmontonian and all :-) ...

The internal format of APL wss varies greatly.

How's that for an overview?

Oh ... you wanted more ... :-)

The innards of a ws varies greatly because each company/developer tries to
get the best performance they can.  At the least, this means doing things like
storing functions in their parsed and tokenized form.  Think of it as APL in
it's compiled form.

Most of the them do, however, have similar layouts:
- symbol table
- functions
- variables
- execution stack

At the "top" of an APL workspace is the "symbol table".  It is basically the
table of contents containing a list of all the functions and active variables,
and their locations in the ws (perhaps as file offsets when stored on
disk, and as real memory locations when in memory).

Functions consist of a table of pointers to the tokenized forms of the source
code, and then the tokenized lines of the function, usually scattered
throughout the workspace (there is no benefit to storing them contiguously
since they are all indexed via a table).  One implementation I know of
stores two copies of each line of a function: an RPN form (Forth-like
with all the parens removed ready to be run be a simple Forth engine) and the
original source line as typed (the trade-off here is speed for memory).

Variables are stored in their native format:  Integers as 32-bit (or however
whatever the native word size is for the host machine) two's complement
numbers,  reals as IEEE or IBM370 floating point numbers, and characters as
ASCII or EBCDIC or whatever the native character set is.  Because EBCDIC
is pretty gross, some (all?) APL interpreters for IBM 370's pick their own
Quad-AV (APL's name for the character set).  Stored with each variable is some
information like it's type, rank, and shape.  So, to get real{*filter*}for just
a bit, the vector "iota 10, origin 0" is, if memory serves, stored in
APL*PLUS/PC (as of version 6.4 - ancient, I know) as hex:

02 00 aa bb cc dd 02 01 0a 00 00 00 01 00 02 00
03 00 04 00 05 00 06 00 07 00 08 00 09 00 XX XX

The "02 00" is a 16 bit number meaning the object occupies two 16 bit segments
The "aa bb cc dd" is a back link into the symbol table.
The "02" is the code for integer data type.
The "01" means the variable has rank 1 (a vector).
The "0a 00" is the shape of the variable (10).
Then comes the contents of the variable (here as 16 bit integers 0 ... 9).
The "XX XX" just exists to pad the object out to a 16 byte boundary (for the
PC's segmented memory).

Variables of higher rank (say 10x10x10) are stored similarly.

(The point of this was to try to give a flavor for the innards, hope
it didn't bore you too much).

The other main part of the workspace is the execution stack.
It records which function called which. It also records which variables have
been shadowed by a function's local variables:  at any point in time
all variables are "global" (if A calls B and B references variable FOO,
B can't know whether FOO is local to A or is a true global variable).
So if A does have a local variable called FOO, the value of any other variable
called FOO must be tucked away until A exits (this "tucking away" is
just done by storing in the exeuction stack a pointer to the old value).

Well, that's the layout in a nutshell.  Hope it was semi-coherent.
If it was semi-interesting, I can go on.
On the otherhand, I'll assume silence means "please, someone,
shut this guy up :-)".  Hey, just be thankful I don't make my living
writing documentation!

--
Doug Evans           Cygnus Support, Mountain View, CA



Mon, 25 Dec 1995 02:59:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. APL Transliteration & WS Transfer

2. XP and APL font for APL-PLUS II?

3. APL newcomer needs APL font for Mac...

4. Looking for good APL encrytion algorithms for WS proctection

5. Resurrecting an old APL WS

6. APL+WIN and *.WS extension

7. Ampere WS-1 APL Laptop

8. Ampere WS-1 APL Laptop

9. APL Language Tutorial WS?

10. apl ws transfer

11. WS in APL / J

12. plotting ws for APL+III/win?

 

 
Powered by phpBB® Forum Software