kForth is a computer program that may be used in various ways:
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:
OPEN, CLOSE, LSEEK, READ, WRITE,
and
IOCTL
(Linux only). In addition to basic file i/o,
these words permit communication with device drivers under Linux,
enabling kForth to be used for instrument control and data
acquisition. A subset of the ANSI standard file extension words
are provided in the form of Forth source code.
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.