Trace: » forth04.html

[hemmerling] FORTH 4/6


Free & OpenSource FORTH Systems

Valuable OpenSource FORTHs, named by a FORTH expert in 2021-07 ( in alphabetic Order )

  1. CamelForth.
  2. eForth.
  3. ESP32forth.
  4. ForthWin/Forth2020.
  5. Gforth.
  6. Mecrisp.
  7. noForth / Egel project.
  8. SP-Forth.
  9. Tachyon Forth.
  10. Win32forth.

Free & OpenSource FORTH Systems for BareMetal Systems, in Assembly Language, ( some ) C, ..

CamelForth, an important FORTH Systems originally implemented Assembly Language, then ported to C

CamelForth by Brad Rodriguez
CamelForth in C by Brad Rodriguez

eForth, an important FORTH Systems originally implemented Assembly Language, then ported to C, then ported to Javascript, C++, Java in the 2020th

bForth & eForth Design Principles
  • Chen-Hanson Ting told me in 2021-08:
    • The original Forth of Chuck Moore of 1970 had the concept of a virtual memory system, i.e. the concept to read and write tapes, to save binary data to a file system.
    • eForth has no idea of files or any other mass storage systems. Files and blocks are not ( part of ) eForth. eForth has not to deal with mass storage.
    • Instead, eForth implements serial I/O only. The source and destination of data must be a serial port.
    • An implemented serial port, as destionation of serial data, might catch the data and save the data in files, on a local file system.
    • eForth just processes a stream of text ( the traditional Unix shell & Tcl/Tk data processing idea ).
  • Experts told me, that eForth is not a “full Forth”, but a very limited minimal Forth.
bForth by Bill Muench, eForth by Bill Muench & Chen-Hanson Ting
eForth by Thomas Göppel
µEforth / ESP32forth in C by Brad Nelson & Chen-Hanson Ting
jeforth in Javascript, by Cheahshen Yap, Sam Chen and Chen-Hanson Ting
  • Newest release “jeforth_614” in Javascript, in 2021-08.
  • Dr. Ting told me in 2021-08: 100 words, about 400 lines of C++ code.
  • “This jeforth system was originally written by Mr. Cheahshen Yap and Mr. Sam Chen in the Taiwan Forth Interest group around 2010-2011. I polished up the code so that all Forth words were self-sufficient objects. It now has a pretty user interface worthy of the Internet”.
ceForth in truely object-oriented C++, by Chen-Hanson Ting & friends
  • Newest release “ceforth_403” in truely object-oriented C++, in 2021-08.
  • - “”.
  • Dr. Ting told me in 2021-08: 100 words, about 400 lines of C++ code.
ooForth in Java, by Xuyang (Shawn) Chen, Brad Nelson, Chochain Lee, and Chen-Hanson Ting
  • Newest release “ooforth_204” in Java, in 2021-08.
  • Dr. Ting told me in 2021-08: 100 words, about 400 lines of C++ code.
Arduino Forth based on eForth

FORTH Systems in C/C++

The 4th Compiler
Autodesk Threaded Language Application System Toolkit ( ATLAST )
    • “calForth is a forth language interpreter and compiler. It... will run on most *nix environments. It also includes a debugger and tracer. It's coded in 'C' to allow easy modification. Also, support for the 8051 processor has been added”.
    • “It will run as a forth interperter, as well as strictly compile an executable”.
cforth for osx
Chris Curl's FORTH Implementations
    1. GitHub "CCurl / BoardForth" - “A token-threaded VM for the PC and development boards, written in C ”.
    2. GitHub "CCurl / CForth" - “A new Forth project”.
    3. GitHub "CCurl / Forth_C" - “Another Forth. This one creates a 'bare metal' Forth virtual machine. Written in C using Visual Studio”.
    4. GitHub "CCurl / Forth-GCC" - “This is a simple token-threaded (byte-code) implementation of Forth, written in C for GCC. Yes, I know ... ANOTHER Forth implementation. This one creates a 'bare metal' Forth virtual machine. The goal of this project is to create a basic, easy to understand, and easily extendable implementation of a Forth virtual machine. To that end, the virtual CPU has less than 50 instructions, which make up the VM's opcodes. They are also the Forth system's primitives”.
    5. GitHub "CCurl / Forth-PCode-Asm" - “Yet another Forth implementation. This one is a PCode based one written in assembler”.
    6. GitHub "CCurl / MachineForth" - “Inspired by Chuck Moore's 'Machine Forth'”.
