I've only used R casually in some statistics class so this really surprised me.
It's certainly worth investigating. I suspect that the compilers don't do anything
with code that uses the fexpr-like facilities (i.e. they just pass it on to an interpreter
at runtime), but I hope I'm wrong!
I found interesting that they use promises as operands, so every time a function
is called it gets each argument with a value slot (for memoization), the expression
(for fexpr style access) and an environment (for evaluation of the promise).
This is (almost) exactly the representation of promises in the kernel report
(except for the boolean tracking whether the value has already been computed).
But other than that, it's interesting in that the arguments and the expressions are
explicitly tied together (where in kernel the environment is another argument and
you have to manually evaluate each expression in the corresponding env)
Regards,
Andres Navarro