Ook!

I love esoteric languages. They're a never ending rabbit hole, and they really force you to revisit all of your assumptions about what it means to program. The most interesting ones for me were the Lambda calculus and Brainfuck.

And of course there is Forth. Which always felt like it was just around the corner from some kind of breakthrough but it never really happened.

Collaborative software projects and all of the modern tooling feel like massive (and endless) layers of abstraction on top of some pretty simple principles. Esoteric programming languages allow you to revisit programming without all of that super structure and for that alone they are valuable, they are pretty pure in that sense.

> And of course there is Forth. Which always felt like it was just around the corner from some kind of breakthrough but it never really happened.

Forth, (I think even more so than lisp), is fragmented, because its philosophy is not that you write “a forth program”, but that you write “a forth” that does what you need it to do. Don’t like the sign MOD chose to compute ‘-3124 modulo -17’? Don’t add a new one, but change yours. Need better approximations for integer goniometric functions? Change them to work in half-degrees, etc.

That makes sharing code difficult and that, in turn, makes it hard to write large programs.

Nowadays, I guess a ‘solution’ to that problem would be to run zillions of forths as microservices in a single process, but I don’t think that’s practical (could be fun, though. In the limit, one could give each forth a VM page of RAM or maybe even less to work in. Imagine a forth whose sole goal is to maintain and edit a string, with words for string indexing, search, replace, duplication, etc. that runs together with millions of other forths in a single process.

Your musings at the end reminded me vaguely of https://www.greenarraychips.com/ a Chuck Moore designed computer chip.

"With 144 independent computers, it enables parallel or pipelined programming on an unprecedented scale. Map a data flow diagram or an analog block diagram onto its array of computers for continuous processes without interrupts or context switching."

Interesting view. The way I approached Forth was to create a DSL that made it easier to write the application in.

The biggest issues that I had with Forth were: hard to work on code as a team, the 'screens', finding it increasingly hard to name words.

> The way I approached Forth was to create a DSL that made it easier to write the application in

You must have had the luxury of zillions (that is: > 16 kilobytes) of RAM and ROM.

> The biggest issues that I had with Forth were: […] the ‘screens’

Most Forths on larger machines, where you had the luxury of not needing to tweak the base system to fit all your code in are fine working with source files.

Screens were an invention for smaller systems (for those who don’t know: early forth didn’t have a file system, but just a way to load 1 kilobyte blocks from disk. Code was written in such 1 kB blocks, called ‘screens’ because 1kB effectively filled a 16 line by 64 character terminal screen)

There's more than one good way to define "esoteric" but it gave me cognitive whiplash to hear the term used about lambda calculus.

I can understand that perspective, there are plenty of purpose-built esolangs which are very close to the OG lambda calculus, and depending on your background the whole thing might seem bizarre and unfamiliar and ancient and irrelevant.

At least logically I see that could happen, but my heart disagrees. I see lambda calculus as a root of the conjoined tree[0] which supports all of modern programming. It feels to me like calling written English esoteric because some people get by without reading and writing!

(I'm certainyl not saying you're wrong, but just that it's fascinating how different two valid perspectives can be.)

[0] https://en.wikipedia.org/wiki/Inosculation

I'm talking about it not in the sense as the root of other programming languages but as a programming language in its own right.

If there is anything that helped me 'see the light' then it was this: that I could build anything with a core that small.

Coding used to be about learning about the mathematical underpinnings of computation and then learning a specific mapping from the math to the software implementation. These days we don't teach that to undergrads (or maybe they get it in passing in a survey class.) We don't teach parsing. It seems we teach a list of features you should expect in your Python implementation or Linux version. Maybe you get a class on SQL. It's astonishing to me that kids today can get a CS degree without learning what Lambda Calculus (or even Pi Calculus) is (are). I got a PHYSICS degree and took a course on the mathematical underpinnings of computation so I would understand why all that FORTRAN code I had to maintain looked as funky as it did. As best I can tell, our 4 year research institutions are a weird mix between day care facilities and trade schools. Just once I would love to meet a recent undergrad who had taken a compilers class or understood the difference between s-expr's and m-expr's.

File under "old man yells at cloud."

High-five! I also learned about all this as physics undergrad trying to escape from Fortran.

We should start a support group.

Other's have mentioned that Forth isn't an esoteric language, however if you want a Forth written for an esoteric language I have written one for SUBLEQ (see https://esolangs.org/wiki/Subleq). Although SUBLEQ is more of an esoteric machine than a language, it also sort of qualifies as one (and has an entry on the esolangs Wiki).

It's available at https://howerj.github.io/subleq.htm if you want to try it online.

Forth isn't an esoteric programming language. The word “esoteric” has a specific meaning in this context.

What do you mean? It has a tiny compiler and is quite difficult to understand, are there are any other qualities required for inclusion or is there some secret that I'm not aware of?

Esoteric programmign languages are created more as an experiment, joke, art project, or proof of concept than for practical software development. They prioritize novelty, challenge, or expression over practicality and efficiency.

Forth is not that.

It was designed as a practical, stack-based language for embedded systems, instrumentation, and real-time applications. It emphasizes simpilcity, extensibility, and efficiency, and has been widely used in space missions, robotics, and hardware control. While its stack-oriented, postfix syntax can look unusual to those used to C-like languages, its purpose is entirely practical, not experimental or artistic.

This is a copy-paste of what I wrote elsewhere:

> Here's the definition from the esoteric programming language wiki, which is a lovely resource for anyone interested https://esolangs.org/wiki/Esoteric_programming_language:

> "An esoteric programming language is a computer programming language designed to experiment with weird ideas, to be hard to program in, or as a joke, rather than for practical use."

FORTH is difficult to understand? I respectfully disagree. Well... I mean... if you can grok C, you can grok FORTH is my assertion. If you can't grok C or assembly, then sure, FORTH is pretty esoteric. But in that example, so is C.

It is most assuredly different than typical languages, but I don't think that means "esoteric". As an industry, we're sort of lost if "esoteric" means anything that doesn't look like Algol.

Forth is a bit of a headtrip for people due to (a) how it parses and executes and (b) the stack-based nature of it. Particularly, symbols traditionally considered syntactic are fair game* for user-space definitions, and some words are "immediate" which means that they act at compile time, where others act at runtime. This combination seems particularly challenging for students of languages which don't mix compile-time and runtime, only use a stack for function calls, etc.

I'm of the opinion that one must write a forth to grok forth, and I'm far from alone in that. However, I'd not quite call forth itself esoteric. But to many, it's a language family... of which most of the members are esoteric inasmuch they only have a single user.

* shout-out to my friend whose forth supports lists, hash tables, and structs through syntactic sugar... https://github.com/cstrainge/sorth

Why is RPN a head trip? Or rather... I don't think it's as much a head trip as prefix or infix notation. You've got your data. You've got your operation. Sometimes the data is on a stack. Sometimes it's on a heap. Just a little different way of specifying which is where.

Also... +1 on the "you've got to write it to understand it." And in the 80s, the documentation wasn't super. Leo Brodie's book was great to get you started, but understanding things like ' (tick) and how to program in "idiomatic forth" was a challenge. So I would add, "not only do you have to code FORTH to understand FORTH, you also have to rip someone elses' FORTH program apart to understand the more advanced bits." -- I could be wrong about that today, it's been a while since I did a survey of FORTH documentation.

> Why is RPN a head trip?

It isn't how we teach math in the two countries I've lived in. Lisp is just as weird. Many people see a mathematical expression and panic. A level up from them, people see a mathematical expression in some source code and expect it to respect the symbol precedence that they were taught in grade school -- which they can "understand" without knowing how the language parses and abstracts all that away. And maybe their understanding is flawed but they can survive as programmers for decades without ever going deeper. Lisps, FORTHs, etc., don't allow you to proceed without understanding.

My bigger problem with read other people's Forth is that no two Forths are the same. The language itself isn't really the problem. It is that you can only approach someone else's Forth code bottom-up otherwise you just don't understand at all what is going on. Most other languages allow you to dive in from the top, learn as much abstraction as required to get the job done and then you can move on.

I was famous at IBM for the quip: "The good news about FORTH is you can use it to write your own DSLs to model the problem you're working on. The bad news is the person down the hall already has." But we still used a metric butt-load of FORTH for board bring-up and firmware.

But more to your point. FORTH was used in a time when the predominant mode of coding was to construct more complex programs from less complex programs, so application developers usually got their hands dirty with some lower level aspects. That is... the application programmers chose the lower level abstractions they wanted to use. Now that we're beyond that and have, as an industry, decided that van Rossom and Latner are the only people who are allowed to define low-level abstractions, it's a lot harder to do that.

(Again, file this one under "old man yells at cloud.")

[2nd edit]

Maybe it's best to think of FORTH as a DSL construction kit. Lisp is kinda-sorta the same way. As you point out, it's super easy for someone to develop DSLs that require coders to understand not only their application domain, but also how the language and it's underlying hardware abstractions operate. And when you're using someone else's DSL, you have to understand how they thought about the problem domain. And we stopped teaching how to analyze that in the 80s.

Yes, for bringup it is a very nice tool. Just enough, not too much. I used it for a 68K board in exactly that role.

Forth is unbelievably underrated and I think its value is locked in poor DX.