Re: basic question about runtime query parsing

Chris Dollin <kers@hpl.hp.com>
17 Jul 2005 13:46:26 -0400

          From comp.compilers

Related articles
basic question about runtime query parsing shahbazc@gmail.com (falcon) (2005-07-11)
Re: basic question about runtime query parsing antounk@comcast.net (Antoun Kanawati) (2005-07-12)
Re: basic question about runtime query parsing skandgoe@gwdg.de (Skandinavisches Seminar) (2005-07-12)
Re: basic question about runtime query parsing wyrmwif@tsoft.org (SM Ryan) (2005-07-12)
Re: basic question about runtime query parsing gneuner2@comcast.net (George Neuner) (2005-07-12)
Re: basic question about runtime query parsing kers@hpl.hp.com (Chris Dollin) (2005-07-17)
Re: basic question about runtime query parsing lfinsto1@gwdg.de (Laurence Finston) (2005-07-22)
Re: basic question about runtime query parsing shahbazc@gmail.com (falcon) (2005-07-22)
Re: basic question about runtime query parsing kers@hpl.hp.com (Chris Dollin) (2005-07-26)
Re: basic question about runtime query parsing lfinsto1@gwdg.de (Laurence Finston) (2005-07-28)
Re: basic question about runtime query parsing kers@hpl.hp.com (Chris Dollin) (2005-07-31)
Re: basic question about runtime query parsing skandgoe@gwdg.de (Skandinavisches Seminar) (2005-08-01)
[2 later articles]
| List of all articles for this month |

From: Chris Dollin <kers@hpl.hp.com>
Newsgroups: comp.compilers
Date: 17 Jul 2005 13:46:26 -0400
Organization: HPLB
References: 05-07-045 05-07-056
Keywords: parse
Posted-Date: 17 Jul 2005 13:46:26 EDT

Skandinavisches Seminar wrote:


> I don't believe that compilation "on the fly" is possible with C.


It's certainly possible: it's just not *portable*.


> You could invoke the compiler from your program, but it won't be
> possible to link the generated code with your program while it's
> running.


Not true; you can generate a dynamic-linked library and dlopen
it.


A colleague of mine has done just this, for an amusingly apropos task:
compiling an SQL query to C and running it brute-force over several
gigabytes of data (this was some years ago). He reports that keeping
the compile-time under his 1-second budget was accomplished by (a)
keeping everything in a RAM disc [I think "everything" includes the C
compiler as well as the C and object files] to avoid touching magnetic
frisbees and (b) avoiding the preprocessing stage of the compiler.


So, not only is it possible: it's been done, and yonks ago.


--
Chris "electric hedgehog" Dollin
It's called *extreme* programming, not *stupid* programming.
[It's quite possble to generate new code and dynamically load it and
call it. But you can't define new structs and have existing compiled
code use them. For that you need to define what's essentially a
symbol table and interpret references to it. -John]



Post a followup to this message

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