Re:Forth vs Lisp
by eatonphil on Wednesday November 17, 2021 @06:07PM
(#29260044)
Great points. One thing that might help out with correctness is typed forths. But I haven't played with any of them. And I'm not sure if that solves the readability issue when sometimes you have stack manipulations happen very far ahead or behind relevant code.
[ Parent
| on HN ]
Probably, if you're doing complex calculations with Forth that have many operands, you should favor left-reductions: reducing the stack should be as eager as possible. Don't pile all the operands into the stack all at once followed by a soup of words to decimate them. The code generation algorithm should be: whenever you write down an operand to be pushed into the stack, then if a reduction is thereby made possible, you should add the word to achieve that reduction.
Re:Forth vs Lisp
by DonHopkins on Thursday November 18, 2021 @06:49AM
(#29264417)
HP programmable reverse Polish notation calculators have a typed variant of FORTH called RPL, which is in some ways similar to Lisp or PostScript: