Re: Compile Perl???
by Anonymous Monk on Mar 07, 2000 at 01:52 UTC
|
perlcc will do make the perl into C.
(read the --help CAREFULLY).
however, not like one expects. you can compile the C it generates,
but dont even think about reading it.
as far as i can tell, perlcc doesnt really speed it up
drastically, and the only benifit i see is for keeping
your perl "closed source" (sorta), as it is near unreadable.
if you want to really compile it though, write it in C. | [reply] |
RE: Compile Perl???
by Anonymous Monk on Mar 04, 2000 at 12:34 UTC
|
Check out http://www.perl2exe.com/ for converting your perl
scripts to stand-alone executable files. Unfortunaltely,
perl does not have a perl script to .class file convertor
like Python (jpython).
| [reply] |
Re: Compile Perl???
by stephen (Priest) on Mar 06, 2000 at 03:16 UTC
|
To me, the interesting thing about the lack of an optimizing
Perl compiler is the reason why not: because Perl is so
heavily based on self-evaluation, a compiler can do
little more than embed the Perl interpreter and the
code in the same executable.
In other words, you can't compile a Perl script to object
code because Perl thinks in Perl, so you can't take the Perl
out of the script.
From a design perspective, the only way to maintain the
flexibility of Perl but maintain C speed is to:
- Profile your code to find out where the program is
spending its time
- If appropriate, rewrite the sucker in C.
Generally this is unnecessary. Tools like FastCGI and mod_perl
give us the ability to skip/reduce the parsing phase while keeping
development fast.
stephen
| [reply] |
Re: Compile Perl???
by btrott (Parson) on Mar 04, 2000 at 08:38 UTC
|
From perlman:perlfaq3, in the section How can I compile my Perl program into byte code or C?:
"In general, the compiler will do nothing to make a Perl program smaller, faster, more portable, or more secure. In fact, it will usually hurt all of those. The executable will be bigger, your VM system may take longer to load the whole thing, the binary is fragile and hard to fix, and compilation never stopped software piracy in the form of crackers, viruses, or bootleggers."
Nevertheless, if you're curious, check it out. | [reply] |
RE: Compile Perl???
by Rydor (Scribe) on Mar 04, 2000 at 22:27 UTC
|
i think you can also use perlcc with activestate. | [reply] |
|
|
perlcc is appearently bugged out of it's mind when it comes to WinNT/2000......does anybody have any alternative (FREE) suggestions to this problem........
PS->i know that compilation doesn't really improve anything, but my isp requires my perl stuff to be in executable form......
| [reply] |
Re: Compile Perl???
by chromatic (Archbishop) on Mar 05, 2000 at 07:46 UTC
|
If you want to speed things up, you'll have better luck examining your algorithms and refining your code. The only time I've ever found it useful to compile my code was when I distributed a tiny, very specialized application to a non-savvy user. If I ever write another Perl program for her, I might as well install the minimal ActiveState distribution. | [reply] |