May 1995

Norman E. Smith, CDP
Copyright 1993, 1994, 1995
All Rights Reserved

This Reference Manual is intended as documentation for the Until user and programmer. UNTIL (UNconventional Threaded Interpretive Language) is a Forth implemented in C/C++. The internals of Until are described in the book Write Your Own Programming Language Using C++, ISBN# 1-55622-264-5. This manual applies to Until Version 2.5. It is divided into several sections. The first section is a brief overview of Until. The second section identifies the various computers that Until has been successfully ported to. The differences between Until and Forth-83 are identified in a section. Finally, a word glossary lists all of the primitive words and their operation.


Until is a Forth-like language written in C/C++. (There have been versions in each.) This manual is a Reference Manual for Until. Internals are described in [SMITH1].

Special thanks to Richard Secrist, who put up with daily accounts during both the development of Until and writing the book about it. And to the pre-Beta and Beta testers who got me off the dime to get Until in shape for general consumption:

Special thanks to Skip Carter for allowing Until to reside on ftp.taygeta.com with anonymous FTP and access this manual from his WWW Home Page which is at http://www.taygeta.com/.

I can be reached via CompuServe E-mail. My account is 72745,1566. I read mail about once a week. I am interested in Until stories and any enhancements you might make. Yes, I do want to know about bugs you find.

There are three versions of this manual, a plain ASCII version, an electronic version, and a typeset version. The electronic version is in HTML format and can be viewed with Mosaic or any other HTML document viewer. This electronic version has some hypertext navigation capabilities. The HTML and typeset manual set is available from the author for $30, to cover reproduction and shipping costs. The typeset manual is formatted using Troff with the -ps and -ms options under the Coherent operating system. Unfortunately, Mark Williams Co. went out of business and Coherent is no longer available. It is still, however, useful.

Unix is a trademark of AT&T. Other products mentioned are trademarks, registered trademarks, or copyrights of their respective companies.



Until stands for UNconventional Threaded Interpretive Language. It is very Forth-like and in fact is about a 90% implementation of Forth-83. Until is different from any other Forth that I know of; it is:

Most Forth implementations are written in assembler. This allows peak performance, but inhibits portability. The C implementation allows Until to be ported across many diverse platforms with minimal work. I want to write systems, not learn a new assembler for every computer/operating system I move to.

Assembler implementations of Forth are almost always going to be faster than C implementations. They tend to take little advantage of the underlying operating system. In fact, most Forths tolerate the underlying operating system at best. Until takes advantage of it. C Forth implementations have a relatively easy time of supporting operating system features.

Even though C implementations are slower than assembler implementations, modern computer resources, i.e. speed, are such that there is no reason for one to feel slow. I have used several Forth-in-C implementations on a PCs starting with a 10mz Turbo XT without feeling that I was waiting on compiles and such. If you are using a 386 or workstation the system will be waiting on you most of the time. Until's extreme portability is directly attributable to the portability of C.

Until is mostly Forth-83 compatible. I have no plans at the present time to convert it to ANSI Forth. This is mostly because the standard is not yet adapted (late 1993) and I refuse to spend $50 for a copy of the interim document. Now, 1995, the published final version is $299! Someday I may attempt to make Until ANS compliant, but I am taking the view that extreme portability across platforms is also very important.

Until was not designed as a stand alone Forth, but rather to be embedded within C applications. Until becomes the application's programmable macro language. Until can be used effectively as a stand alone Forth that is extremely portable, but its real strength is when used as an embedded macro language. I have also used Until as a prototyping language doing initial coding in Forth then writing the final code in C with much success.

I very much support commercial Forths! Over the past 10 or 12 years, I have used, purchased, or convinced customers to purchase most commercial Forth packages. The support, documentation, and features are almost always above that of public domain implementations. There are of course a few exceptions. I wrote Until only after trying commercial Forths. In the final analysis some almost met my needs, but I never found any that suited completely. The main reason for not finding a suitable Forth was I wanted a portable version that ran on several computer systems that I could do general purpose rather than embedded applications with. For me writing Until was the correct decision. However if you are doing embedded systems, there is no question that commercial Forths are the only way to go! My decision now might now be the same as it was back then considering the way commercial Forths have evolved.


Successful Until applications include:

Until was designed from the ground up to be an embedded language. Great pains were taken to make sure that adding Until to other programs as a called function was simple. Instructions for embedding Until are included in the Embedding Until section.

Until includes most of the C I/O and string functions as well as AWK-like sub and gsub words. This makes writing file filters both easy and convenient. A sample file filter program, FILTER.APP, is included as a sample application. I use Until almost daily for this type of application.

A very powerful feature of Until is the relative easy with which it can be used as the starting point for other interpreters. One of the largest Until applications I have written is a Standard Generalized Markup Language (SGML) document interpreter. The PAL language from Getting the Most Out of Your HP LaserJet Printer is also based on a minimal version of Until.

Experimenting with other system calls is another good use for Until because adding new C function is so easy. Assume you need to learn Windows system calls, for example. Add the calls to Until, then interactively exercise them with various parameters to see what happens. This can be a big time saver in the learning curve for such things!


There are many valid reasons for implementing Forth in C. This section addresses my reasons.

The short list of reasons include:

C can be a very portable language. Most of the processors I regularly work on have a C compiler of some description. Porting Until to any processor/operating system with an ANSI C compiler can be done with a minimal amount of work.

A program written in a high level language is relatively easy to embed in other application programs. This gives an instant `macro' capability to almost any program you write. The Forth must be designed to be used as an embedded application language for this to be true. (See the discussions of C Forths in the History section.)

C allows the use of high level structures to define the dictionary definition. This makes it easy to modify dictionary structure. Some applications may require this.

A custom outer interpreter can make some applications much easier to implement. The normal, interactive Until interpreter is less than a page of relatively simple C code. Replacing the default interpreter with an application-specific interpreter is very easy for this reason. (See the Multiple Interpreters section for additional discussions.)

One of the best reasons for a Forth in C is the capability of integrating existing C function libraries into an application. For example, third party function libraries for communications and windowing are two of the many function libraries available. A few Forths allow access to generic function libraries, but they are usually platform specific. A C Forth allows this across multiple platforms.

Until Goals

The broad design goals for Until are:

I believe that all of these goals have been met. Until is portable. It has been compiled and run on several different compiler/computer combinations. There is very little in the code that is not generic C/C++. Even many of the system calls used are now specified by ANSI C and are therefore portable.

I used an old dialect of Forth called STOIC at work for several years in a large database publishing project. When it became obvious that the customer insisted on switching to another language, I chose C. The change in language meant losing several capabilities taken for granted in the Forth world. Development time increases because of the traditional edit-compile-link-test cycle in most computer languages. Debugging became much more tedious. No longer could I poke around interactively in memory after a crash to find a problem. (Most turned out to be data problems rather than true program bugs in the STOIC application code, which is not the case with C code.)

Until was originally intended to let me take a little piece of the Forth environment with me into the C world. Besides, I've always wanted to write a Forth system. That has turned out to be a very fortunate decision because I have two books about Until and a major Standard Generalized Markup Language (SGML) system about to go into production built around Until as I write this (late September 1992). And a third built around Until published in 1995. [SMITH3]

Until has two unique properties when compared to the other Forths written in C that I have tried; it is designed to be both called by a C function and call other C functions. This feature was designed in from the beginning and allows Until to be embedded in other application programs to provide a user-level ``macro'' language.

The final reason for Until and the books is to introduce Forth to the sea of C programmers out there who do not have any idea what Forth is, much less appreciate it. I know that has happened already.


The history of Until development is not a long one, but may shed some light on the present state of Until. There have been a number of Forth written in C implementations that I have tried over the years and some I haven't. These include:

Each of these Forths is written in C and deserves mention in any historical accounts of trying to use Forth as general purpose language.

In addition, MPE produces an implementation of their Power Forth written in C. It is named PINC. If the quality of their other implementations is an indication, PINC is probably an excellent product. It is not intended for personal use, rather aimed at the Unix/workstation market. It's price is between $1500 and $2000 depending on exchange rates.

MPE, Ltd.
133 Hill Lane
Southampton, SO1 5AF

As of mid-1993, several ANS C-Forths are under development.

C-Coded figFORTH

Around 1985, Allen Pratt [PRATT85] published an implementation of Fig Forth in C. It was a 16-bit Fig model that even included screen files. It ran fine under Unix, if slow. I never got it to run properly on a VAX with VMS. It was interesting, but I did not find it very useful for my applications. It compiled and ran with no changes on an Interactive Systems Unix System V.2 system and it has been ported to Coherent.


Tile is a Unix specific implementation of Forth. It is a 16-bit model that follows F-83 for the most part. A full multi-tasker is built into the kernel. This is a very complete package. My problem is the package is so tied into Unix and so many of the bells and whistles are wrapped into the kernel that I could not get it to even come close to compiling on any of the systems I have regular access to.

I have just discovered (December 1992) that Austin Code Works distributes a MS-DOS version of Tile for $50. If it had been available two years earlier, I might not have started Until...


ThisForth was originally released around August 1994 by Wil Baden and has been updated at least once since then. It is also available on Taygeta. The ThisForth kernel is an ANS Forth written in the Unix M4 macro language which produces ANS C which is compiled to create ThisForth. ThisForth is interesting, but Until is too comfortable at this point for me to switch. The documentation is minimal. M4 source is included and a DOS version is available.


The Portable Forth Environment is an almost ANS Forth by Dirk Uwe Zoller. It is available on Taygeta. PFE claims to comply with the last DPANS document released, should be very close to ANS standard. The DOS version requires a 32-bit extender which I have not managed to run.


CForth-83 is an implementation of Forth-83 written by Mitch Bradley [BRADLEY]. It is pretty generic, 32-bit, and includes full file support. I did manage to use it for one small production job. Its' short comings, in my opinion, include a 64k dictionary on PCs, and sparse documentation. CForth-83 is an excellent Forth if portability and a stand alone implementation are prime considerations.

The final reasons I continued my search elsewhere was the difficultly of adding new C primitives. The interpreter, I don't remember if it was the inner or outer, is a giant case statement. Adding a new primitive means adding a new case and modifying files, I don't remember which ones, to mark the new primitive. I did it once, but did not write down the steps. Later when I needed to add another primitive again, I decided it was just too much trouble.

By this time, I was starting to want a Forth to take with me in the transition to C. CForth-83 was the first Forth I considered usable in the general purpose programming arena. The two failings that caused me to look elsewhere are it is very difficult to add additional primitives to the kernel and it was never intended to be called by another C program.

These comments apply to the circa 1987 version I used at work. My conclusions may or may not still apply.


This is a relatively new (about 1990 or 1991) implementation of the Fig-Forth model. It was marketed as shareware. I ran it on the PC with little problem. The real question I had was "Why would anyone inflict a slow Fig Forth running under an operating system (Unix/DOS) that supported only screen files?" And, "Why would anyone pay money for it?" The shareware version of the system is just not usable. The "Starting Forth" Editor is even optional. In short, the system is not usable without buying all the options. If the authors added file support and such, then it could be worth another look.


Until is my baby. I have always wanted to write a Forth. My requirements were for a Forth, written in C, that could be integrated into other C programs to add functionality. The other C Forths mentioned all have some problem that eliminated them from the running. Either they could not be called, or primitives were hard to add, or they were specific to a particular OS. I finally gave up and started working on Until.

My original intention was to implement the TIL described in Threaded Interpretive Languages by Loeliger [LOELIGER] exactly in C. After I ran into a couple of problems, (my fault I'm sure) I started from scratch with the present Until design. I spend several months of evenings getting it to its present state. It was worth the effort to get the system I was looking for. It is not the fastest Forth in C, but its speed is acceptable, especially since I have never done any tuning.

I based my book, Write Your Own Programming Language Using C++ on Until, not mentioning Forth until almost half way through. I have a second book Programming Output Drivers Using Borland C++ written and scheduled for publishing any day now (late September 1992) that show how to use Until as an embedded application language.

The Legal Stuff

The licensing for Until is pretty simple. Here it is:

Right to use, copy, and modify this code is granted for personal non-commercial use, provided that this copyright disclosure remains on ALL copies and acknowledgment that Until source materials are used in your documentation.
Commercial use is granted to use, copy, and modify this code is granted for provided that this copyright disclosure remains on ALL copies, acknowledgment that Until source materials are used in your documentation, and a copy of Write Your Own Programming Language Using C++ is included as documentation when the source code to an application is distributed written which uses Until code.
Any other use, reproduction, or distribution requires the written consent of the author.

Until Copyright 1992, 1994, 1995 All Rights Reserved


UNTIL AUTHOR: Norman E. Smith, CDP
Email Address:
CompuServe: 72745,1566
Internet: 72745.1566@CompuServe.com
Internet: smithn@orvb.saic.com

Until is unique! It lets a program developer combine the best of both C and Forth into his applications. I want Until to be used. That is the reason for the very few restrictions on its use.

Table of Contents
Next Section