cxxforth: A Simple Forth Implementation in C++
by Kristopher Johnson
cxxforth is a simple implementation of a Forth system in C++.
cxxforth implements a subset of the words in the ANS Forth draft standard. Refer to that document for descriptions of those words. Additional non-ANS words are described in the cxxforth source code.
This is free and unencumbered software released into the public domain. See UNLICENSE.txt for details.
cxxforth executable and other targets is easiest if you are on a
UNIX-ish system that has
cmake, and Clang or GCC. If you have those
components, you can probably build
cxxforth by just entering these commands:
cd wherever_your_files_are/cxxforth make
If successful, the
cxxforth executable will be built in the
If you don't have one of those components, or if 'make' doesn't work, then it's
not too hard to build it manually. You will need to create a file called
cxxforthconfig.h, which can be empty, then you need to invoke your C++
compiler on the
cxxforth.cpp source file, enabling whatever options might be
needed for C++14 compatibility and to link with the necessary C++ and system
libraries. For example, on a Linux system with gcc, you should be able to
build it by entering these commands:
cd wherever_your_files_are/cxxforth touch cxxforthconfig.h g++ -std=c++14 -o cxxforth cxxforth.cpp