Tuesday, June 07, 2005

DALI - the next instalment

Continuing the (unoriginal!) DALI language specification (see below for more details).

Temporally Global Variables

Example:
var temporal real a,b;

The temporally-global variable is one of DALI's most powerful features, since it allows the tedious processing to be performed at the end of the program, where a little extra delay is not critical. For example, consider the following program fragment:
var temporal real s;
...
writeln(s);
for a=1 to 10000000 do s=s+1/a


The program makes use of the temporally-global variable s to print the result before calculating it, thus allowing the tedious calculation to be done after printing the result, whilst the user is busy reading the output, drinking coffee etc.

[NB the original count was from 1 to 1000 - and yes, you would have had time to do those things - especially if you were running the program close to the EAGLE Delta]

HW

The HW command has no parameters, and returns no values. It simply prints the message, "Hello World" to the standard output. It is provided in order to improve the language's performance in the unofficial conciseness benchmark that most programming language books seem to use.

NB: Execution of this command requires 80 GB of hard disk space, a 128 MB graphics card, two DVD-RW drives and a broadband connection.

[NB the original referred to a lecturer at Cambridge University who would display a message "Wake Up" {or more usually "WAKE UP", computers being what they were}, and 512k of available memory on the heap. You'd be lucky if you could get a computer to crash with that little memory these days - those were the days]