It is possible for me to build my own Interpreter that could then be transformed into a compiler? If yes, how do I go about building it?
My pop-culture addled brain automatically read that as the *Second Futurama Projection*
kibibu
2010-04-15 04:34:53
A:
An already mentioned partial evaluation is one of the possible methods (a very computationally intensive one, but quite generic on the other hand). Another approach is metaprogramming: if an interpreter of a language is implemented in a form of a simple translator which targets another interpreted language, it is very easy to re-target it later to some compiled language, or replace the target interpreter with a compiler.
This tutorial shows a couple of metaprogramming-based approaches:
SK-logic
2010-04-17 08:55:44