FINF Is Not Forth
  • GitHub "lpereira / finf" - “FINF Is Not Forth. FINF is a simple implementation for a FORTH-like language for the Arduino platform... Current version weighs about 8kB of object code (8.8kB if built with TERMINAL defined), making it suitable even for less beefier Arduinos, such as the ones based on the Atmega168 microcontrollers (even though it runs out of memory quickly and starts to behave weirdly)”.
  • “graspForth”.
    • GitHub "andrewtholt / graspForth" - “graspForth .. a 32-bit Forth by Bernard Mentink”.
    • The STM32 Primer Community "GraspForth" - “GraspForth port for STM32 Primer. Works over VirtualCOM”.
      • “You seem to have missed the whole point of my post. In respect to 'tethered' forth's for example. I don't want one. The reason is simple, I don't want to carry around the development system in the field. For example, I want to be able to configure/program/modify my products in the field with a PDA for example .. or a laptop .. or the kitchen sink, anything with a serial port. I don't want to drag around a development environment, if I wanted that I'd write using C tools”.
      • and eForth cannot be ported with GCC (AS) AS cannot have look-ahead ORG statements. Of the Free Forth's eForth(or hForth) is the best assembly based solution *if* you have the commercial assembler for that micro .. and you have time for the port” :-(.
      • “As I read it, eforth even lets you generate a Forth for a target system using a different assembler, by only using its macros and ignoring its own code generation functionality. The idea then is to have the 30-ish pieces of machine code set up as bit patterns of data, with the rest of the high level Forth still provided as data as before. Of course, the time problem goes up, but it's a lot more practical than implementing a whole Forth for a virgin machine with no tools for it. Traditionally, of course, you would go the route of cross compiling from a different Forth platform”.
      • “Well, many Forths are me-too efforts. They feature the same basic engine, the same ANS-Forth vocabulary and they are used in the same way. There are a few that are different:
        • C-based FORTH:
          • OpenBios - doing Fcode.
          • FICL - the way it interfaces with C.
          • 4tH - conventional compiler instead of Forth engine.
          • I have seen a C-based Forth in 1K C-code (First??) some time ago in a dutch Forth magazine.
        • Not C-based FORTH:
          • RetroForth - very minimal, very versatile, very portable.
          • ForthCMP - makes tiny, very speedy standalone executables.
    • “64-bit Forth System for x86_64-GNU/Linux”.
    • “he following packages are required to build and maintain kForth-64 from its source package, on a GNU/Linux system: binutils, gcc, gcc-c++, glibc, glibc-devel, libstdc++-devel, make, readline, readline-devel, patchutils”.
Peter J. Knaggs' BaseForth
Lars Brinkhoff
  • GitHub "larsbrinkhoff / lbForth" - “Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.”.
  • GitHub "larsbrinkhoff / nybbleForth" - “Stack machine with 4-bit instructions. There's a simulator, an assembler, a cross compiler, and a Forth kernel, all written in Forth. There's a hardware design written in Verilog”.
  • GitHub "Earlz / microforth" - “A forth implementation aimed at being portable and tiny(in code size and required resources) written in C”.
MiniForth - Tiny Forth Built in a Week
    • GitHub "nimblemachines / muforth" - “A simple, indirect-threaded Forth, written in C; for target compiling; runs on Linux, BSD, OSX, and Cygwin”.
    • “Indirect-threaded code (ITC) Forth”.
    • “Unlike mecrisp – which could be considered muforth's main 'competition' – muforth supports a tethered development model, where the dictionary names and all the interactive command processing live on the host, and only the code and data live on the target machine. This makes it possible to target very small devices with a few kilobytes of flash. In contrast, mecrisp needs at least 16 KiB of flash to be useful; 32 KiB is a more comfortable minimum”.
    • “5.11. What is a tethered/umbilical Forth system? A tethered Forth system is a cross-development environment where the host and the target are connected at run-time (during development), allowing full interactive use of the target system without requiring all the space that a full-blown Forth system would require on the target. E.g., the headers can be kept completely in the host. Tethered systems may also provide the compilation speed and some of the conveniences of a full-blown Forth system on the host. Tethered systems are also called umbilical systems”.
  • GitHub "pete / pez" - “A Forth dialect based on Atlast, with expanded capabilities and more portability”.
PFE - Portable Forth Environment
    • “The PFE has been created by Dirk-Uwe Zoller and had been maintained up to the 0.9.x versions (1993-1995). Tektronix has adopted the PFE package in 1998 and made a number of extensions”.
    • “You can load additional C objects at runtime to extend the Forth dictionary”.
    • “It is fully written in C, the newer version has a module concept, and it is fully multithreaded. Autoconf used. Tested in embedded environments”.
Tail Forth
  • GitHub "snej / tails" - “Tails, A Fast C++ Forth Core. A fast, minimal Forth-like interpreter core in C++ with no assembly”.
  • yForth.

FORTH Systems in Java

FORTH Systems in Javascript

Beetle Forth
  • GitHub "JeForth" - “A FORTH running on HTA, HTML, Node.js, NW.js, Chrome Extension, Chrome App, and more”.

FORTH Systems in Lua

FORTH Systems in PHP

  • GitHub "Spyryto/php-forth", Google Code "php-forth" - “Forth machine. Example PHP 5.3 console application project”.
  • GitHub "tobyontour / php-forth" - “Php-forth. Forth interpreter implemented in PHP”.
  • GitHub "tobyontour / Phoshell" - “Phoshell was initially implemented in PHP as an experiment to see how easy it is to implement a simplified stack machine. Eventually, we realized that this simplified stack machine can in fact be implemented in any known programming language with the equivalent of around 50 lines of JavaScript or PHP code, thus making the Forth like script (hence “Phos”) a likely candidate to be a universal scripting language”.

FORTH Systems in Python

FORTH Systems in Ruby

FORTH Systems in Rust

FORTH Systems just for complete Operating Systems ( Windows, Linux, MacOSX )

