Pro-Fortran 77

Reviewed by Matthew Jones

 

Issue 22

Jul/Aug 86

Next Article >>

<< Prev Article

 

 

Prospero Software

FORTRAN was one of the first high level languages. It was designed for engineers and scientists to do fast mathematics (hence the name FORmula TRANslation) in a machine independent way. A Fortran compiler has been written for just about every mainframe computer, and due to its relative portability and easy access, a vast amount of scientific and other software has been written using it.

An example of the sort of software that has been written in Fortran is a program called COPE, a decision support system, which has been under development for over 7 years at the University of Bath (where I happen to work). Fortran was all that was available when the program was started, and now, even with more powerful languages around, re-writing 16,000 lines of code is hard to justify, so an available Fortran compiler is necessary if it is to be used on a micro. Prospero Software's Pro-Fortran 77 aims to fill this role on the Atari ST.

THE COMPILER

Pro-Fortran is a full implementation of the ANSI Fortran 77 standard running on the ST under GEMDOS. In operation the compiler is quite simple, and there are several different ways it can be used, but generally you specify the source filename and are then prompted with each of the various options the compiler has. These include echo of error messages to a disk file, range checks on subscripts and/or assignments, a line number track for debugging, a listing and map facility, and INTEGER means INTEGER*2 switch, and a useful facility to report undeclared variables (marvellous for spotting typing mistakes). You can accept the defaults or change them (permanently if you want), and then the compilation starts.

Each program module is named as it compiles, and errors are displayed on screen, complete with the text of the erroneous line and an indication of the faulty character. This is where I discovered how tight to the specification Pro-Fortran sticks. I compiled several of the COPE source files and discovered that Pro-Fortran is very pernickety about getting statements correct, whereas the Fortran on the IBM PC where the code came from accepts our slight sloppiness. The particular examples are: that Fortran labels (names of subroutines and variables) are only significant to six letters, and our code which has several seven and eight letter names was thrown out; and cheating with character arrays by comparing them with integers (i.e. IF(D(2).EQ.32)) is also illegal and must be done properly (IF(D(2).EQ.CHAR(32)). In general such adherence to the specification is a good thing, as it encourages good programming practice, something the language generally doesn't do (it is not a structured language).

Speed-wise the compiler seems quite acceptable in comparison with other compilers, and it produces BIN binary files suitable for input to the GST linker which seems to be becoming the standard linker for the U.K. (and elsewhere I hope). The various .BIN files of your program are linked in with the Fortran library interface, and can then be run.

THE LIBRARIES

The libraries provide all the standard functions, and a few machine specific routines. What really makes the library stand out is the way it is used. It really is rather odd, and is the first time I have ever seen or heard of anything like it. Your code is linked with interface code which looks for, then uses, a section of code called PRL (Prospero Run-time Library) which is loaded completely separately. Most other systems include the library (or required parts of the library) in with the rest of the program so there is only one load. A few systems I have seen load the library at run-time from a separate file, but a completely separate load is very unusual. If PRL is not resident, your code will not run.

The reason for this behaviour is that your program can automatically run others, and each child program uses the same PRL code, thus cutting the memory requirement of each program. In principle a sound idea, but such spawning is not standard Fortran, and this system is added hassle to the end user. Prospero do suggest putting PRL in the AUTO folder, but unless you are a regular Fortran user, this seems to be inconvenient as it may have side effects in other programs.

THE MANUAL

The half-inch thick manual that accompanies the compiler comes in a very smart blue ring binder and box. It is written in three parts, a general overview, complete language definition, and how to use the various parts of the compiler. The language definition will provide a useful reference to Fortran in general, but it also covers the additional library functions such as GETCOM (get command line), RANDOM, IPEEK, POKE, DATE, TIME, EXECPG (the run-another-program facility), a TOS call (SYS), and a complete set of GEM AES and VDI calls. It is this latter facility that I think gives Prospero Fortran a great bonus. Until now, no Fortran has been designed with a GEM interface in mind, and this will prove very tempting to authors. What does put a damper on this though is that Prospero have no plans to include GEM libraries in their IBM PC version of Fortran. This means that applications cannot be ported between the two easily which, if possible, would double the market and reduce the risk for developers.

CONCLUSION

Pro-Fortran 77 is a good, useable Fortran compiler, and apart from my reservations about PRL, is quite suitable for developing serious applications with. Those who want a Fortran on their ST will be pleased, but what makes it for me is the GEM interface.

Finally, the price (approximately 130 pounds) is reasonable for a Fortran compiler, but I hope the level of support matches.

top