<History of Programming Languages II> I just stum...
# linking-together
g
History of Programming Languages II I just stumbled across this and haven’t read it. It might be of interest to others. The papers are visible in the “book downloads” section. I was interested in seeing if there are any revelations about what makes Forth seem so powerful, but, I notice a lot of other interesting mentions, like the Icon programming language which I remember to be a backtracking, text processing language.
❤️ 1
g
Are there any examples of a concatenative language not based on a stack? Work I’m doing naturally expresses itself as concatenative operations on a namespace. The arguments to functions being called are also themselves a namespace. It’s all delightfully symmetric. This just sounds like regular function calls as I’m describing it, but there is more to it. :-)
g
I didn’t come up with any thoughts on my own, but, I was intrigued and typed this query into Google and Claude:
Are there examples of concatenative languages that don’t use a stack?
I was pointed to Om, Enchilada, Deque, Joy, and state transforming languages like UNIX pipes, Brainf...ck, etc. And a thread on HN And a thread on reddit I then asked about electronics and got an affirmative response. aside: I think that electronic schematics most accurately model asynchronous reality, but need a facelift (like recursive definitions of ICs as readable schematics themselves). observation: the “power” of Forth goes deeper than just the stack, the functional paradigm causes deep, hidden coupling (of control flow) when mapped onto hardware which requires the use of (complicated, preemptive) operating systems to decouple (by converting functions into state machines); Forth doesn’t cause this issue and makes it possible to break free from using an operating system (I suspect that other concatenative languages lead to this, also, but I’ve only explored schematic-y ideas (like PBP))
👍 1
w
Kihi michael.homer.nz/Projects/Kihi might count as an example @Guyren Howe. In general one can consider the stack as an implementation detail for concatenative languages. Rewrite semantics might sometimes be a more natural way to think about what they do. And we can non-strict evaluation. Suppose we have:
Copy code
: motion ( mass velocity -- momentum kinetic-energy )
  tuck *  tuck *  2 / ;
Then you might have an expansion like:
Copy code
mass velocity motion
→ mass velocity tuck * tuck * 2 /
→ velocity mass velocity * tuck * 2 /
→ velocity ⟨mass velocity *⟩ tuck * 2 /
→ ⟨mass velocity *⟩ velocity ⟨mass velocity *⟩ * 2 /
→ ⟨mass velocity *⟩ ⟨velocity ⟨mass velocity *⟩ *⟩ 2 /
→ ⟨mass velocity *⟩ ⟨⟨velocity ⟨mass velocity *⟩ *⟩ 2 /⟩
The brackets are just clarity. Showing sub-terms that group together but won’t reduce further.
👍 1