Why
LISP ? The argument could hardly be more eloquently and convincingly made
than it was by Seymour Papert in his book, Mindstorms. Languages like Logo
and LISP encourage genuinely interactive and incremental program design. They
allow the creation of clusters of programs that interact among themselves,
and that can be debugged and developed separately. According to Jean Piaget,
'To understand is to invent', and LISP/Logo environments provide
fertile ground for exploration and invention.
Mathwright
WorkBooks are multi-page hypertext documents in which the readers create structure
(such as mathematical objects) as they go. They combine and transform these
objects, compare them from many angles (algebraic, analytic, logical, and
graphical, for example), and so WorkBooks cannot 'know' in advance the full
range of a user's interaction. Only in this way, by being flexible and dynamic,
can the WorkBooks encourage and support student questions.
Mathwright's
Lisper LISP interpreter takes advantage of these features of LISP to create
an interactive and extensible mathematical environment. And this fact is best
understood by the authors of Mathwright WorkBooks, who find that the object
paradigm and MathScript, our scripting language (written in
LISP), provide an easy way for them to translate their mathematical ideas
into lively interactions. But in our WorkBooks, and in MathScript, the LISP
language
is hidden
from sight. So we devote a few words here to LISP itself, the shy and gentle
giant that worked behind the scenes to create Logo and Macsyma, Mathematica,
Maple, Derive, and Mathwright.
LISP
was actually the instantiation for computers in the '50s of the 'lambda
calculus' of mathematical logician Alonzo Church. The latter is an
elegant style of binding variables in functions that lends itself to the design
of powerful and perspicuous, yet simple and transparent recursive algorithms.
One
of LISP's charming features is that 'correct' LISP programs tend to be simple
and elegant. Obviously, this is a matter of taste. Still it is difficult to
write in LISP an 'ugly' program that works well. On the other hand, because
of its very strict (because uniform and general) syntactic constraints, LISP
has often been referred to as 'a language of parentheses'. To this charge
the most straightforward answer is that one gets used to the parentheses,
and comes to appreciate them. A more oblique answer is the following: LISP
is essentially an extremely high-level machine language in
which one then writes other languages,
such as Macsyma, REDUCE, or Logo,
suited to specific purposes. As such it was extremely flexible, and tended
to be extended and ramified (and babelized) quickly. Java has experienced
a similar explosive development because of the simplicity of its basic structure.
In
fact, it is not difficult to write a LISP interpreter in LISP itself! In particular,
however, many of the main applications of LISP are written on top of LISP,
they are even higher-level languages whose 'machine language' is LISP. MathScript
is a prime example. The actual computing environment can be quite 'friendly'.
A setting such as Logo, in fact, was designed to be easily accessible to children.
The
serious learner would do well to consult a text such as Tony Hasemer's Looking
at LISP or Wilensky's LISPcraft for an more extensive treatment
of the subject. Like the game of 'Go', LISP is both simple and profound. In
this respect also it differs from other computer languages. One has the feeling,
having learned the 'rules' (the syntax, the conventions) of most languages
that the entire landscape of what is possible has at least been glimpsed,
and it is a matter of gaining experience and learning the details. But, speaking
for myself, the understanding of the structure and the dynamics of LISP evaluation,
did not bring the feeling that I had grasped the essence of this amazing language.
On the contrary, it left me feeling that nearly everything of importance about
it was yet to be learned.
The
Lisper LISP Interpreter (on which MathScript is based) is an extension of
LISP 1.5 as specified by McCarthy et. al. in the LISP 1.5 Programmer's
manual. The extensions are designed to make it especially strong in graphics,
numerics, symbolic mathematics, and unification pattern matching for its Expert
System and forward and backward chaining production systems. The Lisper LISP
interpreter was written in assembler in 1984 by James E. White. MathwrightWeb,
written in 2001, contains the latest and most powerful version (32-bit) of
that interpreter.
As
mentioned, an earlier version of Lisper is also the machine language for MathScript,
the mathematics scripting language at the base of Mathwright. Lisper has a
built-in parser for reading algebraic expressions written in infix (as opposed
to prefix) form, and it supports five number types (including infinite precision
integers and decimals, and a rational number type). It also contains 7 built-in
data types: Names, Lists, Numbers (five types), Primitive functions, Vectors,
Strings, and Matrices.
In
addition, Lisper itself is an object-oriented programming language, and it
implements primitives for run-time definition of Classes of Objects and their
hierarchies, data encapsulation,and inheritance of data and methods much like
SmallTalk, Java, and C++. The difference is that Lisper is interpreted, and
these features may be set at run-time.
Lisper
was originally designed in MS-DOS Assembler, but is now implemented in Java
2, and is well suited for its current incarnation in the web environment as
MathwrightWeb. As far as graphics
are concerned, it contains primitives implementing 2D Graphics for sprite
animation. Another
version of Lisper sits at the base of MindScapes, and currently
renders 3D simulations and animations with OpenGL.
Two
aims have guided the design of the Lisper LISP interpreter. The first is that
Lisper should be a sufficiently powerful language to support what Seymour
Papert, in his book on computers and mathematical pedagogy Mindstorms, has
called 'Piagetian learning'. This language can serve as a heuristic and an
exploratory tool in the study of mathematical topics from beginning Algebra
through Multivariable Calculus. The second aim is that Lisper should be simple
and transparent enough to convey the basic principles of algorithm design,
data structuring, and 'discrete' computational methods which appear in the
beginning curricula in 'computer science' and, increasingly, in mathematics
curricula at the college level.
| - James E. White, Ph.D. , Library Director, | ||
| author of this website, Mathwright Author 2000, | ||
| Mathwright MindScapes, and MathwrightWeb |