Delta Forth .NET
Gforth ( GNUForth )
  • Oforth for Linux, Windows, MacOSX.
  • “Oforth is a Forth dialect (Oforth is for Object + Forth). It keeps Forth mecanisms while implementing a full object model”.
  • Not under active development since 2018 :-(.
SP-Forth ( for Windows, Linux )
  • GitHub "kragen / stoneknifeforth" - “This is StoneKnifeForth, a very simple language inspired by Forth. It is not expected to be useful; instead, its purpose is to show how simple a compiler can be. The compiler is a bit under two pages of code when the comments are removed. This package includes a 'metacircular compiler' which is written in StoneKnifeForth and compiles StoneKnifeForth to an x86 Linux ELF executable”.
Win32Forth ( for Windows )
visualFORTH based on Win32Forth
Win32FX based on Win32Forth 6.01
  • SourceForge "Win32FX". SourceForge "Win32FX", - “Evolved from Win32Forth 6.01. Code runs ten times faster on older cpu's. Absolute addressing makes the VM simple to understand. Five stacks and demos showing why modern Forths need at least 4, and preferably 5 stacks to be viable in today's computer”.
Mind.Forth based on Win32Forth

FORTH for MacOS prior MacOSX

FORTH for Android OS & Raspberry Pi

Any MSDOS FORTH on Android OS & Raspberry Pi
Any MSDOS FORTH on Raspberry Pi
Native FORTH for Raspberry Pi

FORTH for Commodore Amiga & AmigaOS

  • The once-commercial, now free JForth.

FORTH Systems for C64

FORTH Systems for ESP8266

FORTH Systems for IBM-PC & MSDOS

FORTH System for JU+TE-Computer

    • “Das JU+TE-FORTH-System setzt das 4K-System ES1988 sowie 8 Kbyte RAM voraus. Das FORTH-System wird von Kassette geladen und läßt sich ab %E000 über PROG oder BASIC starten”.
    • “Auf die Screenarbeit wurde verzichtet, da mit der Bildschirmgröße und RAM- Austattung des JU+TE-Computers zu enge Grenzen gesetzt sind. Statt dessen können mit dem Wort VIEW alle Wörterbucheinträge rückübersetzt werden”.

FORTH System for LEGO MindStorms RCX

FORTH Systems for MSP430

  • See above on this page.
  • See above on this page.
  • See above on this page.
Egel Project

FORTH System for Parallax MCUs

Tachyon Forth
    • “PropForth5.5 is last version for P1”.
    • “I have been trying to use Tachyon for my project, but it is sufficiently unique and for me it is quite frustrating because it is different in its behavior from other Forth implementations. Peter Jakacki is a very talented programmer and he has developed this system to fit his way of thinking. I am struggling trying to figure stuff out. Things that were easy in other implementations are vague and hard to discover”.
    • There are at least 4 different versions of forth for the propeller. All versions can make use of the multiple cores of the propeller.
      • Three versions (Tachyon 3 & 4, and Propforth 5) are optimized for the propeller with many words defined for sensors, communications, actuators.
      • One version (pfth) is a standard ANS forth with some key words defined for use with the propeller. I found it useful for learning interactively some low level propeller features by interactively adjusting parameters in one core and transferring data to words running in other cores.

FORTH Systems for TI-99/4A console with 32K Memory Expansion ( and Disk System )

FORTH Systems for ZX81

Online Services for Software Development with FORTH

Using an OpenSource FORTH for commercial Projects to generate a Sales Product

  • Experts warned me to use a modern OpenSource FORTH ( like some FORTH for the ESP8266 ) for commercial embedded system projects, as some of these products are using several different OpenSource libraries ( e.g. to handle WiFi on the ESP8266,.. ) with often a handful of different OpenSource licenses, including some problematic licenses. The idea to compile this with a self-written application in FORTH language to a commercial saleable binary product, without that the hole commercial binary product is effected by the OpenSource libraries, is not quite realistic :-(.

History of FORTH

FIG's & TheFourceSource's History of FORTH

  • Forth Interest Group "LEVELS OF FORTH", TheFourceSource "The Forth Source - Catalog" ⇒ “Levels of Forth”, “Implementation Levels of Forth”.
    1. “Level 0”.
      • “On several occasions C.H. Moore has listed approximately 63 functions which he considers the essence of Forth”.
      • fig-Forth.
        • “There was little in the way of documentation beyond the Installation Manual and the source listings. The older publications such as the Kitt Peak Primer and Using Forth did not mesh well with the public domain version available” :-(.
          • “Kitt Peak Primer” ⇒ See FORTH 3/6.
          • Document “Using Forth” ???
        • “The fig-Forth implementations took over the disk precluding its use for other programs. The error messages were stored on a disk” :-(.
    2. “Level 1”
      • FORTH79.
        • “79 Standard made about 40 changes to the functions in fig-Forth”.
        • “Soon there came the 79 Standard which made several changes. It was then proposed that the Forth Interest Group stop supplying the fig-Forth source listings” :-(.
      • Book by Leo Brody “Starting Forth”, 1st. edition.
    3. “Level 2”.
      • MVP Forth, up to 240 or up to 500 functions. The MVP Forth implementation takes over a disk format. But the file on Gene Forth Round Table includes several added utilities which allow one to access screens in files and the compiling of text files written with any word processor.
      • “A Forth editor described in Chapter 3 of Starting Forth written by Sam Daniels is included”.
      • Suggested reading:
        • “MVP System Documentation”.
        • Book “Starting Forth”, 1st Edition by Leo Brodie.
        • Free document “The Forth Guide” by by Glen B. Haydon.
    4. “Level 3”.
      • F83, up to 1000 functions, including the 132 functions from the 83 Standard.
      • Book by Ting “Inside F83”.
    5. “Level 4”.
      • FPC Forth ( = F-PC Forth ), by Tom Zimmer. 2500 functions. Based on the 83 Standard. All of the source code is in text files.
      • Documents by Ting “F-PC Technical Reference Manual” and “F-PC Users Manual”.
    6. “Level 5”.
      • F32, by Rick VanNorman. 32-bit FORTH, up to 900 functions.
    7. “Level 6”.
      • Norm ANS Forth, 1994.
      • THIS4TH Forth.
      • F32 by Rick van Norman, with 32-bit MSDOS extender ( DPMI ) support.

FORTH.Inc's History of FORTH

Forth 200x Standardisation Committee s History of FORTH 1978-2012

Jeff Fox's History of FORTH 1970-2004

TU Wien, Institut für Computersprachen's History of FORTH

Forth Family Tree and Timeline
Gforth's History of FORTH
  1. All early Forth systems were custom-made, usually by Charles Moore, who discovered (as he puts it) Forth during the late 60s. The first full Forth existed in 1971.
  2. The principal architect of microForth was Dean Sanderson. microForth was FORTH, Inc.'s first off-the-shelf product. It was developed in 1976 for the 1802, and subsequently implemented on the 8080, the 6800 and the Z80.
  3. A team led by Bill Ragsdale implemented fig-Forth on many processors in 1979. Robert Selzer and Bill Ragsdale developed the original implementation of fig-Forth for the 6502 based on microForth.
  4. VolksForth was written by Klaus Schleisiek, Bernd Pennemann, Georg Rehfeld and Dietrich Weineck for the C64 (called UltraForth there) in the mid-80s and ported to the Atari ST in 1986. It descends from fig-Forth.
  5. Bernd Paysan wrote bigFORTH, a descendent from TurboForth, an unreleased 32 bit native code version of VolksForth for the Atari ST, written mostly by Dietrich Weineck.
  6. Gforth descends from bigFORTH (1993) and fig-Forth. Of course, a significant part of the design of Gforth was prescribed by ANS Forth.


Tools & Applications

Applications & Libraries

Complete Hardware Application with FORTH as Programming Language ( Applicance )

  • GitHub "zooxo / ivt" - “IVT (IV-TINY) - A FORTH-programable Scientific RPN Calculator that fits in 8 kilobytes (Arduino, ATTINY85)”.

Compilers built with FORTH

  • BASIC.
      • “amr Forth, Basic, and Assembler are released under the LGPL open source license to use freely without charge. All are available for both the Windows and Linux operating systems”.
        • “Three languages, Forth, Basic, and Assembler plus multiple operating systems, Linux, Unix, BSD, & MS Windows in a fully integrated development environment”.
  • Pascal compiler.
      • “Apropos Spieltrieb, wie wäre es denn mit einem portablen Pascal auf dem Rücken eines Forth's. Gibts da schon was?” ⇒ “Paul Kleinrubatscher hat sowas einmal in einer Diplomarbeit teilweise gemacht (aber nicht so toll). Schwierigkeiten dabei sind vor allem das goto (vor allem ueber Prozedurgrenzen hinweg) und, zu einem geringerem Grad, das statische Scoping”.
  • Tiny Pascal.

Database Interface

Forth Query Language ( FQL )

Federico de Ceballos

Lint for FORTH?

Operating Systems Stuff ( Multitasking with FORTH, Multitasking Operating Systems with FORTH Integration & Bootloaders written in FORTH )

FORTH with Cooperative Multitasking

FORTH with Preemtive Multitasking

FORTH with Time Triggered Architecture

Multithreading FORTH in C++

    • “When you download mingw, there is a win32 version and a POSIX version. Get the POSIX and it will come with the std::thread implementation”.
    • “You can either: Choose the “pthreads” option when installing mingw-w64, or Choose the “Win32 threads” option when installing mingw-w64, and install an additional header file pack. Another good option is to install via MSYS2 which always gives you the latest build with a suitable configuration. (pthreads in this case)”.

FORTH Bootloaders

Collapse OS
  • Collapse OS - “Bootstrap post-collapse technology”.
  • GitHub "hsoft / collapseos" - “Collapse OS is a Forth operating system and a collection of tools and documentation with a single purpose: preserve the ability to program micro- controllers through civilizational collapse”.
Open Firmware

Simple multi-tasking Operating Systems ( Schedulers ) which might cooperate with FORTH


FORTH with complete FORTH Operating Systems

Kestrel Computer Project
    • RapidIO, RetroForth, and RISC-V Update.
    • Stepwise Refinement of an Event-Driven Forth Interpreter Part 3: Multiplication.
    • Stepwise Refinement of an Event-Driven Forth Interpreter Part 2: Basic Correctness Checks.
    • Stepwise Refinement of an Event-Driven Forth Interpreter.
    • Kestrel-3 User's Guide Available Now.
    • Event-Driven Forth and its Implications.
    • “This project is now archived, due to Raptor Engineering Releases Kestrel, The 'First Open-HDL/Open Firmware BMC', which I read on 2021 Feb 09. I cannot risk legal action from Raptor Engineering, especially considering how much our respective projects overlap. — Samuel A. Falvo II, 2021 Feb 09”.
    • GitHub "Kestrel Computer Project" - “The Kestrel Computer Project aims to build a full-stack, open-source and open-hardware, home computer”.
  • The competitor Medium "El Correo Libre Issue 35" - “Raptor Engineering Releases Kestrel, The 'First Open-HDL/Open Firmware BMC'”.

FORTH with commercial complete FORTH Operating Systems


Unit Test / Test of Assertions & Debugging

Unit Test Tools

Unit Test Tools in FORTH
    • “Test programs for Forth 2012 and ANS Forth”.
    • Experts told me, that this test framework might be adopted to do unit-test alike tests for your own FORTH application “Helps in testing for ANS conformance. But it also defines a generic test framework (see tester.4th). It can be tailored to check for non-regression in other Forth variants”.
  • Forth ( ) "Annex F: Test Suite" for the Forth 2012 Standard. Also called “Hayes suite”, as John Hayes started 1994 with it's development.
  • GitHub "Anding / simple-tester" - “A simple FORTH test package intended for embedded systems based on the ANS FORTH version of ttester.f”.
    • Expert #1 feedback: “It seems a pity Ulrich Hoffmann arbitrarily switched the names form T{ =⇒ T} to T{ T} == that will make any existing test suite fail” :-(. “Hashing is a clever idea, but is no cheaper than actually comparing the values, so I'm not sure why they took that approach?”.
    • Expert #2 feedback: “I'm not sure what the justification of the hashing was other than its easier to pass a calculated value around as a single stack item or to store it for later use”.
  • GitHub "G9541 / stm8ef" - “eForth tester - inspired by forth2012-test-suite”.
  • GitHub "swapforth / anstests /" - “ANS tests snapshot”, “\ 31/3/2015 Variable #ERRORS added and incremented for each error reported”
Unit Test Tools in Assembly Language, for FORTH
Expert-generated List of FORTH implementations, which are shipped with Unit Test Tools
  1. eForth for ST8 ( in FORTH ).
  2. Gforth.
  3. Win32forth. Not included in the default FORTH kernel, but provided as Forth script file with distribution package.
  4. zedforth ( in Z80 assembly language ).

Unit Test Resources

T{ 1 2 drop }T 1 ==
T{ 1 dup }T 1 1 ==
T{ 2 1 swap }T 1 2 ==

Debugging Resources

Practical FORTH Debugging Session

  • You can test this yourself in a forth system of your choice. just press
    1 +
  • and an error message will come.
    1 2+
  • gives ok. type
  • then the stack is printed.
  • displays an error and empties the stack.
    1 2 3 .S +.S +.S
  • you see it. type
  • this gives an error and your stack is empty again
  • now pointers, type
    VARIABLE A 0 A !
  • poke's 0 in a A
  • peeks in to A and put it on the stack
  • you can see this an test this
    . VARIABLE B 10 B !
  • you test
    A@ B@ .s
  • and decide that you want to add them up type
    + .S
  • if you like it you make it a word:
    a@+b@ (-- n) a @ b @ + ; 5 6 B ! a ! A@+B@ .
  • and test is
    5 6 .s B ! A ! .s A@+B@ .s . .s B@+A@
  • gives a error again. Try :
    2 1 ;
  • and type
    2 .
  • see how powerful forth is
    . 2 2 + . forget 2 2 2 + .

Packet Manager, Repository


Appropriate OpenDirectory Directory Pages

en/forth04.html.txt · Last modified: 2021/09/25 12:05 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki