[Snowball-discuss] Re: Java sources

Olly Betts olly at survex.com
Mon Aug 9 11:49:44 BST 2004


On Mon, Aug 09, 2004 at 11:29:28AM +0100, Richard Boulton wrote:
> However, if you feel like writing a PHP code generator, your patches 
> would be welcomed.  I must say that I'm not convinced the changes from 
> the Java version would be that minor, though...

Some time ago I made a start on producing a Perl code generator (I don't
recall if it was from the Java or C generator).  I found that the task
was rather harder than I expected - the code generation is all a bit too
implicit.  The easiest approach would be to generate "C in Perl" code
but that's unlikely to be as efficient as using more natural Perl
constructs, and even this approach wasn't the easy hack I'd expected so
I gave up on the experiment.

I suspect what's ideally needed for generating native code in more
languages is an internal representation of the snowball code which can
be easily manipulated and then converted to whatever language is
desired.  Then the code generators can be cleanly separated from the
rest of the compiler and new backends easily slotted in.

Cheers,
    Olly



More information about the Snowball-discuss mailing list