http://www.perlmonks.org?node_id=95365


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

I'm with jouke, I'm very excited about this! I don't know much about how to turn something into a binary executable file, but I'm all up for learning. As a quick question, though, what do you think we should do with evals? That is, would we need the Perl Interpreter in the executable to handle an eval statement?

Update: Just incase it wasn't clear before: Count me in! I definitely would like to help code this. As for ideas, there are two main routes I can think of. One is to convert the perl code into relavent C code, this is probably a slow solution. The other is to convert it straight to a machine representation, this is probably not a portable solution. I just joined sourceforge, and can't wait to start. (P.S. I'll be gone tommorow for a robotics demonstartion, so if you try to contact me, I'll have to respond on Thursday)

The 15 year old, freshman programmer,
Stephen Rawls

Replies are listed 'Best First'.
Re: Re: The Perl Compiler (turning perl scripts into binary executables)
by Jouke (Curate) on Jul 11, 2001 at 11:10 UTC
    I think we would have to rely heavily on Perl itself. Not as a programminglanguage to write the compiler itself in, but the C-source of Perl to use, or the B::Bytecode or something to get to the backend of the Perl compilation process itself.

    I think the last thing we should do is to rewrite the Perl engine itself!! How could we ever keep up with new versions if we were writing every part ourselves?

    No, re-use what has been done, and write only the last part of the process, namely the creation of the binary executable.

    Jouke Visser, Perl 'Adept'
    Using Perl to help the disabled: pVoice and pStory
Re: Re: The Perl Compiler (turning perl scripts into binary executables)
by Anonymous Monk on Jul 10, 2001 at 21:31 UTC
    Observation 1: You can let the compiler out if the source doesn't contain the letter 'e'! Observation 2: Normal programs can be written without the letter 'e'. 'E' doesn't count.
        Config.pl counts as source of course. If it doesn't contain 'e' you are in the clear! You must compile it too (beforehand ;-) . But if it is a config-file as the name suggests, therefore hopefully written by the program, the compiler could check the format and make a readroutine.