3 ms·
Lisp can take a chunk of lisp code and operate on it directly... forth can't do the same. The big difference with forth is the inability to do things other tha
by mikewarot 6y ago
Lisp can take a chunk of lisp code and operate on it directly... forth can't do the same.
The big difference with forth is the inability to do things other than variables (fixed allocations) and use the stack. The handling of lists and garbage collected larger things on the heap are a huge advantage for the Lisper.
- RodgerTheGreat 6y agoForth doesn't need an abstraction for operating on threaded code; forth programmers routinely write their own words for control structures with an awareness of the internal structure of dictionary entries. You're operating on code-as-data, it's just an entirely different mechanism for doing so. It's entirely possible to work with dynamically allocated memory in a Forth that runs on top of some other operating system, like GForth. When you're on metal, you can build whatever kind of allocator you want. The primitives "create"/"allot" are just that- primitives. Here's a trivial example of building a cons-pair heap in Forth: https://gist.github.com/JohnEarnest/4522067 https://gist.github.com/JohnEarnest/4522067