You are here

Evolution of a Computer Application - Forth

John J. Wavrik

I have used the computer language Forth as the base language for this work because it is well suited for the task of implementing special-purpose languages and creating highly interactive mathematical systems.

It is not the purpose of this article to make readers expert in Forth. The interested reader will find a variety of resources (Forth implementations, books, tutorials, etc.).  Most of this article requires the development of a reading knowledge of the language. This means that you should be able to understand the simpler code and get the flavor of the more technical code. It also means that, if you are using one of the downloadable versions, you should be able to write some simple procedures. You should be able to read lightly through the main parts of the article first and then look at the section on Forth to get background for more detailed reading.

To program in Forth you need a development system. The downloadable versions of the Groups system include Win32Forth, a high quality Forth development system written by Tom Zimmer and Andrew McKewan, which is in the public domain. It is distributed with permission of the authors.  I would like to express my thanks to Tom Zimmer for making it possible to provide a development system with this article.

For the benefit of those who are trying to execute some of the examples in the articles on the downloadable systems, we have color-coded the code fragments that appear in the article.

The Color Coding Explained

  • RED code is found in the 1990 version, Groups16.
  • GREEN code is found in the current Groups32.
  • BLUE represents code that was not in the 1990 version and did not survive to the current Groups32.  For the most part, this code represents important stages in the transition.

The next section is a brief introduction to Forth. If you are using one of the programmable versions, you should try some of the examples in this section and conduct experiments to get the "hang" of the language. The section after that discusses an early version of the groups program.

The most important documentation in Forth is a glossary. Appendix A (a PDF file) is a glossary of the standard Forth words used in this article, and Appendix B (also PDF) is a glossary of the words defined in Groups32.

I suggest that you run the Groups16 (1990) program in one window while reading the article in another, and try some of the examples.  The glossary should also be available for reference -- it can either be open in another window or printed.

John J. Wavrik, "Evolution of a Computer Application - Forth," Convergence (December 2004)