Re: xml as intermediate representation

"Vidar Hokstad" <vidar.hokstad@gmail.com>
27 Sep 2005 09:44:04 -0400

          From comp.compilers

Related articles
xml as intermediate representation khurana.tanuj@gmail.com (tanuj) (2005-09-17)
Re: xml as intermediate representation Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2005-09-17)
Re: xml as intermediate representation jeffrey.kenton@comcast.net (Jeff Kenton) (2005-09-22)
Re: xml as intermediate representation touati@prism.uvsq.fr (TOUATI Sid) (2005-09-22)
Re: xml as intermediate representation kers@hpl.hp.com (Chris Dollin) (2005-09-23)
Re: xml as intermediate representation vidar.hokstad@gmail.com (Vidar Hokstad) (2005-09-23)
Re: xml as intermediate representation demakov@ispras.ru (Alexey Demakov) (2005-09-27)
Re: xml as intermediate representation vidar.hokstad@gmail.com (Vidar Hokstad) (2005-09-27)
Re: xml as intermediate representation touati@prism.uvsq.fr (TOUATI Sid) (2005-09-30)
| List of all articles for this month |

From: "Vidar Hokstad" <vidar.hokstad@gmail.com>
Newsgroups: comp.compilers
Date: 27 Sep 2005 09:44:04 -0400
Organization: http://groups.google.com
References: 05-09-07805-09-113
Keywords: analysis, tools

> [I agree that if you're going to pass stuff from phase to phase, XML
> is as good a way to do it as any because of all the tools. But I
> have my doubts about plug and play phases. The compilers I wrote
> depend on shared data structures like symbol tables, and if you're going
> to have independent phases, you're going to have to pass that shared
> data from phase to phase, too, greatly bulking up the process. -John]


There's quite a few things you can do without additional information,
depending on how the intermediate representation is structured. Things
like instrumenting function entry/exits for instance would require
only "local" information for many languages.


But even if you do need to pass additional information on, I'm not
sure it would be a problem. Note that I would not push for anyone
making XML the only way to pass information between phases, but as an
relatively simple way to be able to plug in functionality that
otherwise have a tendency to tie you closely in to both the compiler
writers preferred language and data model.


Having a command line switch to make the compiler stop after a
specific phase and dump data, or start at a specific phase and load
data would give a tremendous amount of flexibility, and for that XML
is suitable because of the large amount of tools that can help you
process that data.


Consider the amount of effort people have been willing to go through
(things like gcc-xml and OpenC++) to achieve what you'd get "for free"
if compilers were more likely to have good support for
serialising/deserialising part or all of their internal
representations.


If you're able to defer full integration of your tools into the
compiler proper until you know whether or not it'll be worth the
effort it significantly lowers the barrier to do interesting things...


Vidar


Post a followup to this message

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