Aldor

Aldor is a programming language that is used primarily in the context of computer algebra systems.

History

Aldor has been developed since 1985 at the Thomas J. Watson Research Center under the direction of Stephen M. Watt, from the beginning of the 1990s, in cooperation with the Numerical Algorithms Group. Initially, the language was referred to as A #, served as the extension of Axiom and was from 1994 also sold together with Axiom. Hence initiated a further interim name, Axiom XL ( Axiom Extension Language ), from.

In 1994, the A # compiler was first presented to the public. This compiler translated Aldor programs into an intermediate language called Foam for which there was already a compiler. Thus both standalone programs and libraries could be created. In addition, could also C and LISP code can be generated. The compiler itself was mostly in C, written for a small part in A # and was run under DOS, UNIX, OS / 2 and other operating systems.

Since 1999 Aldor can also be used together with C . Aldor programs can use written in C code, the compiler also generates request the necessary interfaces to programs written in Aldor call part of a C program.

Since 2001, Aldor is distributed independently of Axiom on their own website. 2004 interface has been published, which makes it possible to use Aldor with Maple.

At the University of Kent was Aldor - developed a functional language based on a subset of the language Aldor.

Voice Features

The syntax of Aldor is influenced by Pascal. Optionally, the indentation is taken into account as in Python.

Aldor has features of both imperative and object-oriented and functional language. Overloading of functions and operators are supported.

Type System

The type system is static, implying not type safe and allows the use of types and functions as first-class object. Like many other functional languages ​​used Aldor strong typing. For computer algebra systems strong typing, however, is unusual. Due to the mathematics of the reference language, the type system of Aldor is more complex than the type systems of other languages.

Aldor also supports dependent typing. This is a form of polymorphism, wherein the type can be a function of values ​​. Are possible so that, for example, functions of type ( n: Integer) → Vector ( n ) → Double. Such a function could be avg, the n is a number and a vector with n elements receives and calculates the average of the elements of the vector.

The dependent typing is limited by the fact that an evaluation of the values ​​does not take place during the type test. The result is that about Vector ( 2) and the vectors (1 1) of different types. Dependent typing is still considered difficult and can be combined with static type checking with some restrictions.

License

Aldor is released under the Apache license and thus free software.

Example

# include " aldor " # include " aldorio "   stdout << " Hello, world!" << Newline; 99 Bottles of Beer # include " aldor " # include " aldorio "   import from Integer, String;   bob ( n: Integer): String { ==      b: String: = " bottle";        if n ~ = 1 then b: = b " s";      b " of beer "; }   main (): () == {      n: integer: = 99;      otw: String: = " on the wall";        - refrain      while n> 0 repeat {          stdout << n << bob ( n ) << otw << ", " << n << bob ( n ) << ". " << Newline;          stdout << " Take one down and pass it around, ";          n: = n - 1;          if n > 0 then stdout << n;          else stdout << " no more";          stdout << bob ( n ) << otw << ". " << Newline;          stdout << newline;      }        - Last verse      stdout << "No more" << bob ( n ) << otw << " no more" << bob ( n ) << ". " << Newline;      stdout << "Go to the store and buy some more, ";      n: integer: = 99;      stdout << n << bob ( n ) << otw << ". " << Newline; }   main (); literature

  • John grave Meier, Erich Kaltofen and Volker Weispfennig: Computer algebra handbook: foundations, applications, systems, Volume 1 Springer, Berlin / Heidelberg 2003
43100
de