4 ms·
Forth is a charming little language, and I highly recommend spending a few evenings implementing one on the processor of your choice. You'll be astonished at ho
by kabdib 3y ago
Forth is a charming little language, and I highly recommend spending a few evenings implementing one on the processor of your choice. You'll be astonished at how much functionality will fit in just a few kilobytes. FORTH will teach you no-foolin' hard core pragmatism, and a few dirty tricks that will make you smile.
(That said, I don't like FORTH much at all. The amount of stack-thinking is just agony).
- zoltar 3y agoThere was always something I liked about Forth when I didn't have to do much stack-thinking. One of the things that felt forth-y to me when I first encountered it was threaded code in Clojure (or any other point-free kind of idiom for that matter). https://santhoshkris.medium.com/threading-macros-in-clojure-eb08faf85f80 https://santhoshkris.medium.com/threading-macros-in-clojure-... I'll sometimes abuse Python's compose to do similar things I won't send out for code review. Maybe I really should just try to live in Coconut instead of silly stuff like: import chess import chess.svg from IPython.display import SVG, display from functools import reduce def rcompose(*fs): return reduce(lambda f, g: lambda *xs, **ys: g(f(*xs, **ys)), fs) inline_board = rcompose( chess.Board, chess.svg.board, SVG, display) Factor's quotations dealing with stack management weirdness is super nice, too. https://concatenative.org/wiki/view/Concatenative%20language/Concatenation%20is%20composition https://concatenative.org/wiki/view/Concatenative%20language... It still has a bit more stack juggling than I like, though. That could just be a "me" problem. Props to that whole community for their effort. https://www.youtube.com/watch?v=f_0QlhYlS8g https://www.youtube.com/watch?v=f_0QlhYlS8g
- timbit42 3y agoIf you're doing a lot of stack-thinking, you're doing it wrong. Perhaps your words are too big and doing too much.