[LLVMdev] Idea for the Summer of Code
morten at hue.no
Thu May 4 09:14:47 PDT 2006
Andrew Wagner wrote:
> Hi all,
> I have an idea for a proposal for the summer of code which I think is
> pretty cool, but I wanted to run it past you all to see what you thought
> of it first.
> Basically, the proposal is to use LLVM as a test bed for a more
> theoretical idea I have. I want to develop a grammar-level way of
> formally specifying how to translate between two languages. Borrowing
> from XSLT (a way of transforming XML documents), and lex/yacc
> specifications, I want to be able to formally describe the process of
> taking a sentence generated by one grammar, and turning it into a
> sentence generated by another grammar.
You probably know this already, but a lot of work has been done in formalising this kind of process. The formal system
is known as "Rewriting Logic" and an good implementation of it is found in the Maude tool (http://maude.cs.uiuc.edu/).
> For example, if I have part of a formal description of a for-block in
> java, and the formal description of a for-block in C(++), I want a way
> to formally describe how to go from one to the other. Of course, while
> this example is source-to-source, a process like this would also have
> great implications for machine-language generation. Rather than the
> compiler doing all the work of translation and optimization, it would
> simply take in a mediating description between the source language and
> the machine language, and use that to generate the code.
It's an excellent idea to use a formal system for describing program transformations instead of programming them in C++.
I'm curious as to where LLVM fits into your plan, as I see such a system more like a competitor to LLVM...
More information about the llvm-dev