This is a card in Dave's Virtual Box of Cards.

Forth!

Created: 2022-03-19
Updated: 2023-03-08

Why Forth?

Legend

When I was first learning about programming languages through the ages, Forth was always the stuff of legend. The flexibility to, say, redefine an integer to return a different value:

    : 4 12 ;
    ." The value of 4 is " 4 . CR
    The value of 4 is 12

Delicious madness!

Update: I’ve expanded upon this in my talk-turned-web-page: Forth: The programming language that writes itself

Stack-based

I was really curious what it was like to program in a stack-based (or concatenative) language - and equally curious how one was built.

Bootstrappable

Now that I’ve learned how Forth is implemented, I’ve discovered that the strength of Forth has little to do with being stack-based. That’s just incidental. It’s strength comes from the ability bootstrap an incrementally higher level language from a very low-level one.

A handful of Forth instructions implemented in assembly lets you implement the rest of Forth…​in Forth! That’s just cool.

And the reason you can do that is because of the legendary flexibility that allows you to redefine 4 to return 12.

Related:

External:

Oh, and I just remembered another major source of "Forth lust" that probably provided the final push to make me try it out for myself: the "programming in the twenty-first century" blog, with posts like this:

Oh, and definitely also this: