krisbug/bugforth
2
4
Fork
You've already forked bugforth
1
BugForth is a multiplatform self-hosting Forth-2012 System (Subset).
  • Forth 92.1%
  • C 5.7%
  • Shell 2.2%
krisbug 50009bb4ae
All checks were successful
build / build (push) Successful in 1m8s
test / test (push) Successful in 48s
Split kernel, rename "kernexts" to "kernmods", small refactor in cross-compiler, add software div/mul
2026年07月12日 17:18:02 +02:00
.forgejo/workflows Add test command to builder.sh, add Gerry Jackson's Forth 2012 test suite 2026年06月12日 12:50:10 +02:00
arch Split kernel, rename "kernexts" to "kernmods", small refactor in cross-compiler, add software div/mul 2026年07月12日 17:18:02 +02:00
doc/src Refactor, new header types, remove arch/bytecode/optimize, bring back support for headers without two XT fields 2026年06月06日 16:35:06 +02:00
lib lib/str: Add string buffers and APPEND 2026年05月25日 13:05:21 +02:00
src Split kernel, rename "kernexts" to "kernmods", small refactor in cross-compiler, add software div/mul 2026年07月12日 17:18:02 +02:00
test Add test command to builder.sh, add Gerry Jackson's Forth 2012 test suite 2026年06月12日 12:50:10 +02:00
.gitignore arch/bytecode improvements and refactoring 2025年07月30日 19:09:56 +02:00
builder.sh Split kernel, rename "kernexts" to "kernmods", small refactor in cross-compiler, add software div/mul 2026年07月12日 17:18:02 +02:00
LICENSE Update README 2026年07月11日 17:23:11 +02:00
README.md Add HEX and DECIMAL to xcomp INTERPRETER scope, make arch/uxn/varvara demo more interesting, update README 2026年06月15日 18:50:37 +02:00

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 to bugforth
  • PREFIX - Location where ./builder.sh install <...> will install BugForth. Defaults to /usr/local
  • CC - C TARGET ONLY - C Compiler. Defaults to cc
  • CFLAGS - C TARGET ONLY - C Compiler flags. Defaults to -O2 -g
  • BITS - C TARGET ONLY - Valid values: 32, 64. Defaults to 64

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