CURRENT NOTES NOVEMBER 1986 S T L A N G U A G E S by John Antoniades One of the nicest things that happened to ST owners is the appearance of many different languages that allow all of us to make the best use of our computer power. But when one has a lot of choices, it becomes increasingly difficult to choose a specific language package. In this article, I am going to attempt to try to point out the strengths and weaknesses of these languages and hopefully help make your decision a little easier. Note, however, that this is by no means a complete review of the existing packages. Overview Some of the languages available for the ST are: 1. Basic (Interpreted and Compiled) 2. Logo 3. C (Megamax, GST, ALCYON, Lattice, etc.) 4. Pascal (OSS-CCD, Metacomco, TDI UCSD, Prospero, etc.) 5. TDI MODULA-2 6. XLISP (Public Domain) 7. Fortran (Prospero, Philon, etc.) The two most flexible languages for software development are C and MODULA-2. They allow the user to do low and high level programming easily, since they were both designed for operating system software development. The majority of the commercial software available on the ST is written in C, although some of the newer packages are developed with MODULA-2. Pascal, C, MODULA-2 and XLISP are structured languages. This means that the programs follow a logical top-down sequence, which makes the programs easier to read and maintain. Fortran is a language aimed mostly at scientific applications. Basic was developed to introduce people to computer programming, but it is rapidly losing its audience to Pascal which was also developed for the same purpose. XLISP is an artificial intelligence object-oriented language which is widely used in expert system design (along with Prolog). Logo was designed for kids and that is what it is good for. In my opinion, C and MODULA-2 are the best choices for software development, unless there is an application which is a natural for a specific language. This does not mean that other languages are not usable, but that they do not offer the facilities of C or MODULA-2. The C Language Let's take a look at C first. C was developed at Bell Labs as a - ST 1 ST - CURRENT NOTES NOVEMBER 1986 system programming language for the UNIX operating system. C is usually tied very closely to the operating system through sets of system-specific bindings to the system's utilities. The language is fairly standardized, resulting in highly portable applications. GEM was actually written in C for the IBM-PC. C offers a structured environment with facilities for easy manipulation of anything from single bits to long floating point numbers. The majority of the public domain and demonstration software is written in C and numerous other useful programs can be found in a huge selection of language tutorials and program library collections, giving the beginner a tremendous variety of examples, which are the best guide in learning a new language. Finally, the appearance of C extensions, such as C++ and Objective C allow the user to enter the world of object-oriented languages, which are becoming extremely popular lately (with very good reason). There is a large variety of C compilers for the ST. Alcyon C is a part of the developer's kit. It comes bundled with a large set of utilities and documentation for $300. Numerous benchmarks show that it produces very good compiled code. Megamax C is a one pass system, meaning that compilation is extremely fast compared to other C's. It also does not seem to suffer from the inability to handle forward referencing. As far as the final executable file, Megamax seems to produce quite good code for most programs. It also provides one of the few nice pieces of GEM documentation in the ST market, as well as a reasonably complete development environment including an editor and resource construction set. This would be probably the best choice for a C compiler. Megamax seems to support the package quite well and has fixed numerous bugs found by the users. An imminent new version also promises removal of some limitations, such as the 32kB single block. Another nice package, especially for UNIX fans is the Mark Williams C. Its major strengths are the optimizing compiler, its excellent documentation and its wealth of UNIX tools, such as Make, Microemacs, Archiver, DEBUGGER and many others. If you like to port UNIX software to the ST this is easily your choice. Since it is a multipass compiler, it is much slower than Megamax, and it does not have a Resource construction set. But it will give you bindings to every operating system routine, including the line A routines. A nice package indeed. The MODULA-2 Language MODULA-2 is a language developed by N. Wirth, the maker of Pascal. Since Pascal was developed stricktly as a teaching language, Wirth decided to develop MODULA-2 as a truly powerful language for serious applications, while maintaining the look and feel of Pascal. Recent Pascal extensions try to provide most of the MODULA features absent from Pascal, such as separate compilation, opaque-type definitions, open arrays and many others. MODULA was designed for large software systems that can be maintained and modified with great ease. It has certainly accomplished that as well as any other language, including ADA, which is - ST 2 ST - CURRENT NOTES NOVEMBER 1986 one of the most powerful computer languages ever produced. MODULA-2 offers all of C's facilities for low as well as high level programming. And it goes beyond C, providing most of ADA's facilities in a much less complicated compiler which seems to produce the fastest code available on the ST. Program readability in MODULA-2 is one of its strengths. The language is almost self documenting. C programs are generally much harder to read than the ones in MODULA-2, and subsequently much harder to modify or maintain, and they are missing one of the most powerful features of modern languages, opaque types. The strong typechecking in MODULA-2 saves an enormous amount of debugging effort and results in faster program development. Finally, portability in MODULA-2 is excellent allowing program development in a variety of computer systems. There is only one MODULA-2 package for the ST, TDI MODULA-2. Since it contains Wirth's compiler, it indeed seems to produce the best optimized code for the ST. The ST implementation has some bugs, but TDI is constantly updating it, providing more and more useful software tools. The developer's package contains all the necessary tools for program development, as in the case of Megamax C or the developer's kit. In addition it offers a high level application library which minimizes the horrors of GEM programming for new and advanced GEM programmers alike. Its weakest point is the documentation, which in many cases lacks necessary information especially for GEM subprograms. You definitely need additional documentation to be able to use the language and the GEM interface at all. Despite that, in my opinion it is the most powerful, modern and complete language available for the ST. Other Languages On the Pascal front, the package I am most familiar with is the OSS-CCD Personal Pascal. It is an excellent Pascal implementation with many language extensions added. OSS has also added a high-level, well-documented GEM library which makes this the best available package for people starting out in GEM. Its extremely low price makes it a must for anybody's software library. It also makes the transition to MODULA-2, for more serious applications, quite easy. The Prospero Fortran compiler is a complete F77 compiler, with a lot of extensions and a GEM interface. It is an excellent choice for scientific software development, since a large part of the existing huge Fortran software base can easily be ported to the ST. And the price, at just over $100 is a lot easier to take than the price of Fortran compilers on other personal computers. Its language reference guide is quite good, but its GEM routine description is shorter than a telegram. Summary If you want a systems programming environment, your choice should probably be limited to one of the C packages (Alcyon, Megamax or Mark Williams) or the TDI MODULA-2. For learning purposes or less serious applications, OSS Pascal is your best and most economical bet. For - ST 3 ST - CURRENT NOTES NOVEMBER 1986 scientific applications Pro-Fortran is a good choice. XLISP is free so why not get it, just in case you need it. Finally, if you like Basic, you may want to consider buying a good compiled Basic. Several have been reviewed in recent issues of CURRENT NOTES. Interpreters, however, although good for debugging, are painfully slow. - ST 4 ST - 9aNu?