Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
A
B
C
D
E
F
G
H
I
JK
L
M
N
O
P
QR
S
T
UV
WXYZ+
Get a full dump of the dictionary:
List of Names
Short Form
Full Form
-
Forth
- Language type:
T - Threaded or stack-based
- Description:
Forth is an interpreted stack-based language
with a very simple syntax and elegant
abstract exection model.
Designed for efficiency and
simplicity, Forth is noted for the very
small size of the language system.
A Forth program is a sequence of words.
Each word is independent, and causes
some specified action. Even constants
are words: the word "12" is just a command
to push the number 12 onto the data stack.
Sequences of words can be grouped as
procedures, and employed to build up
modular programs. In order for this to
work, of course, operators and operands
must be given in reverse polish order
(operands followed by operator). All
data manipulation takes place on the
data stack, so Forth offers several
operations for manipulating the stack.
Forth implementations vary in the range
of data types they provide, but most provide
a conventional set of numeric and string
types, plus arrays. Forth offers regular
control structures: If-Else, While-Do, and
For-Next, albeit with peculiar ordering
of the keywords. Most dialects of
Forth provides simple
file handling and I/O support.
Forth is also meant to be extensible at every
level. Programmers can define new words,
and implement them in Forth itself, in
some other high-level language, or in
machine code.
Information about Forth is widely
available on the Internet. There are
several commercial and implementations,
many available from
here.
- Origin:
Charles H. Moore, 1969-1971.
- See Also:
- Remarks:
Forth is often employed for controlling
micro-computers and embedded systems,
especially at boot-up prior to loading of a more
complex OS. Because Forth is small and
fast, it is well-suited for embedding in
ROM. Forth is also used for creating
general-purpose applications, even
CGI scripts.
Forth is standardized as ANS-Forth; the
standard is available
here. There is also
an IEEE standard in draft for using
Forth as a standard firmware language,
IEEE 1275.
Forth's stream-of-conciousness syntax,
polymorphism,
and typically terse style make reading
real Forth code a challenging exercise.
The first real application of what we
call Forth was controlling telescopes at
the NRAO at Kitt Peak, in 1971.
Forth became
very popular in the astronomy community,
and was adopted as the standard programming
language by the International Astronomical
Union in 1976.
- Links:
-
-
-
- Date:
- Sample code:
\ Forth implementation of Newton's method for finding
\ roots, simplified. (c) Copyright 1994 Everett F. Carter.
: z1 ( i -- ) ( f: -- z1 )
z F@ xn{ SWAP } F@ F-
;
: Newton ( i -- ) ( f: e d p -- e d p )
\ calculate new D
DUP z1 FROT F* FOVER F+
\ calculate new P
FSWAP DUP z1 F* dif{ OVER } F@ F+
\ calculate new E
FROT z1 FABS F* FOVER FABS F+
\ restore stack order
FROT FROT
;
: FNewt ( &xn &dif n -- ) ( f: z -- e d p)
>R
& dif{ &!
& xn{ &!
R>
z F! 0.0e0 0.0e0 0.0e0
0 DO
I Newton
LOOP
;
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some
examples copyright of their respective authors. Some
technologies and languages are trademarked. Permission to
copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome.
Please use email, the address is ziring@home.com
[Ziring MicroWeb Home]
[Dictionary Start]
[Sign Guestbook]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent
additions to dictionary and master list, 1/00.