Lugforth
A small Forth interpreter: a C kernel plus Forth boot code, in the spirit of (u)eForth.
Download
The manual (PDF). Builds on the latest release: Linux (tarball, AppImage), Windows (zip, built with MSVC or MinGW, with the SDL2 DLLs, examples and docs), macOS (zip), Android (APK), Raspberry Pi and PC UEFI images. The zips carryexamples/ and docs/.Try it
The web version, with Breakout, drums, a roguelike, a 3D maze with the raycaster (steered with the mouse) and a pinball (touch buttons on phones). Any game file also runs withterminal.html?run=sdl2_roguelike.fs.
Drawing from HTML buttons: Forth word called by a button,
vector lettering,
outline lettering,
string art
(sources).Platforms
Linux, macOS, Windows, web, Android, Raspberry Pi, PC (UEFI), ESP32, Raspberry Pi Pico, pico-ice, Game Boy Advance. See ports.Added to uEforth
- About 70 missing ANS words (
pick,roll,compare,>number, doubles...). - SDL2 bindings: windows, drawing, input, images, text, sound, ABC music, also on the web with the same words.
- A terminal line editor: history, cursor keys, Tab completion of
words and file names. A pager (
common/pager.fs) stops long output at each screenful on a terminal and on the bare-metal consoles: space, Enter,q;pager-off. - New ports: Android, Game Boy Advance, Raspberry Pi Pico, Raspberry
Pi and PC UEFI (bare metal), SDL2 on Windows and macOS, a console window
in SDL2 (
lugforth --gui). - Two text editors,
edandwrithdeck(Linux, macOS, Windows; also under gforth). - Examples: games (Breakout, roguelike, 2048 with animation), turning 3D wireframes, a rule based inference engine, benchmarks, a txt2tags converter.
Quick start
git clone https://github.com/luginf/lugforth.git
cd lugforth
sudo apt install ninja-build
./configure.py
ninja
out/posix/lugforth
--> : square dup * ;
--> 12 square .
144 ok