[TUHS] A thing I did (AI Slop Alert)
Adam Thornton via TUHS
tuhs at tuhs.org
Mon Aug 10 12:45:56 AEST 2026
So, for a while now, I've been wanting a Forth implementation for v7 Unix,
because I like V7 and Forth is about my favorite language for implementing
nifty stuff that runs pretty well in constrained environments.
I am not fluent in PDP-11 assembler (and v7 "as" is not as capable as
MACRO-11), but I do speak K&R C pretty well. I'd tried this a couple times
and gotten bogged down either in too many symbols in a file (one per word)
or too many symbols for the linker (one file per word).
So I had Claude do the implementation. It sidestepped the above problem
with a really tedious switch statement. It claims to be Forth-78 and
Forth-79 compliant, and has tests for all the words, although I haven't
actually verified that the tests are correct.
It made another weird choice, in that the contemporary Forths I've seen
have had a much smaller set of native primitives and have made the rest of
the words out of those.
There's also a reasonable screen editor for Forth blocks, and an
upload/download tool (this was more traditionally pair-programmed, in that
Claude did some things, then I did some things, then Claude did some more
things, rinse and repeat) that works well with simh (with dynamic serial
line speed detection) and presumably for a real PDP-11 with a serial line
behind a telnet-to-serial bridge.
https://github.com/athornton/v7vibeforth
Pair programming with Claude was an interesting experience. My notes are
in the README.
I will say: I probably would never have finished this project without
Claude's assistance (see above about the linker and symbol tables), and I
*definitely* would not have written this extensive a test suite.
And now I have a working Unix v7 Forth, which is what I wanted in the first
place, so yay.
Adam
More information about the TUHS
mailing list