embedding initialization

2 views
Skip to first unread message

Jeff Horwitz

unread,
May 4, 2005, 12:02:03 PM5/4/05
to perl6-i...@perl.org
i'm neck deep in writing the IMC eval code for pugs. if i've already
loaded bytecode using Parrot_readbc/loadbc, i can then successfully call
the PIR compiler and eval code at will from C/Haskell. great!

however, without the Parrot_readbc step, everything bombs out because the
packfile isn't set up correctly. and after looking at packfile.c and
embed.c, it's obvious there's a lot more i need to do than just creating a
new packfile.

do we have the ability to do this right now or should there be another
function that performs this initialization for us? we'll most certainly
need this for things like "perl -e" one-liners. in the short term, i can
use a no-op .pbc file to bootstrap with, but i imagine there's a more
elegant solution out there.

-jeff


Leopold Toetsch

unread,
May 4, 2005, 4:03:18 PM5/4/05
to Jeff Horwitz, perl6-i...@perl.org
Jeff Horwitz wrote:
> i'm neck deep in writing the IMC eval code for pugs. if i've already
> loaded bytecode using Parrot_readbc/loadbc, i can then successfully call
> the PIR compiler and eval code at will from C/Haskell. great!
>
> however, without the Parrot_readbc step, everything bombs out because the
> packfile isn't set up correctly. and after looking at packfile.c and
> embed.c, it's obvious there's a lot more i need to do than just creating a
> new packfile.

I'll try to create a source test (e.g. t/src/compiler.t) with the
necessary steps. It will probably need some clarification in which of
embed.h | extend.h (if any) such APIs should go.

> -jeff

leo

Leopold Toetsch

unread,
May 5, 2005, 10:02:19 AM5/5/05
to Jeff Horwitz, perl6-i...@perl.org
Jeff Horwitz wrote:
> i'm neck deep in writing the IMC eval code for pugs. ...

> ... but i imagine there's a more
> elegant solution out there.

t/src/compiler.t has now all the steps to run a PIR code string from C.
It's not elegant though, because there are no APIs, but it should make
things running.

> -jeff

leo

Jeff Horwitz

unread,
May 5, 2005, 10:04:09 AM5/5/05
to Leopold Toetsch, perl6-i...@perl.org
excellent! now i can get rid of that silly no-op bytecode i've been
using. thanks for the quick turnaround, leo.

-jeff

Reply all
Reply to author
Forward
0 new messages