in reply to Re^4: perl language
in thread perl language

are you referring to the pp tool ?
I assuming you're talking about PAR? Then: no. This project was much older.
But what I don't understand is that when the compiler already makes byte-code, how hard can it be to save that result into a file!
Not hard. But from what I gathered, the resulting bytecode was huge and allegedly it took a longer time to load this image from file, than to compile it again from scratch.

No references to point to (not at this time anyway), sorry. It's all hearsay and (possibly erroneous) recollections.

update: I found a reference: This Week on p5p 2000/06/18: More Attempts to Make B::Bytecode Faster

The whole point of B::Bytecode is to speed up the startup time of Perl programs. Two weeks ago Benjamin Stuhl reported that bytecoded files are actually slower than regular source files, probably because the bytecoded files are so big that it takes a lot of time to read them in.

Replies are listed 'Best First'.
Re^6: perl language
by Jenda (Abbot) on Nov 12, 2007 at 17:47 UTC

    There's another reason why this path is not really worth taking. There is no clear and set "compile time" and "execution time" with Perl. When you start a Perl program it's not first all compiled, including all modules, but instead a bit is compiled from the script, a bit from the module it uses, a bit from the module that module uses, then the code that's outside subroutines in that second module gets executed, then the import() subroutine of that module gets executed (if present), then perl returns to compiling the first module, compiles&executes some more modules, finaly finishes compiling the module, executes it's top-level code and import(), compiles a bit from the script ....

    And I did not even mention BEGIN{} blocks that are executed as soon as fully compiled, before the stuff that follows gets compiled.

    And the already compiled and/or executed code can affect how is compiled (even parsed!) the rest of the code:

    V:\>perl -MO=Deparse -e "$x = FOO + 7 + 9" $x = 'FOO' + 7 + 9; -e syntax OK V:\>perl -MO=Deparse -e "use constant FOO => 8; $x = FOO + 7 + 9" use constant ('FOO', 8); $x = 24; -e syntax OK
    or
    V:\>perl -MO=Deparse -e "sub foo {}; sub bar {};$x = bar foo 7, 9" sub foo { } sub bar { } $x = bar(foo(7, 9)); -e syntax OK V:\>perl -MO=Deparse -e "sub foo ($) {}; sub bar {};$x = bar foo 7, 9" sub foo ($) { } sub bar { } $x = bar(foo(7), 9); -e syntax OK

    And some modules need to check the availability of some other modules or libraries (DLLs or whatever) and will decide based on that info what other module to load or which version of the code to actually compile.

    So it's not just "OK, at this point everything is compiled and we can save the current state to disk and next time (on a different compute) just load it and run".