Ace128 has asked for the wisdom of the Perl Monks concerning the following question:

Ha, and I was just about to post something about making standalone apps done in Perl. And the thread GUI and standalone Perl - can we build a new FAQ please? comes up. However, this is not just about GUI, but anyhing. I wanted some discussion about this. Also, if Perl6 will make this even better? Python is interpreting language, and that "compiles" the code to bytecode files (which is one step further than perl I believe. Perl does the whole way every time, no?). Also, it has a _really_ good "to binary" compiler! (is what I've heard though). With pp you _can_ do bytecode though, (and other things like bleach), but afterwards its not always runnable (like using come of the Crypt:: modules) (as I recall). And isnt that slowing the app down? And its still not binary... perlcc aint good at all either :(

Although Python really seems like the thing if you now _want_ to create some standalone app, I prefer perl. Much because of all the modules there are for it! What do you guys have to say about this? I'm really pro the idea of one "executable", no installation hassle, no extra installments required (for libs or whatever). One file, one problem (that is, the bugs in the app ;) ) And with CPU speed increasing, interpreting isn't all that bad compared to binary... :)

Btw so I must say that pp is really nice! Just need some nice way doing "update patches" now, so one can just update/insert new code when wanted :) Man, wouldn't that be cool! :D Just insert stuff into the ".zip" screws up the executable...


Edit g0n - linkified node link

Moved from Meditations to SOPW by Arunbear

  • Comment on Doing a standalone executable (and even a binary!)

Replies are listed 'Best First'.
Re: Doing a standalone executable (and even a binary!)
by neniro (Priest) on Sep 06, 2005 at 14:55 UTC
    Perl6 will make this even better: It compiles to bytecode running on a language-independent virtual machine, so it is possible to use modules from different languages within perl if they have a port onto these virtual-machine. There were great efforts in the past (and today) to do this for python, lua and different others (including php AFAIR). Native compiler-backends will just be a question of time.
Re: Doing a standalone executable (and even a binary!)
by revdiablo (Prior) on Sep 06, 2005 at 14:42 UTC

    I'm not sure if this is a question; if so, it probably belongs in Seekers of Perl Wisdom. But even if you're just trying to start a discussion, you forgot to mention my favorite solution in this space: PAR. It allows you to package up scripts and modules in a package ala Java's jar format, but it also allows you to create a standalone executable.

    It bundles your code up using the standard PAR format, then wraps it in an extractor and a perl executable. It may seem kind of wasteful, and does not prevent others from getting access to your original source code (it doesn't even try), but it certainly makes a convenient binary executable that you can run without much effort.

      It's not really clear if the OP has a question or is just musing. Sounded more like musing over what might be a good approach for standlone perl apps -- but there are really two separate issues that should be kept distinct:

      • Packaging up a perl script with an interpreter to run as a standalone
      • Storing the compiled perl bytecode so the source isn't recompiled each time

      PAR is only an answer to the first, I think. The OP seemed a bit more focused on the second. I'm not sure how much speed gain that really gives, though. It all comes down to the ratio of compile time versus run time. For user apps, I don't know that compile time matters so much.

      For the second, mod_perl and PersistentPerl are a couple of approaches used to address this with a persistent perl interpreter.


      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

        How about creating a BINARY? How is the future of that?
      Crap. Can someone move this to "Seekers of Perl Wisdom" then? :)