Worth The Wait:

JForth Professional 2.0

by Jack Woebr
It is only fitting that the micro-computer world's most brilliant hardware creation, the Amiga, should be garlanded with the most powerful software systems available. JForth Professional from Delta Research of San Rafael, California fulfills this requirement from the perspective of the professional Forth programmer.

JForth Professional is a complete software development system centered around a state-of-the-art, full 32-bit JSR-threaded Forth. Forth programmers have always been able to point to the convenience of programming in Forth, but rarely have they been able to point so confidently to the execution speed of a Forth system as they can now with JForth. When JForth 1.0 was introduced in 1986, there was no comparable Forth system on any popular microcomputer. JForth set the standard, and the Forth world raced to catch up.

JForth provides an excellent environment for Amiga programmers, from the rankest amateur to the professional. Forth is a compiled language with an interpretive layer. Code may be added to the system simply by creating a "colon definition"--- typing in the name of the routine preceded by a colon, then listing the "older" routines which the new routine is to call, and terminating the definition with a semicolon. Such definitions may be added to the system at any time, either by typing them in directly or by compiling a text file.

In traditional Forth systems, definitions are compiled into lists of addresses of the called routines. These in turn may consist of address lists and so on until, at some lowest level, executable machine code is reached. Such definitions must be "interpreted" by an "inner interpreter", a set of routines, themselves written in Forth, which understands the address lists.

This is not the case with JForth. Short code routines, when referenced in a definition, are compiled as inline

code. (The maximum length of words to be compiled inline is a programmer settable option.) References to previously defined routines---which are called rather than compiled inline--are laid down as optimized JSR's or BSR's in a clever register-addressed scheme that avoids the use of token tables.

The entire body of a JForth JSR-threaded definition is executable MC68k code. Every definition ends in an RTS. This is the fastest executing type of Forth which can be implemented on a traditional microprocessor. For a faster micro Forth you would have to buy a Harris RTX2000, a chip designed by Forth author Charles Moore specifically to execute Forth in silicon.

While JForth enjoys compiler language execution speed, the programmer never needs to sacrifice the convenience of having a fully interpretive language at his disposal. One obvious advantage of such a system is that you do not have to learn about making Amiga library calls by constant compiling, loading, and crashing. You can open windows, create graphic objects, and move things around windows while controlling them interpretively--without sacrificing compiled-code speed. You can even crash the system 'iterpretively, a great time saver over traditional compilers!

JForth comes on two disks. The first disk, JForth:, includes most of the source code in Forth for the entire system, many utilities, and the Amiga Include and FD files. The second disk, the Extras: disk, contains the minimal kernel of JForth (created from Assembly), for which the source code is not included, and two other JForth images produced by having compiled various assortments of the extensions and utilities available in source on the two disks.

The recommended precompiled development image of JForth is about 161K. The Extras: disk also includes the system-generating code for expanding the kernel to a full

development system in the Sysgen drawer. The Demos drawer contains many instructive and attractive demos with full source. The Appls drawer includes several intriguing and useful applications (including a word counter, a pretty printer, and a very dumb terminal program). The Clone drawer contains the complete source to CLONE. More on CLONE in a moment.

A session with JForth Professional starts by clicking the XICON scripts on the distribution disks. The scripts assign logical device names to several of the JForth drawers. JForth has a full interface to the normal Amiga file system, and can call up the file from

"JForth provides an excellent environment for Amiga programmers, from the rankest amateur to the professional."

which a word in the JForth image was compiled and display the file for the programmer. JForth "knows" the source file locations under these logical device names.

Double clicking on another icon brings up JForth. System initialization includes setting up traps in the 680x0 vector table so that programmer errors which should incarnate the Guru, such as odd address errors, instead evoke a mild JForth rebuke text. Of course, if the programmer is masochistic enough, he or she can compile the file RUDE.F, which generates truly shocking red-and-black system alerts. Dictionary hashing is also installed during JForth system initialization. The JForth Professional dictionary is