Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2018-12-11 07:46 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (53 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!