R. G. Loeliger Threaded Interpretive Languages Their Design And Implementation[1] is an amazing book, since it was out of print, I printed it on a good 160gsm a4 paper, and I randomly open it every few weeks just to read through it. I strongly recommend it, even if you are not interested in Forth.
I have been programming in all kinds of languages, from assembly to clojure, but in 25 years I never programmed stack languages, I was kind of scared of them, it wasn't until I read the book and made my own Forth I understood what I was missing. Since then I made few interpreters, with jit, or with types, etc, it was super fun, but most of all it allowed me to see a completely new paradigm of programming, kind of the first time you understand eval/apply from 13th page of the LISP 1.5 Programmer's Manual. A language that writes itself and it is written in itself.
If you are making your own Forth, this Brad Rodriguez's article is also really good [2].
That second link has a link to a git repository and you can see the forth code there.
mananaysiempre · 2h ago
The original author of (that first implementation of) Open Firmware, Mitch Bradley[1], is still active on GitHub and in particular in Forth-specific discussions, by the way.
Bitcoin’s script language for smart contracts / spend conditions is Forth.
ebiester · 50m ago
If you like Snobol, I'd take a look at Icon, Griswold's research language after Snobol. It took a lot of the ideas but smoothed it out.
I remember writing the Icon string manipulation in java in college, and I've hated regular expressions for a long time because Icon had it right, albeit verbose.
geophile · 3h ago
Snobol was a major part of my formative years in computer science. I don’t recall how I came across the language, but it spoke to me in all sorts of ways.
- Elegant and weird syntax and structure.
- Powerful pattern matching.
- It was the first GCed language I used.
- The Griswold, Poage and Polonsky book on Snobol4. A classic in the K&R mold, to my mind.
- Took 2 compiler courses from RBK Dewar who worked on the Spitbol implementation. Great teacher, fantastic courses, with lots of insight into the Spitbol project and his research on the SETL language.
- Wrote software for my MSc thesis in Snobol4. It used so much memory that I had to book the school’s IBM 370 at 4AM to run the software. I think I got something like 1-2 MB of memory.
Animats · 1h ago
SNOBOL is a high level string processing language. Forth is an odd thing to implement in it. Forth is so low level you can implement it in an FPGA.
SNOBOL has patterns more powerful than regular expressions. The pattern matching can take exponential time, because it's a depth first search in a recursive space. Regular expressions, which have very limited backup, were adopted to put an upper bound on pattern match time.
JSR_FDED · 5h ago
I love this! SNOBOL is weird but the article does a great job showing the power of a small but very uniform and consistent language.
jollyllama · 4h ago
Upvote for Ratfactor who made the most useful HTMX reference around (even though it wasn't completed) https://ratfactor.com/htmx/
kaycebasques · 2h ago
(Tangential) On a recent roadtrip up to Portland from SF I stopped in a small historic mining town near Shasta called Dunsmuir. They had a Little Free Library so of course I had to check out what was in it. I was delighted to find an old book on Forth from the 80s, called Starting Forth. Inside of the book there were some business cards for FIG: Silicon Valley Forth Interest Group.
macintux · 1h ago
I was pleasantly surprised to discover that my favorite technical writer, W. Richard Stevens (RIP), long ago wrote a Forth manual for Kitt Peak Observatory.
In addition to the others mentioned here. It's a shame the able gui was not open sourced.
haolez · 4h ago
There are probably several, but I had contact in the beginning of my career with a company that made industrial printers. They said that, in the first years of the company (80s), adopting FORTH gave them an edge over the competitors and it was the main (tech) factor of their success. They implemented their firmware in FORTH with some PostScript wizardry as well.
Paying over $1000 for an rk3588 that lasts 4 hours, with glitchy wifi, bluetooth, and charging?! $500 for the SoC module alone, despite the fact that Chinese companies can put that same chip in a $200 handheld.
It’s a shame that China is so singularly capable at making things
I have been programming in all kinds of languages, from assembly to clojure, but in 25 years I never programmed stack languages, I was kind of scared of them, it wasn't until I read the book and made my own Forth I understood what I was missing. Since then I made few interpreters, with jit, or with types, etc, it was super fun, but most of all it allowed me to see a completely new paradigm of programming, kind of the first time you understand eval/apply from 13th page of the LISP 1.5 Programmer's Manual. A language that writes itself and it is written in itself.
If you are making your own Forth, this Brad Rodriguez's article is also really good [2].
[1]: https://archive.org/details/R.G.LoeligerThreadedInterpretive...
[2]: https://www.bradrodriguez.com/papers/moving1.htm
Threaded Interpretive Languages (1981) [pdf] - https://news.ycombinator.com/item?id=17227466 - June 2018 (1 comment)
and to the second link:
Moving Forth (1993) - https://news.ycombinator.com/item?id=26900401 - April 2021 (7 comments)
Moving Forth, Part 1: Design Decisions in the Forth Kernel (1993) - https://news.ycombinator.com/item?id=10949339 - Jan 2016 (5 comments)
FORTH is the type of thing that probably exists all over the place but it's so deep and arcane that you would never know it.
No comments yet
OpenBOOT: https://openfirmware.info/OpenBOOT
That second link has a link to a git repository and you can see the forth code there.
[1] https://github.com/mitchbradley
I remember writing the Icon string manipulation in java in college, and I've hated regular expressions for a long time because Icon had it right, albeit verbose.
- Elegant and weird syntax and structure.
- Powerful pattern matching.
- It was the first GCed language I used.
- The Griswold, Poage and Polonsky book on Snobol4. A classic in the K&R mold, to my mind.
- Took 2 compiler courses from RBK Dewar who worked on the Spitbol implementation. Great teacher, fantastic courses, with lots of insight into the Spitbol project and his research on the SETL language.
- Wrote software for my MSc thesis in Snobol4. It used so much memory that I had to book the school’s IBM 370 at 4AM to run the software. I think I got something like 1-2 MB of memory.
SNOBOL has patterns more powerful than regular expressions. The pattern matching can take exponential time, because it's a depth first search in a recursive space. Regular expressions, which have very limited backup, were adopted to put an upper bound on pattern match time.
It can be found here: https://www.forth.org/tutorials.html
and
https://github.com/ablevm/able-forth/tree/current
In addition to the others mentioned here. It's a shame the able gui was not open sourced.
No comments yet
https://hypercubed.github.io/joy/joy.html
https://en.wikipedia.org/wiki/Joy_(programming_language)
https://ratfactor.com/mnt-pocket-reform/
It’s a shame that China is so singularly capable at making things