Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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. :^)

=cut
--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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://95248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-12-28 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls