Re:Writing a Forth in Haskell
by lacampbell on Friday June 09, 2017 @08:32AM
(#14520896)
I had this dumb idea of actually evaluating LISP in a forth inspired way. It would be a stack of subroutine/accumulator pairs. so given
(+ 1 2 3)
"(" would pop an pair on a stack, + would set its subroutine, and 1 2 3 would be fed to the subroutine and accumulate a value. when ) is encountered, the data is fed into the subroutine/accumulator pair lower on the stack, so you could still have nesting.
Horribly inefficient, but I thought the idea was neat. I'm sure I'm not the first to think of it though.
Re:Writing a Forth in Haskell
by agumonkey on Monday June 12, 2017 @03:54PM
(#14540510)
some antique famous lisper (Henry .. forgot last name) did write a linear lisp that works by stack evaluation. From the few that I grasped, since everything is mostly duped, it's like a new value each time; free borrowing ?
Horribly inefficient, but I thought the idea was neat. I'm sure I'm not the first to think of it though.