Re: Decompilable interpreter/compiler hybrid

Martin Ward <>
4 Jul 2003 00:09:37 -0400

          From comp.compilers

Related articles
Decompilable interpreter/compiler hybrid (2003-07-02)
Re: Decompilable interpreter/compiler hybrid (Timothy Knox) (2003-07-04)
Re: Decompilable interpreter/compiler hybrid (Alex McDonald) (2003-07-04)
Re: Decompilable interpreter/compiler hybrid (Martin Ward) (2003-07-04)
Re: Decompilable interpreter/compiler hybrid (2003-07-13)
| List of all articles for this month |

From: Martin Ward <>
Newsgroups: comp.compilers
Date: 4 Jul 2003 00:09:37 -0400
Organization: Compilers Central
References: 03-07-022
Keywords: design
Posted-Date: 04 Jul 2003 00:09:37 EDT

On Wednesday 02 Jul 2003 5:44 am, Samir Ribic wrote:
> a) Source code is same as object code (interpreter's idea). In memory
> actually stands only machine object code. When displayed on screen, or
> edited in editor, it will be decompiled to ASCII. Every time when the
> line is entered, it will be compiled to machine code

One way to do this is to write your compiler as a logic
program in prolog or a similar language. Because of the declarative
nature of logic programming, you can feed the object code to
the compiler and recover the source code.
Implementing optimisations to such a compiler is a little tricky
(to say the least!). This paper by Jonathan Bowen
describes one example:

You will need a tiny prolog implementation, go to and search for
"tiny prolog" for an example (the ZIP file contains
a 27Kb .com executable and 49Kb PASCAL source)

Martin Erdos number: 4

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.