Aldor

from Wikipedia, the free encyclopedia

Aldor is a programming language that is mainly used in the field of computer algebra systems.

history

Aldor was 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 to expand Axiom and was also distributed together with Axiom from 1994. Another name, Axiom XL (Axiom Extension Language), was derived from this.

The A # compiler was presented to the public for the first time in 1994. This compiler translated Aldor programs into an intermediate language called Foam , for which a compiler already existed. This enabled both independent programs and program libraries to be created. In addition, C and LISP codes could also be generated. The compiler itself was mainly written in C, to a small extent also in A #, and ran under DOS , UNIX , OS / 2 and other operating systems.

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

Since 2001, Aldor has been sold independently from Axiom via its own website. In 2004 an interface was published that enables Aldor to be used with Maple .

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

Speech characteristics

Aldor's syntax is influenced by Pascal . As with Python, indentation is optionally taken into account.

Aldor possesses characteristics of both imperative and object-oriented and functional language. The overloading of functions and operators is supported.

Type system

The type system is static , implicit , not type-safe and allows the use of types and functions as first-class objects . Like many other functional languages, Aldor uses strong typing . For computer algebra systems, however, strong typing is unusual. Due to the mathematical nature of the language, Aldor's type system is more complex than the type systems of other languages.

Aldor also supports dependent typing . This is a form of polymorphism in which types can also be dependent on values. For example, functions of the type (n: Integer) → Vector (n) → Double are possible . Such a function could be avg , which receives a number n and a vector with n elements and calculates the average of the elements of the vector.

The dependent typing is restricted by the fact that the values ​​are not evaluated during the type test. This means that Vector (2) and Vector (1 + 1) are different types. Dependent typing is still considered difficult today and can only be combined with static type testing with restrictions.

License

Aldor is published under the Apache license and is therefore free software .

example

Hello world program
#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

Web links

Individual evidence

  1. ^ Michael Kaplan: Computeralgebra . Springer, Berlin / Heidelberg 2005, page 329
  2. Stephen M. Watt, Peter A. Broadbery, Samuel S. Dooley, Pietro Iglio, Scott C. Morrison, Jonathan M. Steinbach and Robert S. Sutor: A First Report on the A # Compiler (PDF; 194 kB) . International Symposium on Symbolic and Algebraic Computation 1994
  3. Yannis Chicha, Florence Defaix and Stephen Watt: Interoperability of Languages ​​with Generics, using Aldor, C ++ and Java (PDF; 108 kB) . Frisco Workshop 1999
  4. Cosmin Oancea and Stephen M. Watt: A Framework for Using Aldor Libraries with Maple (PDF; 83 kB) . Actas de los Encuentros de Algebra Computacional y Aplicaciones 2004
  5. Simon Thompson and Leonid Timochouk: The Aldor-- Language . Computing Laboratory, University of Kent at Canterbury
  6. Erik Poll and Simon Thompson: Integrating Computer Algebra and Reasoning through the Type System of Aldor (PDF; 222 kB) . 3rd International Workshop on Frontiers of Combining Systems 2000
  7. Erik Poll and Simon Thompson: Adding the axioms to Axiom: Towards a system of automated reasoning in Aldor . Computing Laboratory, University of Kent 1998
  8. ^ Peter Pepper and Petra Hofstedt: Functional programming . Springer, Berlin / Heidelberg 2006, page 152