http://www.perlmonks.org?node_id=1005794

xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

The following question is where perl5 spec is. ;)

Maybe I'm not a appropriate one to ask this question, But in my opinion, it would be great news once perl5 is ported to a virtual machine(not just parrot). Let's imagine: easy translating between 2 languages, reuse the library from other dynamic language, easy compile perl5 code to excutable, a brandnew, usable threading implementation, builtin type model, .... and the most important, we still can use the modules on CPAN! (some XS module might be rewritten tho).

I'm not an expert about language compiler, but anyone can tell me what problem impede person to create a perl5 interpreter on parrot? no resource? not mature enough(http://www.parrot.org/news/2012/Parrot-4.10) or lack a perl5 spec(my 2nd question)?

Any replys?

UPDATE: I think the design of parrot is really suitable for implmenting perl, both perl5 and perl6.





I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: Why no one port perl5 to Parrot?
by moritz (Cardinal) on Nov 27, 2012 at 05:56 UTC

    There are lots of hurdles that prevent porting of Perl 5 to a different backend than what it currently has, and Parrot in particular:

    • Perl 5 is not specified, but dictated by the current implementation
    • Perl 5 has some weird behavior in quite many places, and it's nigh impossible to reproduce the same behavior with a different implementation
    • XS. Do I need to say more?
    • Whenever you port a high-level language with as many quirks as Perl 5 has to a different runtime that wasn't specifically designed to support it, you get quite some runtime overhead, making the port slower than the C implementation, even if the new backend is faster in places.
    • Parrot still lacks the maturity that Perl 5 needs in lots of areas (IO, threads, performance).
    • Man power. Porting any non-trivial language to $anywhere is a huge effort, and needs hackers that stay committed over a long time, and invest vast amounts of time and energy.

    While many folks agree that having Perl 5 on Parrot would be a nice thing, that alone simply isn't enough to make it happen.

Re: Why no one port perl5 to Parrot?
by rurban (Scribe) on Nov 27, 2012 at 15:03 UTC
    parrot is currently too slow to be an efficient competitor, there's not much progress, and there was heavy mismanagement. Feature-wise it is an interesting alternative.

    But there is a lot going on.

    Larry is already writing a p5 grammer for perl6/nqp, and had with MAD a working src-level translator.
    Flavio Glock has with perlito a src level translator and compiler already.

    perl6 is quite perl5 compatible, with much more features and better performance than perl5 for complicated use-cases, which you would call "Modern Perl" (i.e. Moose, Grammars, ...). But it is totally post-modern perl.

    perl11.org (5+6=11) is an umbrella project to try to mix/replace the various parts, parser, compiler/optimizer, runtime. See irc.perl.org #perl11

    I am thinking of an implementation based on vmkit to replace parrot or write a better p5 vm, codename p2.

    rakudo is working into similar directions, making nqp on jvm or mono or whatever possible.

    Perl5 XS is not that big a deal. Either throw it away as it is inefficient and hard to work with anyway. Or provide convenience wrappers. Better languages provide better glue interfaces. Inline e.g. is much better, but you still have to deal with the XS API.

      All true and instructive.

      One might also mention that Perl6 is specified to be able to include some Perl5 code with the 'use v5 {}' construct. This means that eventually Perl5 will be ported to parrot, at least via the rakudo implementation of Perl6.

      We just have to be patient.

      Larry is already writing a p5 grammer for perl6/nqp, and had with MAD a working src-level translator.

      Very interesting, Is this work there somewhere on the internet or Larry is still developing it in private.

      I am thinking of an implementation based on vmkit to replace parrot or write a better p5 vm, codename p2.

      Again is this work there some where on the internet.

Re: Why no one port perl5 to Parrot?
by grondilu (Friar) on Nov 27, 2012 at 09:01 UTC

    Well, if you look here on the parrot wiki, you'll see at least one project porting Perl5 to parrot.

    I have no idea how advanced this is, though.