3 ms·
You're not the only one to observe this. It was observed and explored by Manfred von Thun with Joy, a purely functional programming language based on Forth. Mod
by garmaine 8y ago
You're not the only one to observe this. It was observed and explored by Manfred von Thun with Joy, a purely functional programming language based on Forth. Modern "concatenative" languages continue this tradition:
https://en.wikipedia.org/wiki/Concatenative_programming_language https://en.wikipedia.org/wiki/Concatenative_programming_lang...
- carapace 8y agoI've been working with Joy for a few years now and I have to say that it seems to me to combine the best parts of Forth and Lisp. It's ridiculously elegant.
- garmaine 8y agoDo you have a link to whatever project you are working on? I'm interested in Joy but not aware of anyone working on or with it in recent decades.
- carapace 8y agoSure! I developed an interpreter for Joy in Continuation-Passing Style in Python: http://joypy.osdn.io/ http://joypy.osdn.io/ I had just implemented type inference[1] when I got smashed over the brain by Prolog. So now the Python code is in limbo because the Prolog implementation of Joy is blindingly elegant[2]. In Prolog, the Joy interpreter is also the Joy type inferencer.[2] The compiler (from Joy expressions to new Prolog rules) is five lines long.[2] [1] http://joypy.osdn.io/notebooks/Types.html http://joypy.osdn.io/notebooks/Types.html [2] https://osdn.net/projects/joypy/scm/hg/Joypy/blobs/tip/thun/thun.pl https://osdn.net/projects/joypy/scm/hg/Joypy/blobs/tip/thun/...
- garmaine 8y agoThanks! Yes, there's a real connection between concatinative languages and logic languages. In some sense you can think of a concatinative logic language as Joy with the ability to push "unknown" values onto the stack, as well as a few constraint manipulatives. That's somewhat orthogonal, but it makes sense an interpreter for Joy would be quite compact in prolog. Thanks for the links, I'll review your work later!
- carapace 8y agoCheers! You might also like: http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/ He transforms Haskell to a point-free form that's suspiciously like Joy... ;-)