This looks really neat, although I'm still wrapping my head around it! It's funny how things that are even more fundamentally simple than what has been discovered, can be (initially) harder to reason about!
So you could presumably also write a Lisp interpreter AND a Forth interpreter using it?
(Might as well write a Turing machine interpreter too for the trifecta... assuming one can decide on the syntax...)
That plus some additional functionality to make it more usable in the general sense (adding math functions, string manipulation, maybe some basic I/O) and it might be a VERY interesting instructional tool.
I've heard the term "thunk" but I forget what it means...
That's the way I tend to read it. The fun bit then is applying context at eval time.
Rebol allows you to use a block as a list/function/thunk, which is lazily evaluated. This changes the scoping in that you BIND a context to this thunk.
It's a different take on process migration in that the context can be serialised with the thunk, or a new context applied at the process site. This is in contrast to lexically scoped lambda functions which then need to account for dynamic (free) variables somehow.
So you could presumably also write a Lisp interpreter AND a Forth interpreter using it?
(Might as well write a Turing machine interpreter too for the trifecta... assuming one can decide on the syntax...)
That plus some additional functionality to make it more usable in the general sense (adding math functions, string manipulation, maybe some basic I/O) and it might be a VERY interesting instructional tool.
I've heard the term "thunk" but I forget what it means...