planckforth: Bootstrapping a Forth interpreter from hand-written tiny ELF binary

Published: (February 16, 2026 at 06:44 AM EST)
2 min read

Source: Hacker News

PlanckForth: Bootstrapping an Interpreter from Handwritten 1KB Binary

How to build

Only xxd is needed to build PlanckForth.

git clone https://github.com/nineties/planckforth.git
cd planckforth
make
# The makefile runs:
# xxd -r -c 8 planck.xxd > planck
chmod +x planck

Implementations in other languages are in the others directory.

Hello World

Running the tiny binary directly:

./planck
kHtketkltkltkotk tkWtkotkrtkltkdtk!tk:k0-tk0k0-Q

After bootstrapping with bootstrap.fs:

./planck  b)

Built‑in words

WordMeaningStack effectDescription
=equal( a b — c )c = (a == b)
(shl( a b — c )c = a > b (logical)
%sar( a b — c )c = a >> b (arithmetic)
vargv( — a‑addr u )Argument vector and count
Vversion( — c‑addr )Runtime information string

Binary Layout

binary layout

Implementations

ImplementationBuild commandTest status
Handwritten ELF binary for i386‑linuxmaketesting i386-linux-handwritten
Cmake ctesting c
Python 3.xmake pythontesting python

Benchmarks

See the Benchmarks page on the wiki.

0 views
Back to Blog

Related posts

Read more »