The APL c compiler project
This is a compiler, which essentially translates APL to C code. It is
based on T. Budd's original work. Some liberties have been taken with
the language. It is basically experimental, and not guaranteed to be
good for anything. But I am maintaining it and would appreciate
hearing about bugs or problems, or ports.
I have been bringing the language closer to the standard (e.g. take
and drop now behave as expected).
I've just started adding complex support (v4), including the usual
complex numbers, quaternions, and octonions (Cayley
numbers, 1i2j). are , and octionions
are not even associative.
- complex numbers can be entered as 1i2 for the usual 1 + 2 i
- Hamilton's quaternions include the complex numbers, plus two more
square roots of -1, 1i2j3k4. Note that quaternions are not commutative.
I've chosen an APL order (right to left), so
- 0i1*0j1 <-> 0k-1
- 0j1*0i1 <-> 0k1
- Cayley's octionions include the quaternions, plus four
more roots of -1, 1i2j3k4U5I6J7K8.
They are not even associative.
- 0I1*0J1*0K1 <-> 0i0j0k0U-1I0J0K0
- (0I1*0J1)*0K1 <-> 0i0j0k0U1I0J0K0
I've been meaning to have a language with all the numbers for a
while. Not sure about the transfinite ones yet...
The source code is known to compile on FreeBSD, HP, Solaris, SunOS,
Linux, Dec Alpha, SGI, Atari ST, DOS (using dj gcc; not tested in a
while). Probably not difficult to port to any unix system. As of 3.30
I'm using autoconf, which should simplify building and porting.
Currently this is split into a development version, which may have
unstable features, and a more stable version.
- Development Version. Added anonymous functions, functions as
values. Allow system fns with user ops, and vice-versa.
I've gotten tired of yacc/bison and have moved most of the
parsing to hand written parser. Much easier, probably because APL
isn't lalr or ... (maybe a packrat parser would be better?).
- Stable version (bug fixes):
APLc Language reference (TeX source included in distribution):
aplc_doc.pdf (v6.12)
Tim Budd's original code (.tar.Z)
Comments? swsirlinAtEarthlinkDotNet
apl
top