Overview

kForth is a computer program that may be used in various ways:

  1. It may be used as a calculator.
  2. It may be used to run computer programs written in the Forth language.
  3. It may be embedded into another computer program to give that program the ability to understand and run Forth programs.

kForth, in its simplest mode of use, can evaluate arithmetic expressions typed in by the user. Expressions are entered in a manner similar to that used for RPN (reverse Polish notation) calculators, such as Hewlett-Packard scientific calculators. Both integer and floating point calculations may be performed. Trigonometric and transcendental functions are provided. In addition, logic and bit operations may be performed, and the number base may be changed, i.e. numbers may be entered and displayed in hexadecimal (base 16) for example.

kForth is an implementation of the Forth programming language and environment. The user may write Forth programs with an ordinary text editor, load these program files from kForth, and run them. kForth, like other implementations of Forth, provides an interactive environment, allowing the user to examine or define variables and execute or define individual words. There are many advantages in using a Forth environment for writing and testing computer programs. kForth provides a significant subset of the ANS specification for the Forth language. It also provides some extensions and "non-standard" features which its authors have found to be useful. Some notable features are:


In addition to being as a stand-alone computing environment, the kForth program was also written so that it may be easily embedded into another program. Advanced programmers, typically programming in the C and C++ languages, can use the kForth source code to make their programs user extensible. In fact kForth was originally developed to allow users of XYPLOT for Linux to customize and add their own functions to the program. They can do this without modifying the XYPLOT program itself. Instead, they write separate Forth programs and load these files from XYPLOT.


    

Copyright © 1998--2002 Creative Consulting for Research and Education