StrongForth Homepage
StrongForth 1.4
Download
ANS Compliance
Version History
StrongForth is a programming language that is very
close to ANS Forth.
One of the biggest differences is that it includes strong static
type-checking. ANS Forth itself is often called typeless
or untyped, which means that neither interpreter nor
compiler do any type-checking when applying a function (a word)
to one or more operands. It is completely up to the programmer to
chose the correct functions. In StrongForth, the interpreter and the
compiler check if a function matches the operands on the stack.
This allows finding type mismatches and unbalanced loops and
conditional branches already at compile time. Additionally, it
is possible to overload words by using the same name for
different functions, as long as each word expects a different
set of parameters on the stack.
The majority of Forth users might believe that strong static
typing is not Forth-like. Nevertheless, the implementation of
StrongForth proves that Forth can incorporate static type-checking
without increasing the complexity of the language.
StrongForth 1.4
Everyone interested in Forth with strong static type-checking
is invited to download a free copy of StrongForth 1.4.
It is a 16-bit pure text-mode application that runs in the DOS-box
of every Windows PC. StrongForth is distributed under
the GNU General Public license
(see copying.txt).
Download StrongForth 1.4
To install StrongForth, simply unpack the ZIP file into a new
directory. Before running forth.exe, this directory should be made
the working directory. Standard words are recognized in upper case
only, because StrongForth is case sensitive. Integer literals have
data type UNSIGNED by default, and data type SIGNED if preceded by
a sign character (- or +). Literals with a trailing decimal point
are double-cell numbers. Floating-point numbers are always decimal
and have an exponent indicated by an "E". To exit StrongForth,
type BYE.
The ZIP file contains
- a readme file,
- the StrongForth application program,
- a block file with libraries, utilities and sample source code,
- copies of the GNU General Public license and the GNU Free Documentation License,
- glossaries and reference manuals (start with doc/toc.htm).
The sources and build instructions can be downloaded
here. You need Eric Isaacson's
A86 assembler
and a linker in order to build StrongForth 1.4.
For further documentation, please see the
StrongForth reference manual,
which contains a wealth of details about StrongForth 1.4 and its implementation.
Questions, comments and new ideas are welcome.
ANS Compliance
StrongForth is not compliant to ANS Forth. Nevertheless,
it requires a closer look to see the differences in the source code.
For example, The simple FIG block editor that is included in the package
looks mostly like standard ANS. The main differences between ANS Forth
and StrongForth are described in the
introduction to StrongForth. See also the
ANS Forth to StrongForth cross reference.
StrongForth 1.4 includes the following word sets, which have been
only slightly modified with respect to the ANS Forth standard:
- Core
- Block
- Double-Number
- Exception
- Facility
- File-Access
- Floating-Point
- Locals
- Memory-Allocation
- Programming-Tools
- Search-Order
- String
Note that some of these word sets are partly or fully provided as
libraries in the forth.blk block file.
Version History
2000-07-30 Version 0.00
- Initial release including introduction to StrongForth.
- Block file with 100 blocks containing a simple line
editor and Programming-Tools word set as source.
- Including the following word sets: Core, Core extension,
Block, Block extension, Double, Double extension, Locals,
Locals extension and String.
2000-08-31 Version 0.01
- Several small bugs removed.
- Changed stack diagram of (FIND).
- Renamed FIND-CFA in FIND-TOKEN.
- New word: IMMEDIATE?.
- More sophisticated version of SEE.
- Included complete StrongForth glossary.
2000-09-30 Version 0.02
- Several small bugs removed.
- Added BYE.
- Selectable block file as command line parameter (see README.TXT).
- Autoexec block (see README.TXT).
- Added documentation: cross reference, programming-tools
word set and line editor.
- Removed EXECUTE in favour of dynamically compiled versions of
EXECUTE (click here for details).
- Added >R, R>, (R>) and the new data type R-SIZE
(click here for details).
- Included .S to the core word set and added stack dump to ERROR.
- Changed the parameters of ABS and NEGATE to all integers.
- Implemented additional sample source code in blocks 70 to 79.
- Added new data type COLON-DIAGRAM to be used by : :NONAME
DOES> ; ) (This change will allow ( to specify stack
diagrams more generally, which may become necessary in connection with future applications).
2000-12-03 Version 0.03
- Several small bugs removed.
- Extended maximum block file length to 200 blocks.
- Implemented assembler and disassembler inclusive
extensive documentation.
- Added samples documentation.
- Implemented Programming-Tools extension word set.
- Implemented )DEFER; IS )ADDRESS; )INTERPRET and )EVALUATE
as utilities.
- Made stack diagram handling more versatile by introducing
<DIAGRAM ... DIAGRAM> and doing several changes to
( and ).
- Added ! and @ for code addresses.
- Added editor specific version of LIST that includes TOP.
- Added CODE-HERE and CODE to the Core word set.
- Added new version of ?CONGRUENT.
- Replaced PROCREATES with )PROCREATES.
- Renamed (;CODE) in END-DEF.
- Renamed (EXECUTE) in EXECUTE and introduced (--) as new
data type.
- Changed input parameters of (FIND) and added exact match
feature.
- Changed input parameters of WITHIN.
- Removed H>S (can be replaced by SPLIT).
- Removed data types WDATA WCONST WCODE WPORT.
- Reorganized data type structure by introducing CADDRESS
and using it in + - +! 1+ 1- (LOOP) and (+LOOP).
2005-12-30 Version 1.0
- Wrote a comprehensive reference manual.
- Added Exception and Exception extension word sets.
- Fixed numerous bugs.
- Restructured the block file and introduced a standard core library.
- Increased number of blocks from 300 to 1000.
- Added StrongForth model to the block file.
- Added more samples and utilities.
- Added data types FAR-ADDRESS and CFAR-ADDRESS.
- Made NUMBER-DOUBLE a subtype of UNSIGNED-DOUBLE.
- Increased the size of all memory spaces to 65520.
- Restored (EXECUTE).
- Changed the order of input parameters of PARAMS>DT.
- Changed the parameters of ABS from INTEGER(-DOUBLE) to SIGNED(-DOUBLE).
- Changed the parameters of < > MIN and MAX from UNSIGNED(-DOUBLE) to INTEGER(-DOUBLE).
- Changed second parameter of .R from UNSIGNED to SIGNED.
- Changed the second input parameter of (PARAM) from 1ST to DATA-TYPE.
- Removed second input parameter of REFREEZE.
- Extended the semantics of WORDS.
- Changed the semantics of >TOKEN and extended FIND with code 22 for >TOKEN.
- Added one input parameter to SP! and RP!.
- All address subtractions return SIGNED instead of INTEGER.
- Changed the input parameter of [IF] from FLAG to SINGLE.
- Renamed overloaded versions of ?CONGRUENT to THAW and ?IDENTICAL.
- Renamed double-cell version of (R@) to (DR@).
- Renamed BEGIN-DOLOOP to NEST-DO and END-DOLOOP to NEST-LOOP.
- Renamed SET? to ATTRIBUTE? and removed CLEAR?.
- Renamed EVAL-ADDR to SOURCE-ADDR and EVAL-COUNT to SOURCE-COUNT.
- Removed FIND and renamed (FIND) in FIND.
- Removed CFA and [CFA].
- Removed ?UNTOUCHED =INITIAL? and ?NUMBER.
- Added ALIAS INDEX NOOP )CAST and DEPTH-SP.
- Added R/W BLK-BUFF BLK-STAT #BLOCKS.
- Added FAR-HERE.
- Added TRANS-TOP TRANS-BOTTOM and >TRANS.
- Added signed version of SPACES.
- Added PARENT and DT-OFFSET.
- Added [LITERAL] 'TOKEN 'CODE ['CODE] ['TOKEN] and >CODE.
- Added LINK (CREATE) and CREATE-NONAME.
- Added overloaded version of /STRING with default parameter 1.
- Added <VALUE and VALUE>.
- Added ?LOOP DOES, ALL-PARAMS>DT and >SIGN.
- Added ENCLOSE-PARAMS and ?PARAMS.
- Added ENCLOSE-DIAGRAM and END-DIAGRAM.
- Added ?SUBTOKEN ?NAME-EXECUTE ?DEFINITION ?SAME-DATA-TYPE and NEXT.
- Added SP0 and RP0.
- Added END-DEFINITION CODE[ and ]END-CODE.
- Added NONAME? SMUDGE? ?NONAME and ?SMUDGE.
2006-11-09 Version 1.1
- Added Facility and Floating-Point word sets.
- Extended the assembler with floating-point instructions.
- Added (CAST) and PARAMS.
- Fixed serious defects in ?CONGRUENT DT>DT
LOCALS| FM/MOD ;
- Replaced END-CODE and END-DEFINITION with
UNSMUDGE and made defining words return DEFINITION
and COLON-DEFINITION instead of STACK-DIAGRAM
and COLON-DIAGRAM. END-CODE is no longer required
to finish CODE and ALIAS definitions.
- Replaced CREATE-NONAME with (CREATE-NONAME).
- Extended the semantics of CREATE to allow defining words
that return their data field address, and removed )ADDRESS;.
- Replaced )DEFER; with DEFER.
- Removed CODE[ and ]ENDCODE.
- Added support for strongly typed data structures as a utility.
- Added a size parameter to ancestor data types SINGLE
DOUBLE FLOAT and replaced DOUBLE?
with SIZE and ANCESTOR.
- Made ABORT INTERPRET THROW
deferred definitions.
- Changed NUMBER to return a null data type instead of
throwing an exception.
- Removed CONST-CELL-ALLOT.
- Added * and */ for signed double-precision
numbers.
- Removed @ and ! for PORT and
CPORT, because these words don't work anyway in a protects
environment.
- Added exception handlers for user abort (^C) and division by zero.
2007-04-24 Version 1.2
- Added File-Access and Memory-Allocation word sets.
- Changed data type of SOURCE-ID from SIGNED to
FILE.
- Extracted the Exception word set into a separate library.
- Implemented an enhanced version of SEE.
- Added 24 blocks of new samples and utilities.
- Factored ?BLOCK out of LOAD.
- Replaced R/W with (BLOCK).
- Improved floating-point stack usage of LN and LOG.
- Replaced (R!) with (R).
- Factored ?VALUE and ADDR out of
TO and added +TO.
- Factored RESOLVE and -RESOLVE out of
THEN AGAIN UNTIL.
- Changed the implementation of DO ... LEAVE ... LOOP to avoid
double indirection, and changed the sematic of (LEAVE).
- Changed the implementation of CASE ... OF ... ENDOF ... ENDCASE
to avoid double indirection, and removed (ENDOF).
- Added SYNONYM for defining aliases with separate
code field, and redefined some words using SYNONYM
instead of ALIAS.
- Factored deferred word PROMPT out of QUIT.
- Added additional assertions to (DOES).
- Added ?SIZE, to be used instead of SIZE in
DEPTH-SP SP-LOCATE PICK ROLL )FIELD )CFIELD TIMES.
- factored DTDROP out of CAST.
- Added new ancestor data type TUPLE.
- Reimplemnted SAVE-INPUT and RESTORE-INPUT to
use tuples.
2008-01-10 Version 1.3
- Integrated word lists into the kernel, adding words WID
FORTH-WORDLIST LOCAL-WORDLIST ENVIRONMENT-WORDLIST GET-CURRENT
SET-CURRENT, and modifying words LINK WORDS MARKER.
- Added Search-Order word set.
- Replaced FIND with the deferred word SEARCH-ALL,
including callback routines as matching criteria.
- Replaced FIND-TOKEN with SEARCH-TOKEN.
- Replaced FIND-LOCAL with SEARCH-LOCAL.
- Reimplemented ENVIRONMENT? based on a separate wordlist.
- Moved EDITOR and ASSEMBLER from the
Programming-Tools word set to the Search-Order word set.
- Replaced the smudge bit with a mechanism that postpones adding a
word to the current word list.
- Enforced usage of END-CODE at the end of all code
definitions.
- Added Memory-Allocation word set.
- Renamed ALLOCATE for data type FAR-ADDRESS to
FAR-ALLOCATE.
- Extended FREE and RESIZE to accept null
addresses.
- Added CALLOCATE and CFAR-ALLOCATE as
aliases of ALLOCATE and FAR-ALLOCATE that
create addresses of data types CDATA and
CFAR-ADDRESS.
- Added aliases for SIZE FREE and RESIZE
that accept addresses of data types CDATA and
CFAR-ADDRESS.
- Changed parameter UNSIGNED to INTEGER
in + - +! for items of data type INTEGER-DOUBLE
FLOAT DFADDRESS SFADDRESS.
- Changed parameter UNSIGNED to INTEGER
in all versions of .R.
- Replaced the two versions of SPACES for data types
SIGNED and UNSIGNED with one version for
data type INTEGER.
- Added MOVE and TRANSIENT for data type
FAR-ADDRESS.
- Added LAST and FIRST to Programming-Tools
Word set.
- Added three overloaded versions of ERASE for
floating-point numbers.
- Added [DEFINED] and [UNDEFINED] to the
utilities.
- Added .ADDR to the Programming-Tools word set.
- Added overloaded versions of DUMP for data types
CODE and FAR-ADDRESS.
- Added quicksort algorithm to the utilities.
- Added ?DECIMAL to be used for floating-point output.
- Added a size parameter and added compilation of attribute field to
CREATE-LOCAL.
- Renamed number prefixes from B' O' D' A' X' to
B# O# D# A# H#, respectively.
- Removed data type IOR and replaced all usages with
SIGNED.
- Fixed defects in RESTORE-INPUT SEE )PROCREATES
?CONGRUENT.
- Removed LINK,.
- Stripped ?COLON to take an argument of data type
CONST -> CODE.
- Simplified NEXT by removing the check for
LATEST.
- Renamed line editor word DELETE to DEL.
- Implemented a more intelligent end-of-disassembly criterion.
- Removed ?IDENTICAL and reimplemented IS.
- Extended LOCALS| to allow multiple usages within a
definition.
- Extended . for word lists to display ???
if no corresponding vocabulary exists.
2008-04-10 Version 1.4
- Added Full-featured OOP and structures library.
- Removed previous implementation of structures from the utilities.
- Added RESIZE for files.
- Added DATA-HERE.
- Added HELP to the utilities.
- Added template feature to the utilities.
- Added [CTRL] and <DEL> to the utilities.
- Increased the size of the file input buffer to 1024 characters.
Future
- StrongForth library to be loaded on top of ANS Forth systems.
- Native code compilation.
Dr. Stephan Becher - April 10th, 2008