So, my question is , why perl5 doesn't run over a virtual machine like JVM does?

Hysterical Raisins, erm historic reasons.

When Larry Wall started developing Perl, there weren't that many cross-platform virtual machines that were suitable for running Perl. I didn't do any computing back in those days, but my guess was there weren't actually any.

The current Perl 5 compiler (which includes its own VM, for that matter) is the result of gradual evolution from the original perl 1 sources, there was never a complete rewrite, so no good opportunity to switch to another VM.

There have been attempts to port Perl 5 to other VMs, but none of them have produced anything really compatible to perl 5. Given some idiosyncrasies in the parser, the runtime model and the XS API, that's not too surprising.

Finally you should consider that whenever you port something to a more general backend, you have to compensate for some mismatch between desired and available semantics, and implement missing parts. That comes with a performance cost you need to pay.


In reply to Re: why is there no a PVM for perl? by moritz
in thread why is there no a PVM for perl? by xiaoyafeng

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.