Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^2: Performance penalties of in-Perl docn vs compiled CGIs.

by phirun (Novice)
on Feb 02, 2021 at 05:55 UTC ( [id://11127799] : note . print w/replies, xml ) Need Help??

in reply to Re: Performance penalties of in-Perl docn vs compiled CGIs.
in thread Performance penalties of in-Perl docn vs compiled CGIs.

Thanks for your reply. I'm aware of the differences between complied and interpreted languages, and that the latter CAN be compiled into an executable. Searching the Net for "Perl compiler" returns a swag of results, and I've long been aware of one or more "Perl compiler projects". Relevant info is available here: I'm also aware that Perl uses a two-pass interpreter, that the first pass tokenizes the commands whilst dropping extraneous matter. I'm also aware that the milliseconds required to do this by gigahertz CPUs is all but instantaneous. My question is therefore more about ... ? aesthetics and elegance than mere time-of-execution. However, such seemingly intellectual approaches can have practical consequences further down the development track.

Replies are listed 'Best First'.
Re^3: Performance penalties of in-Perl docn vs compiled CGIs.
by GrandFather (Saint) on Feb 02, 2021 at 06:15 UTC

    I was befuddled by your talk of "C executables" into thinking you were new to the concept of compilers, interpreters and executable code, maybe you are. "Executables" are generally considered independently of the language that was used to create them so it is unusual to talk of C Executables.

    If is not universally the case that interpreted languages can be compiled. In the general case it is not true that Perl can be compiled in the usual sense to generate an executable. There are packaging tools that pack a Perl script up with everything it depends on and a Perl interpreter into and executable that is unpacked at run time, but that is not compiling. There are compilers that can compile scripts written in a subset of Perl, but those aren't Perl compilers either.

    You are right to think that raw time of execution is almost never interesting these days and that will become more true as time goes on. The more important metric is ease of maintenance and that points directly at documentation, automated testing and perhaps code coverage metrics.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re^3: Performance penalties of in-Perl docn vs compiled CGIs.
by ikegami (Patriarch) on Feb 05, 2021 at 00:06 UTC

    Perl5 compiles the source code into OPCODE objects, then interprets (loops over) the OPCODE objects.

    Seeking work! You can reach me at