Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Is perl scalable?

by perrin (Chancellor)
on Dec 06, 2002 at 01:33 UTC ( [id://217960]=note: print w/replies, xml ) Need Help??


in reply to Re: Is perl scalable?
in thread Is perl scalable?

It's also not (quite) obvious to me why people think that Perl is interpreted and Java isn't.

It's obvious to me: because they have to run javac before they can execute Java code! As we know, Perl does this step implicitly, and Perl's compiler is so much more efficient than Java's that no one even knows it's there unless they bother to learn something about how Perl works internally.

The bottom line for anyone who doesn't already know this: both languages compile to bytecode and then interpret that bytecode. This is also how modern versions of PHP and Tcl work. So, explain to them that Java is no more compiled than PHP is, and see what they make of that.

Also, note that while Perl CGI has to do the compilation step every time, mod_perl and similar persistent technologies (and equivalent for PHP and Tcl) just keep the bytecode in memory after the first time it is compiled.

Replies are listed 'Best First'.
Re: Re: Re: Is perl scalable?
by dws (Chancellor) on Dec 06, 2002 at 01:42 UTC
    [People think that Perl is interpreted and Java isn't] because they have to run javac before they can execute Java code!

    Many JVMs do incremental compilation, using technology pioneered in Smalltalk and Self, though it's probably true that the fact of there being a separate "compilation" phase, by a thing called a "compiler" confuses many people about what's really going on under the covers.

      You mean incremental compilation like Hotspot does? That's a bit different, since it's compiling from bytecode to machine language. I wonder if a just-in-time compiler would make a difference in Perl performance. Then again, it's already as fast or faster than Java for everything I've ever tried, so maybe it isn't worth the complexity.
        You mean incremental compilation like Hotspot does? That's a bit different, since it's compiling from bytecode to machine language.

        The end result of incremental compilation, though, is code translated to machine instructions. That's what most people think of when they think of compiled languages. Incremental compilation just throws a delay into the works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://217960]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found