News for hackers. Stuff that matters.
Re:Forth: The programming language that writes itself by ErroneousBosh on Monday October 20, 2025 @06:04AM (#45642106)
It's a different solution for a different time.

Forth was an excellent way to write a powerful and expressive programming language that could self-host with a bare minimum of assembly language "bare metal" programming.

The fridge-sized computer that Forth was originally developed on had double-digit kilobytes of memory (maybe 8192kwords, with 16-bit words) and clocked instructions through at a whopping 300kHz or so. The microcontroller that drives the Caps Lock LED on your keyboard is a hundred times faster with a hundred times the memory.

These days we do not need to squeeze editor, compiler, and target binary into such a tiny machine. If you're developing for a microcontroller you just use C on your "big" computer, which is unimaginably more powerful.

In the olden days of the 1990s I used a development system for embedded stuff that was written in and targetted Forth on a Z80 with a whopping 64kB of RAM and 5.25" floppies, but that was at least ten years old and five years out of date at the time.

You're probably reading my words on a slice of glass the size of half a sandwich that contains more computing power than existed in the whole world when Forth was first written.

It's a shame because writing something like Forth from the ground up (and I mean, assembly code to load the registers to start the ACIA to begin transmitting text to the terminal) perhaps in an emulated early 80s home computer is a great way to get a sense of what the chip behind it all is doing, and I feel that makes you a better programmer in "real" languages like Go or Python or C.

Re:Forth: The programming language that writes itself by kragen on Monday October 20, 2025 @09:31PM (#45651499)
What would your top two tips for beginning Forth programmers be? Other than "don't use Forth".
Re:Forth: The programming language that writes itself by ErroneousBosh on Tuesday October 21, 2025 @03:01PM (#45660095)
Find an existing implementation that runs on some computer you already have, or have an emulator for.

Then find a computer you're really into, and port fig-Forth to it, just for fun. Don't copy the source across, type it in with your own changes as you go.

Edit: Don't forget to have fun. That's the most important thing. You're doing this because you *can*, and just to see what will happen.

Re:Forth: The programming language that writes itself by kragen on Tuesday October 21, 2025 @07:27PM (#45663074)
Thanks!