Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: The Perl Compiler (turning perl scripts into binary executables)

by BrentDax (Hermit)
on Jul 10, 2001 at 10:48 UTC ( #95248=note: print w/replies, xml ) Need Help??

in reply to The Perl Compiler (turning perl scripts into binary executables)

Hmm...well, there's the obvious techniques--store the text of the program as a string, extract the bytecode and turn it back into the parse tree on execution, extract the parse tree and recreate it on execution--but those are all possible with current stuff. (Well, the last two, and especially the last one, would be hard, but whatever...) There's also a few questions of the heaviness of the code--do you want to bring the entire interpreter? Maybe you want to have parts of it, e.g. the regular expression engine, excludable with the right switches?

I think you have to start by saying, "Do I care more about time to develop the project, time to run compiled code, or space the compiled code takes up" and go from there. It'd be relatively easy to write something that just stuck your script in a big ol string in the C source and compiled it, but I wouldn't really recommend that, as all you'd get for the work was something you could grab and drop on a different box with the same architecture.

As for coders...I'm willing to help. It'll be my first collaborative project and my first work with Perl internals, but if that doesn't scare you off, count me in. :^)

--Brent Dax

@HPAJ=split("", "rekcaH lreP rentonA tsuJ"); print reverse @HPAJ; #sucky but who cares?
  • Comment on Re: The Perl Compiler (turning perl scripts into binary executables)
  • Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://95248]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2018-08-18 17:57 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (185 votes). Check out past polls.