There are applications where the overhead of compilation on the fly (as opposed to straight interpretation - Perl is not an interpreted language) is unacceptable. For those, you really need a language with low-level constructs that can be compiled to highly optimized, targeted native machine code. That is to say, C or maybe C++. Other languages like Java, C#, VB etc. don't cut it, because you have the overhead of a virtual machine to worry about.

What I'm saying is that although you may see, in some situations, a Java program perform better than a similar Perl program, it's probably not because the Java program is precompiled and stored in bytecode form (this is possible in Perl too, btw, but the feature is considered experimental). I would say that short-running programs might be an exception, but even that exception is limited by two factors: 1) until recently Java VMs had such poor startup time that the advantage of not having to compile source code was largely lost, and 2) in both Perl and Java you can create frameworks like mod_perl that allow a piece of code to be run repeatedly in what appear to be separate instances of the program but aren't really.

Now, if you were talking about an actual interpreted language like shell, awk, etc., that would be different. There the overhead of the interpreter slows down the program considerably, because it literally has to analyze each chunk of code before executing it.


In reply to Re: Perl vs. Compilable Language by Errto
in thread Perl vs. Compilable Language by jpk236

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.