Last update: Feb 13, 1994
Last update: Sun March 10, 1996
Last update: Tue April 30, 1996; converted to HTML.
Last update: Sat Aug 10, 1996; link to tForth article.
tForth
is a Forth with parallel facilities. It generates code for the
INMOS range of transputers.
From 1990 to 1994, tForth was the main project of the DFW, the Dutch Forth Workshop. tForth implements all words of the current ANS-Forth standard (all words). We consider it debugged. Here is our EuroForth '92 presentation.
Parallel Forth?
Transputers have a name with regards to parallel programming, especially in combination with the OCCAM language.
The main feature of tForth is that it removes the rigidity of existing C and OCCAM environments. It is not too long ago that INMOS refused to disclose details about the transputer instruction set and insisted its customers program in OCCAM exclusively. The DFW feels that some users will be more productive using Forth, certainly in the earlier stages of the development cycle (using tForth as a rapid prototyping language).
Standard features
- tForth supports all of the transputer hardware: hardware task-switching, hardware floating-point, the on-chip timer, the links. For the T4 there is a simple floating-point emulator.
- Conforms to the ANS Forth standard. All ANS word sets and their extensions are fully (all words) supported: CORE BLOCK DOUBLE ERROR FACILITY FILE FLOAT LOCALS MEMORY TOOLKIT SEARCH and STRING.
- Full 32-bit system, incrementally compiling to machine code. Speed of high-level words is about two times slower than hand-optimized assembly language. (The generated code beats most transputer "C" implementations with regards to speed and size for anything but trivial programs. It is faster than all of them by an order of magnitude with regards to compile and link speeds: ready to execute a 4700 line program consisting of 11 source files within 30 seconds, where the INMOS ICC will take 84 seconds to compile and link the Sieve of Eratosthanes, a single-file program of 39 lines). Highlevel words can be mixed with machine code primitives, in-line generation of machine code is possible (but seldom necessary).
- tForth can be loaded at any available transputer address. It always claims the on-chip RAM for its workspace, but that can be changed if unacceptable. tForth will use all the memory that is available, dynamically as well as statically, or it can be deliberately shrunk to a workable minimum of 192 Kbytes, which still has 73 Kbytes free for user programs.
- OCCAM constructs like PAR, ALT and PRI PAR have tForth counter parts, but tForth also allows dynamic memory management and recursion, which are not available in OCCAM. The on-chip timer and the transputer links are accessible with high-level Forth words. Semaphores and queues are implemented and are used in our I/O and memory management system to enable multi-process I/O.
- tForth has an integrated optimizer and runs only about 2 times slower than hand-optimized assembly language. There is an ASSEMBLER vocabulary to get the extra speed if needed. The assembler supports all documented (and some undocumented) instructions for every transputer model known to us. It is possible to cross assemble for other models, the assembler emits warnings if the code is not executable on the host hardware.
- Symbolic disassembler loads on demand.
- Several flavors of debuggers and profilers.
- Automatically buffered stream-I/O
- double and single precision floating point
- graphics with SVGA drivers (ms-dos)
- Postscript and HPGL output
- one dimensional arrays of singles, doubles, floating point numbers, and complex numbers
- string package
- matrices, including support for solving very large systems of linear equations
- transputer channels and links
- Fully documented source code for every extension in library format
- Online help for every tForth kernel and library word.
- flexible command line editor included
- All of the user's own programming tools (for instance editor, grep, browser) can be seamlessly integrated into the tForth environment using the words SYSTEM and OS-IMPORT (these words are not available / not needed under MS-Windows)
- Function key support, command and file history
- Compile errors start a user-specified editor with the cursor pointing at the problem
- Two megabytes of examples are available for study or inclusion in your own programs. Examples encompass benchmarks, parallel demo's, graphics programming, big number arithmetic, text processing tools, neural networks, text compression and even a few games.
- High level support for module management, localized definitions and use of forward references. Smart forgetting automatically handles process descheduling, memory deallocation and deinstallation of vectors.
- All I/O is vectored. A line of code or a function key press direct all output to a disk file or a free transputer link.
Features especially for the transputer
- link and channel input and output support
- SELECT GUARD ENDGUARD REPLICATE ENDSELECT
- TIMEOUT ?TIMEOUT
- STOP RUN RERUN KILL
- ASM-PROCESS FORTH-PROCESS
- STARTP ENDP
- PAR ENDPAR
Hardware requirements
The I/O of tForth is handled with a server written in the C language. The server is currently available for MS-DOS and UNIX machines. The transputer must talk to the host via a CO12 link-adaptor chip. tForth runs acceptably with T4 or T8 transputers that have at least 200 Kbytes of RAM.
Source code for the C server is available. User functions enable the calling of any C-library on the host, and thus the host platform may process in parallel with the transputer. A server written in Forth (MS-DOS protected mode or Linux, both written in iForth) is available on request.
tForth (binaries for all T4 and T8 transputers, a DOS / UNIX server and a 400+ page manual) sells for $400. Source code for the server must be negotiated.
Contact
Willem Ouwerkerk at the DFW office in Arnhem, the Netherlands, (+31) 26 443-1-305, or use the DFW-bbs at (+31) 26 442-2-164 (9600 bps, 24 hours/day).
One of the kernel authors
is available at iforth.nl/mhx.html (e-mail mhx@iae.nl)
free counter