Spectra Forth Tutorial |
|
[ Forth is an extraordinary computer
language developed originally for the control of radio telescopes, by an American called Charles Moore. Forth is neither an interpreter nor a
compiler but combines the best features of both to produce a super-fast, high
level language, incorporating the facilities offered by an interactive
interpreter and the speed of execution close to that of machine-code. In order
to achieve these fantastic speed, Forth employs the use of a data, or
computation stack, on which to hold the data of the operations to be performed,
coupled with the use of Reverse Polish Notation (RPN). Moreover, RPN is very easy to use and understand with only a little pratice.
In fact, Hewlett Packard use RPN on many of their calculators. All standard Forth use integer
arithmetic for their operations and can handle up to 32 bit precision if
required; floating point mathematics routines could be incorporated, but with a
reduction in the execution speed of a program. This implementation consist of a standard
Fig-Forth model, but with over 100 extensions to the standard vocabulary of
Forth words. There are two important extensions to the White Lightning: the first
is the ability to access almost all of the Spectrum’s own BASIC commands, just
as you would when writing a BASIC program and with the addition of many of the
high resolution graphics commands (CIRCLE, DRAW, etc.). Coupled with the
incredible excution speed of White Lightning, the possibilities are limitless!
The second, and possibly most important addition, is the IDEAL sub-language. In addition to the basic vocabulary of words, the user can very easily add his own new WORDS using
previously defined words, thus extending the vocabulary and building up as
complex words as is necessary to do the task in hand. Fully structured programming method are
also employed as a fundamental feature of Forth thrrough the use of the
structural control sequences included such as IF...ELSE...THEN DO..UNTIL The standard Spectrum editor can be used
to create lines source code for later compilation.
The standard Forth line editor is included for compatibility with existing text. Once the source code is complete, it may
then be compiled into the dictionary for later execution . Spectra Forth was written by Stuart
Smith, the author of the extremely successiful DragonForth.
[ |
Ultimo aggiornamento: 10-12-2002. Copyright (c) 2000-2002 Matteo Vitturi.
|