Aldor (free it!)
The programming language Aldor, aka A#, seems to be a well-kept secret. It started off as the compiler for Axiom, Axiom-xl, but has since developed into an interesting standalone language in its own right. It reminds me of Scheme, C/C++, Python, and Perl 6 to varying degrees. In particular (with respect to being similar to Perl), where Perl has Parrot and Java has the JVM, Aldor has FOAM, the First Order Abstract Machine:
A major part of the tex2html_wrap_inline302 compiler is concerned with producing optimized intermediate code, or Foam code. “Foam” is an acronym for “First Order Abstract Machine.” The abstract machine is first order in the sense that it does not treat its types as values.
Foam is designed to contain only those concepts which can have an efficient realization in both Lisp and C. For example it is not possible to take an address of a variable because that would be inefficient in Lisp (a closure would be created). Nor are dynamic type tests allowed, as that would be inefficient in C. We have been asked how the lack of address arithmetic limits the potential performance of compiled tex2html_wrap_inline302 vs hand-coded C which uses pointers to traverse arrays in inner loops. It is our experience that this is a minor concern on current architectures with optimizing compilers.
Foam is not restricted to the precise intersection of C and Lisp. Some aspects are handled by support libraries. Big integer arithmetic is assumed as part of Foam, and this is provided as a library for C. Also the memory model differs from both C and Lisp in some details: garbage collection is assumed (this is a run time support library in C) and it is possible to make an explicit request to free storage (in Lisp this is ignored).
A Foam program is comprised of a flat sequence of commands. Foam types have various sizes and uses. or example, “Char” is a text character whereas “Byte” is a character sized integer, “DFlo” is a double precision floating point, “Ptr” can point to an array, record, arbitrary sized integer, etc. Reference instructions contain the kind of reference and the position, e.g., “Loc 3” refers to the third local variable of the current function and “RElt 7 x 2” indicates the 2nd field of the record x, using the 7th layout format. Foam operations consist of instructions, such as “If b n,” which indicates that if b is true then proceed to label n, and builtin operations, e.g., “HIntLT a b” is a half-word-integer less-than comparison. The builtin operations are type specific and conversion operations are generally provided. A detailed description of Foam is given elsewhere [26].
The abstract machine does not support asharp types directly and relies on the code generator to produce appropriate calls to create and maintain types. This has the advantage that one can use these calls to add new representations of types to the system. These representations may be written in tex2html_wrap_inline302 itself, or some other language. This is used in order to interface with the Axiom system, and may be extended to other object/type systems, such as CLOS [21] and C++.
Also, since Aldor evolved out of Axiom, where one might want to coerce types like Polynomial Integers to Polynomial Reals on the fly, or reorder the types in a hierarchy, it supports functions and types as first class objects. This makes for the most interesting features of the language.
Then there are several libraries which make Aldor look like a particularly good system for implementing computer algebra algorithms on: Algebra and Sumit, by Manuel Bronstein, support basic CAS facilities and the solution of first order linear differential/difference equations, respectively. There’s also an older BasicMath library from NAG which seems to support a rather respectible subset of CAS facilities, e.g. subresultants. Of course, considering its origins, it’s also probably trivial to use Axiom from Aldor.
Maybe the biggest reason that Aldor isn’t as well known as it could be is that it is not free– binaries are available for non-commercial use, but the source is not, even though Aldor is not being commercially distributed. Anyhow, in this day and age, what profit is there in commercial general purpose languages? Although it would be more convenient to use Aldor, I suspect most researchers/implementors of CASes (the two classes of people I see most likely to be attracted by Aldor’s particular strengths) will be more willing to reinvent several wheels than depend on a potentially capricious licensor. Too bad, but some Axiom developers are gathering a petition together– go sign it!
Possibly relevant posts:
- Axiom vs other CASes (12/18/2003)
- Programming related stuff (10/15/2004)
- SSH Key Authorization (9/30/2005)