|★ APPLICATIONS ★ PROGRAMMATION ★ BORDAND - TURBO MODULA 2|8000Plus) ★|
|Bordand - Turbo Modula 2||Applications Programmation|
Turbo Pascal became a 'cult' programming language. Will the same happen to the latest release from Borland International?
If you'e using your PCW for 'serious' programming, rather than this mamby-pamby BASIC or Logo stuff, you might like to consider a ‘real' language. Pascal's successor in the structured programming world is Modula 2. It's a language which produces fast, compiled programs, but is quicker to use than many, since it produces interdependent ‘modules'.
Turbo Modula 2, like many computer languages, is a rather ephemeral product. You receive a disc and a doorstop of a manual, but little in the way of the fancy packaging that you normally expect with software releases. What you're buying is not the paper or plastic of the physical product, but the facility to produce fast and useful programs in a compact and flexible version of a modern computer language.
Turbo Modula 2 runs from CP/M, like Mallard BASIC, but unlike Mallard it comes complete with a full screen editor, and its own operating environment. As well as adapting the compiler to your own needs, you can display directories, and copy, rename and delete files without having to leave Modula 2.
The editor is quite closely based on WordStar, but cut down to leave only the functions likely to be of use to a programmer. So, for instance, you can search and replace a variable name with another, scroll or page through your program, copy blocks of commands from one place to another and read in sections of program from other files. It makes program writing a lot more enjoyable.
Once you've written the program, you need to compile it. Turbo Modula 2 compiles quite quickly, though not as fast as its Pascal stablemate. Where it wins over Turbo Pascal, though, is in its facility to incorporate previously compiled modules of program, rather than having to compile everything each time a minor alteration is made.
Turbo Modula 2 can compile to 'M' code, which is a sort of half-way house between the program you write and machine-code, or go on to produce a faster machine-code file which can be run straight from CP/M. The advantage of using 'M' code, certainly while developing a program, is that it takes up much less room.
If the compiler finds an error in your program while it's compiling, it calls up the editor and positions the cursor at the offending point in the code. Once you've fixed the problem, the compiler starts up again from just before the error. In short, alot has been done to make program development as easy as possible.
A program in Modula 2 consists of keywords, variable names, numbers and operators (like and I), Many of the keywords themselves, however, are not included in the language! Modula 2 includes a basic set of commands, and any others are supplied in a 'library' of pre-defined modules, When you want to use a keyword out of one of these modules, you use the statement:
FROM modulename IMPORT keyword1, keyword2 etc
This system means that the language can be extended simply by adding extra modules with the programs for specialist keywords in them. Clever, eh?
In the time available for review, it was only possible to test the compiler on fairly short programs, of which two of the shortest are listed here. You can see that there's a dramatic speed improvement even when writing characters on the screen, which is normally governed more by CP/M itself than by the programming language.
If you liked Turbo Pascal, you'll love Turbo Modula 2, As well as the improvements in Modula over Pascal, the Turbo system has been enhanced to provide what must be the best programming environment in CP/M today.