ere are some reflections about Forth inspired by the
appearance of my article "Evolution of a Computer
Application" (see www.joma.org) which features the use of
Forth to write mathematics software.
I started using Forth in my research in algebra over 2 years
ago. When I entered this field I became quickly aware of the
impact of language and environment on the ability of a
mathematician to produce software. Forth has a variety of
desirable qualities which not only facilitate a working
mathematician's ability to produce research software, but
which adds desirable qualities (interactive environment,
extensibility, etc.) My article illustrates (using the well known
subject of group theory) an approach to computation that I use
in my research.
What makes programming hard in algebra and related fields is
that conventional programming languages were not designed
for these areas. Algebra is the name for a large number of
fields each having their own objects of interest and body of
concerns. There is a gap between the means of expression
provided by conventional languages and the concepts of the
field. This makes the production of software focus more on the
technicalities of the language than the ideas of mathematics.
The idea developed in the article is that the gap can be
decreased by providing the mathematician more control over
language. To people in the Forth community it may not seem
so radical to suggest the development of small problem-
oriented special purpose languages. The article tries to bring
this idea to mathematicians and illustrate it with an extended
example.
There are several features which recommend Forth for this type
of work. First of all it is a language suited for creating
languages. Second it provides an interactive programming
environment which is valuable both in program development
and an important feature in research software. An extremely
important attribute of Forth is that it is simple and easy to
learn. A working mathematician who is not expert in computer
programming can learn Forth and produce powerful specialized
software systems.
The simplicity of Forth was part of the lore in the early days of
the language. Simplicity was very much part of Charles
Moore's vision. I have used Forth in my classes on Computer
Algebra over the years because I can get the students up to
speed and writing programs in about 2 weeks - leaving the rest
of the time for using software to explore mathematics. I don't
have to turn these courses into courses on computer
programming - Forth lets them be courses in mathematics with
computer assistance.
The refereeing process for my article provided an interesting
test. The referees (judging from their feedback) were expert in
mathematics and in other programming languages (Java and
C++ were mentioned). None had any experience in Forth - and
their only exposure to the language was the section I included
in the article. I was amazed at how quickly they seemed to get
the hang of Forth. During the refereeing process I was getting
fairly detailed comments on the code included in the article.
One telling comment was from a referee who wanted to
understand why the Forth word "WORD" did not produce
(from the command line) what he had expected. I wound up
including an "end note" in the article explaining how WORD
used the end of the dictionary as a buffer - and the inter