BugForth is a multiplatform self-hosting Forth-2012 System (Subset).
- Forth 92.1%
- C 5.7%
- Shell 2.2%
BugForth
BugForth is a multiplatform self-hosting Forth-2012 System (Subset).
Documentation for specific source files is located in doc/
Features
- Supports the following wordsets:
- Completely: CORE, EXCEPTION, SEARCH, MEMORY (C), FILE (C)
- Mostly: CORE EXT, DOUBLE, FACILITY, FILE (Bytecode), STRING, XCHAR (C), TOOLS
- Partially: FACILITY EXT
- Not yet: BLOCK, LOCALS, FLOAT
- Self-hosted cross-compiler
- Various libraries
- Almost no dependencies
Limitations
- Doesn't support number prefixes, C-style char literals or double literals.
Supported platforms
- C (Portable)
- POSIX compliant systems
- Bytecode (16-bit, portable)
- POSIX compliant systems
- 8086 (Limited support, deprecated for now)
- DOS
- 6502 (Limited support)
- NES (compile only)
- UXN (Limited support)
- Varvara (compile only)
Compiling
All targets depend on bugforth being available as a command if $FORTH isn't set.
The following environment flags can be used alongside the builder.sh script:
FORTH- Forth binary used to run the cross-compiler. Defaults tobugforthPREFIX- Location where./builder.sh install <...>will install BugForth. Defaults to/usr/localCC- C TARGET ONLY - C Compiler. Defaults toccCFLAGS- C TARGET ONLY - C Compiler flags. Defaults to-O2 -gBITS- C TARGET ONLY - Valid values: 32, 64. Defaults to64
Indirect call threaded C runtime (stable, recommended)
Dependencies: cc
./builder.sh make c posix # For POSIX compliant systems
./builder.sh install c posix # Install to $PREFIX
Bytecode (16-bit, stable)
Dependencies: cc, xxd
./builder.sh make bytecode posix # For POSIX compliant systems
8086 (experimental)
Dependencies: nasm
./builder.sh make 8086 dos # For systems compatible with DOS