At 08:18 PM 10/23/00 +0100, Simon Cozens wrote:
>On Mon, Oct 23, 2000 at 02:51:40PM -0400, Dan Sugalski wrote:
> > > PLEASE LET'S NOT GO THAT WAY
> > Awwww... you're no fun! :)
>
>I am, but nurse says I'm not allowed to write INTERCAL any more.
Well, maybe we can do it in befunge instead.
> > That is one of the scenarios. There are some issues with it for a project
> > like this--spitting out binaries directly requires rather more carnal
> > knowledge of the OS/processor pair than something like an interpreter or
> > C-code-spitter does.
>
>Right, right, but once we've got a nice interface to the op tree - which may
>be something like B::, or maybe a low-level C API - we can, and probably
>should, encourage people to play with it.
Oh, without a doubt. I'd actually like to get things building such that the
four main modules--parser, bytecode compiler, optimizer, and execution
engine--are in separate shared libraries, and dynamically replaceable. (or
at least done with a quick relink)
In this case, the native code emitter would replace the execution engine
and, rather than interpreting the IR passed to it, would instead do X,
where X is one of emit Java bytecode, emit .NET code, emit an object file,
or emit an executable. (Or a C source module, or ties into the GEM or GCC
backends, or something)
>A C-code-spitter is another kettle of fish altogether; as you know, the
>current things like B::C and B::CC spit out a state dump of the op-tree and
>then an interpreter. This is cool enough, but it isn't what people want. What
>they want is a translator, rather than a compiler, and this is slightly more
>tricky. However, due to Nat's terrible influence, he suggested to me at
>YAPC::Europe that someone should try writing one.[1] I'm working on something
>I'm calling B::Translate for Perl 5 which does just this; it's basically a
>variant of B::Deparse which spits out C instead.
What's this piece do that B::C or B::CC don't do? I'm confused here.
>It's a really tricky job,
>which reminds me of all the things I dislike about C, but it's getting there,
>slowly.
I find it easier to keep in mind the things I do like about C. A much
shorter list. :)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk