Aluminium

Language Description

There are several basic rules that define Aluminium language:

  • Applications are constructed using so called operations. An operation is basically a function that takes certain number of named arguments, and returns a value.
  • Operation arguments can be either constants, or results from other operations.
  • Each operations' result can be used as an argument for another operation only once, except the split operation.
  • Each operation is executed only if and when its' result is used by another operation (this is so called lazy evaluation).
  • In an application, one or more operations must be marked as the start points - those operations will be executed when the application is being executed (order of execution of the start points may also be specified).

Language Elements

Operation

As stated above, an operation is a function, that takes a number of named arguments, and returns a value. Operations have following attributes:

  • A name, which specifies the operation.
  • A start point mark, which can be used to specify start point operations.
  • A label, which can be used to identify particular operations (the labels don't have to be unique).

Connection

Connections are used to pass the arguments to the operations. Each connection must have an operation or a pointer on one end, and a constant, an operation or a pointer on another. Connections have following attributes:

  • Argument name, which specifies the name of the argument this connection is passing. The name can be omitted, in which case the value will be passed as the default argument (default arguments are marked with an asterisk in the operation library reference). The name can also be an asterisk (*), in which case, the value (which must be a record) will be passed as many arguments, using field names as argument names.
  • Processing instruction, that can be used to modify the structure of the value that is being passed. Currently this works like this: if the value that is being passed is a record, and the processing instruction is a name of a field in that record, only that field will get passed.

Pointer

Pointers can be used as instances of operations i.e. if an argument is passed to a pointer, it will get passed to the operation that pointer points to, and if a pointer is used as a source of an argument, the corresponding operation will be used instead. A pointer is linked to an operation when the pointer name matches the operation label.

It is possible to have many pointers that point to the same operation, also, many operations that have the same pointer pointing to them. When many pointers point to the same operation, the operation will receive all the arguments from all the pointers. When those pointers are used as arguments, the use-once rule may be broken, so the operation they point to should be the split operation.

When a single pointer points to more than one operation, all the operations will get the arguments of that pointer. But when the pointer is used as an argument itself, the behaviour is undefined.

Constant

A constant is simply a value, embedded in the application code. It can be used as an operation argument.

Data Representation

There are three basic forms data can take when passed from one operation to another:

  • A value of any type (number, text string, binary object, date, ...).
  • A list of data items (values, other lists or records). Items in a list can have different types/forms.
  • A record. It is similar to the list, except that its' items (or fields) are identified by names instead of numbers.

Also, a common structure is a table, which is basically a record that contains lists of items.