English Software's E. S. Forth

Reviewed by Steven Burke



Issue 14

Mar/Apr 85

Next Article >>

<< Prev Article



FORTH is an increasingly popular language, and E. S. FORTH is one of several versions available for ATARI computers. It will run on 400, 800 and XL models having at least 32K. Cassette and disc versions are available, and both are very good value.

Operations are carried out in FORTH by executing commands, known as "words". Every version of FORTH contains a "dictionary" of these words. A FORTH program is written by defining new words, which are added to the dictionary, to perform new functions. This is done by writing chunks (or "screens") of source code containing the definitions, which are then compiled into the dictionary.

FORTH is a structured language, in that the program flow is not controlled by jumping between numbered program lines, as in BASIC. This forces the programmer to think more carefully before he starts writing his program, and results in the program being much better organised. It also means that it is much easier to keep lots of different program utilities which are loaded in at will without worrying about conflicts between line numbers.

FORTH is claimed to have a number of advantages over BASIC, especially that of speed. It is indeed much faster than BASIC, but this does not mean that you can use FORTH to write arcade-quality programs with the same ease as ordinary BASIC programs. If necessary though you can speed things up further by using machine code routines. FORTH is much more versatile than BASIC, and allows the user far more control over what is happening inside the computer. For this reason I find it a much more pleasing and interesting language to use.

E. S. FORTH is based on a standard called fig-FORTH, but claims to have been internally optimised for speed and efficiency. I tried a few crude bench tests and found that it did indeed run noticeably faster than two other fig- FORTH based ATARI languages. The version of E. S. FORTH I tried was cassette based. This reduces costs when compared with cartridges, and renders it available to those users who do not have disc drives. However, like all RAM based languages a program crash often means switching off the computer and starting again from scratch, which can be time consuming when you have to load the language off a cassette.

An area of RAM is set aside to simulate a disc, and contains a number of screens into which the user can write source code for his FORTH program. The size of the area (and hence the number of screens) is set by the user at the start of a programming session. Screens are written using the ATARI screen editor, as in BASIC, except that the user must remember when altering a line to insert "P"' between the line number and the line's text. Otherwise strange things happen. Other editing facilities are also provided, these are standard FORTH editing commands, although in E. S. FORTH they are permanently resident and operational, which is not usual.

Once the screens have been written they can be stored individually or as a set on a cassette, and can be compiled into the language's dictionary to enable the program to be run. Five screens can be simultaneously stored in a 32K system and still leave room for a complex compiled program. More screens can be accommodated by sacrificing display and/or dictionary memory. However this is not necessary if you are willing to write your program in separate sections which are successively retrieved from cassette and compiled which, with a little thought, could be done automatically.

The basic dictionary of E. S. FORTH contains nearly all the standard fig-FORTH commands. Those that are missing relate mainly to the use of discs. It should be noted that one of the beauties of FORTH is that in principle adding new words, for example to make up for omissions in the basic dictionary, should not present problems, so long as the functions of the words are understood.

The E. S. FORTH dictionary is also well-stocked with commands specifically for the ATARI These are mostly like corresponding BASIC commands They include I/O words such as OPEN, CLOSE PUT GET. graphics words such as GRAPHICS, COLOR, PLOT, DRAW, as well as other types of words, e.g.. STICK, SOUND, etc. There are however a number of commands which do not have BASIC counterparts. There is for example a very useful PLAY command, which is like SOUND except that it has a time parameter, so that the sound stops after a preset duration. Processing continues while the sound is playing.

There are also commands to make it much easier to design and use custom character sets, but the most useful of these extra commands are the Player-Missile utilities. A single command sets up the registers and allocates screen memory. Other commands are provided, e.g. for defining and switching between player shapes (to permit animation), for moving the players and missiles, setting their colours and widths, etc. Controlling player movement in response to a joystick is made particularly easy. Anyone who has tried writing even simple Player-Missile routines in BASIC will know how tedious this can be, especially if you have to resort to clever little programming tricks to get the players to move quickly enough. Having a language that can handle this for you makes a very pleasant change, and for this reason alone I would recommend E. S. FORTH.

Some versions of FORTH are provided with an assembler, which enables new words to be defined in machine code to increase speed, but unfortunately E. S. FORTH does not have one. Instead it is possible to run the language with the ATARI ASSEMBLER/EDITOR cartridge in place, and switch control between FORTH and the cartridge. This is useful in some situations, but makes saving and loading FORTH programs written partly in assembly language awkward. However, some public domain assemblers have been written in FORTH, and the interested user should be able to get hold of a source listing without too much difficulty.

A more serious omission is the lack of any command to allow the FORTH dictionary (including any new words which the user has defined) to be saved on cassette. This means that every time you wish to run a program or utility, you have to load the language itself and then load in and compile the source code (i. e. the screens), which could take a considerable time particularly if you have several different utilities which you want to use together. The experienced user would find a way to solve this problem, but for the beginner it could be a real nuisance.

The documentation supplied with E. S. FORTH is not, and does not claim to be, adequate for the beginner. No attempt is made to teach FORTH, and as this language is so different from BASIC, especially in its "backward" looking syntax, the novice would need to buy a suitable book. As E. S. FORTH is so cheap this is not unreasonable. Much of the book supplied with E. S. FORTH is taken up with a reproduction of literature issued by the FORTH Interest Group, including a glossary of fig-FORTH words and a "model" which explains in detail the inner workings of the language and which would be useful (and comprehensible) only to the very experienced user. The rest of the book contains enough to explain those features specific to E. S. FORTH, and includes short programs to demonstrate the Player-Missile utilities.

Anyone who likes programming but only knows BASIC doesn't know what he's missing. Even ignoring the usefulness of the FORTH language, just learning how to use it and what it can do is fascinating. If you are interested in computing, rather than simply playing games you have bought, then you can't fail to get excellent value by buying E. S. FORTH.