I was wondering if there has been any research into adding higher-
order instruction to the Java bytecode? In other words instructions
that either push or pop instructions on the evaluation stack.
There are only a few core instructions that would be neccessary to
build others :
- constantly : pop a value, push an instruction on the stack that
returns that value
- compose : pop two instructions, push a new instruction that
evaluates the first function, then the second.
- eval : pop an instruction and evaluate
This functionality would make it easier for me to compile functional
languages to the CIL, and make them much more efficient.
We have been discussing the topic on Lambda-the-Ultimate (
http://lambda-the-ultimate.org/node/2177
). The first response from
many people is that they believe that this functionality has a huge
performance hit, and loses the effect of statically verifiable type
safety. This is untrue.
I've developed a type-system for stack-based languages with higher-
order functions and written a paper about it at :
http://www.cat-language.com/paper.html.
I believe the work to be novel, and I would be interested in
discussing it further.
Cheers,
Christopher Diggins
http://www.cdiggins.com