Movatterモバイル変換
[0]ホーム
Python compiler?
Rocco Morettiroccomoretti at netscape.net
Fri Apr 20 20:07:00 EDT 2001
Steve Holden crafted these words: > There's an article on the May edition of DDJ called "Compiling Perl/Tk> Scripts" by Cameron Laird that might also be useful. The abstract is,> people want to compile because of 1) speed; 2) code security; 3) size;> 4) fashion (i.e., just because it's cool); 5) packaging (easier to> deploy, no separated interpreter installation needed).>> Of all three er.. five, compiling dynamic scripting languages only> effectively gives us number 4 & 5.>> SteveI think you may be overstating your case.The article in question, as it's title suggests, only looked at Perl/Tkcompilers, and only at those on MS-Windows, a sample size of two. Itdidn't even mention compilers for any other language, or even any otherplatform.In fact, if you want to be a stickler, you might not even consider them"compilers." I know nothing about the products, but from the article itseems that they are equivalent to a "freeze" tool, wrapping the perlscript with a minimal interpreter in a standalone executable.Thus you get 4) and 5), because you now have a single executable.You don't get 3) because you have both the script and the interpreter.(Even though stripped down, it is still sizable.) Heck, for compilingsmall C programs you don't get a size benefit due to the loader code andthe included library functions.Code security (2) is out because the "compiled" programs store theoriginal perl script as a plaintext string in the executable. (Easilyfindable by anyone with a hex editor.) And since you're still interpretingthe program, you aren't going to get a speed advantage (1).My take on the article is that its directed at clueless IT directors whosee "compiler" in the program's name and think it's a pancea to theirproblems. (Perhaps Mr. Laird, who has been seen in this newsgroup, couldclarify, and add his comments on how he thinks Python relates.)Note that a "true" compiler, which converts the script itself to machinecode and optimizes it, may see benefits in all five points.If Python will see such a compiler is still an open question.--Rocco Moretti
More information about the Python-listmailing list
[8]ページ先頭