9 ms·
Nice to see more interest in Forths and concatenative languages lately on HN. IMO they’re even more amenable to metaprogramming than Lisps, and there’s a lot of
by evincarofautumn 9y ago
Nice to see more interest in Forths and concatenative languages lately on HN. IMO they’re even more amenable to metaprogramming than Lisps, and there’s a lot of power in a compositional, interactive style of programming, especially for a low-level language with no safety nets. I definitely recommend playing around with a Forth (I like Gforth) or Factor, and trying to absorb some of the philosophy—it’s helped improve my program design in other languages.
- notduncansmith 9y agoSpeaking of concatenative languages, Joy and K (and I suppose J) should get mentioned as well. Lots of wisdom to be drawn from those languages and the minds behind them, and especially interesting when examined in tandem with Lisps and various functional programming languages.
- arethuza 9y agoA long time ago I worked for a few years on a project that had a Lisp back end and a PostScript front end (in NeWS/HyperNeWS). Recently I've been wondering about something that was Lisp like at the higher levels but that switches to a more Forth like style at lower levels...
- boomlinde 9y agoI don't think that K and J belong in that category of languages. While they both also welcome a point-free style of programming, an important characteristic of concatenative languages is that (almost) any sequence of tokens is a valid sub-program, making it very easy and natural to factor and compose programs from smaller programs. In Forth, if you figure that a sequence of 5 tokens are used often, you don't consider what parameters are used and name them in a function definition. You rip those 5 tokens out verbatim into a word definition, which when called pulls them implicitly off the stack just as if the tokens were in-line.
- notduncansmith 9y agoYou're absolutely right, thanks for correcting my mistake. I think my brain lazily threw them in there because I learned about them all around the same time. Also, I came across this fascinating directory of links a while back, some of which explore the overlap further: http://nsl.com http://nsl.com