Summary
Objects of any type are represented by pointers. Each type has an associated "storage structure": an array of 16 addresses and usually also a block of storage for 16 (temporary) objects to which these addresses point. A bit map keeps track of which addresses are in use. When a computation requires a temporary, the next available address is found an the result is put in the associated temporary storage location. The address is put on the stack. When all locations are marked, a small garbage collection procedure determines which of the 16 locations are still active (i.e. which addresses are on the stack -- or some other specified places). This method has been used both for data of fixed maximum size (for which the temporary storage can be allocated in advance) and for dynamically allocated storage.
The original article, written in
1988, provides a more complete discussion and rationale for this mechanism.
The source code included is for F83 -- both high level Forth and assembly
language. The original manuscript can be downloaded as a .PS file.
No attempt has been made to revise or modernize the paper. However
an adaptation to Win32Forth is provided separately. It should run on most
modern Forth systems. A complete strings package is given for F-PC using
a version of TempSto written in assembly language.
Summary
This interface has been used in a student lab for a mathematics class. The Forth application is turned over to the computer center, so the original system was not changed once it was put on the server. All changes and extensions were made by having the Forth application read an "updates" file (in the "public" directory) after it was loaded. During the course, extensions to the application and interface were made in this file. Most students in the class did not know computer programming; none knew Forth. This interface provided (1) a quick and easy way for non-programmers to use a Forth application; (2) ability of the instructor to extend the interface (along with the application) without recompiling the system.