views:

103

answers:

2

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?

+5  A: 
Jörg W Mittag
My pop-culture addled brain automatically read that as the *Second Futurama Projection*
kibibu
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:

http://meta-alternative.net/calc.pdf

SK-logic