The foo language in TONTO

TONTO is different from other programs because it is written in a preprocessor language called foo. This language is essentially a terse form of Fortran95. Indeed, it currently translates into Fortran95.

The foo language has been adopted for two reasons.

The first reason is because the object based paradigm is easily expressed in the foo language. A dot notation has been introduced which blurs the distinction between a routine and a derived type component. This makes it very flexible to further change. TONTO has already been written from the ground up about four times. There are other advantages when using foo which involve the automation of a few laborious tasks associated with object based programmming---for example the automated generation of interface definitions or overloaded names.

The second reason to use foo is because the documentation can easily be extracted from the code. Indeed, the code is intended to be self documenting (although in practice this is entirely dependent on the discipline of the programmer).

We have chosen to use Fortran95 as the base language in recognition of its its tradition of providing highly optimizing compilers for heavy numerical computation. This tradition is due in part to Fortran's good aliasing properties for pointers, and to favourable expression re-arrangement properties. Another significant reason for using Fortran95 is that it is backwards compatible with Fortran77, so the significant existing body of old code can be used as a starting point, and then gradually replaced. Fortran95 also has some very elegant built-in array manipulation mechanisms which are not available, or not so elegant, in other languages.

We have chosen to use a preprocessor because we believe that the code will then be more robust and portable. In particular, it is hoped that algorithms written in foo will be language independent.

While we have chosen to use a preprocessor in our system, we do not desire to force people to use it. The system is flexible enough to allow standard Fortran programming, or linking to other Fortran programs.