http://qs321.pair.com?node_id=142817


in reply to Questions On the Perl VM, Parrot, .Net, and the JVM...

I didn't know if this should be an UPDATE or if it should be a new node... I decided to go for the choice I felt was safer. So, all of those things being said (thank you matts, tilly, etc...) My next question automatically is... why is Parrot itself not being implemented in something like Java? Is it as simple as: "we don't want to, and it would be slow?" Because if that's the case, I think that following the parrot implementation in Java may be a *wonderfully* fun project for someone to undertake...

Replies are listed 'Best First'.
Re: Re: Questions On the Perl VM, Parrot, .Net, and the JVM...
by chromatic (Archbishop) on Feb 02, 2002 at 01:45 UTC
    Aside from the reasons you've given, because Java's not as portable as Perl 5 or C. Seriously -- show me a Java compiler and a Java VM that run on platforms like Stratus VOS, Windows CE, Cygwin, or VMS, as well as stalwarts like NetBSD and Linux. gcc is available there -- how about javac?

    That's not to say Java couldn't do it, but portability concerns alone would rule it out. Performance was probably also a concern -- why reimplement a virtual machine on top of another virtual machine?

    For what it's worth, chip had a secret project in 1999 called "Topaz", which involved rewriting Perl 5 in C++. I believe he also spent a week porting it to GNOME libraries. It's a nice academic exercise, but the odds seem to be stacked slightly against practical results. (Don't let me completely discourage you, though. :)

      FWIW, it was Simon Cozens who ported miniperl to the Gnome libraries. He wrote an article about it for perl.com here.
Re: Re: Questions On the Perl VM, Parrot, .Net, and the JVM...
by IlyaM (Parson) on Feb 02, 2002 at 01:46 UTC
    Quote from Parrot FAQ:

    12. So you won't run on the JVM/.NET?

    Sure we will. They're just not our first target. We build our own interpreter/VM, then when that's working we start in on the JVM and/or .NET back ends.

    --
    Ilya Martynov (http://martynov.org/)

Re (tilly) 2: Questions On the Perl VM, Parrot, .Net, and the JVM...
by tilly (Archbishop) on Feb 02, 2002 at 15:07 UTC
    In addition to what everyone else has been said, if you feel like contributing work on a Java port, go right ahead! It is an open source project, and that is how things go. Someone finds something interesting, does it, and then contributes back.

    Incidentally one of the desires of the Parrot project is to be faster than Perl. So far they claim to be succeeding with speedups in the range of 20-50% for identical byte code. (Of course there are enough overall design differences that we won't have any concrete idea how fast Perl 6 will or won't be for a long time.)

Re: Re: Questions On the Perl VM, Parrot, .Net, and the JVM...
by Matts (Deacon) on Feb 02, 2002 at 23:07 UTC
    This is easy to answer. Because C is ipso facto faster for this sort of thing. And one of the goals of Perl 6 is to make sure we don't continue to lose out in the performance stakes.

    Not only that, but who would write it? Perl people tend to know C as a second language. So if you want contributions you need to code in a language people are comfortable in. At the p5p meeting just before Perl 6 was decided on as the next step, Chip Salzenburg (sp?) asked what languages people would be most comfortable hacking Perl 6 out in. C was the overwhelmingly most popular choice.