Slashdot Mirror


Parrot 0.1.1 'Poicephalus' Released

Pan T. Hose writes "The long awaited release of Parrot 0.1.1 "Poicephalus" has been finally announced on perl.perl6.internals newsgroup and perl6-internals mailing list simultaneously by Leopold Toetsch followed by an announcement on use Perl by Will Coleda and now also on Slashdot." (Read on for a list of changes since the last release, as well as a number of useful links.) Pan T. Hose continues "The most important changes since the previous version 0.1.0 (code-named 'Leaping Kakapo' and released in February) are:
  • Python support: Parrot runs 4/7 of the pie-thon test suite
  • Better OS support: more platforms, compilers, OS functions
  • Improved PIR syntax for method calls and <op>= assignment
  • Dynamic loading reworked including a "make install" target
  • MMD - multi method dispatch for binary vtable methods
  • Library improvement and cleanup
  • BigInt, Complex, *Array, Slice, Enumerate, None PMC classes
  • IA64 and hppa JIT support
  • Tons of fixes, improvements, new tests, and documentation updates
The amazing project which no one had any idea would go so far from the original April Fool's Joke by Simon Cozens (also posted on Slashdot on April 1, 2001) to really unite Perl and Python one day (not to mention Tcl, Scheme, Forth and Ruby, to name just a few) is now available for download from CPAN and via CVS. Those who are not up-to-date with Perl 6 mailing lists can read This Week in Perl 6 weekly summaries by Piers Cawley to have some idea on how's the project been going in the last two years. It's important to read Apocalypses, Exegeses and Synopses together with RFCs and Parrot Design Documents for better understanding of the underlying rationale, especially the superiority of register-based Virtual Machines (like Parrot VM) over stack-based one (like JVM) for modern (dynamically-typed) OO languages with multiple inheritance, operator overloading, traits, roles and much, much more. Parrot Docs, FAQ and examples are also very helpful. This is a very important step in the direction of Perl 6 which we are all looking forward to."

21 of 224 comments (clear)

  1. preview for readability before submit, perhaps? by lambent · · Score: 3, Funny


    Holy run-on sentence, Batman!

    1. Re:preview for readability before submit, perhaps? by Amiga+Lover · · Score: 4, Insightful

      I'd like a preview that contains a tiny piece of information on just what Parrot is. I can google it, yeah, but I could also google and get just as much info as any story on slashdot if I just read

      "New version of Parrot released".

      It's reminiscent of badly written man pages, where a command has info like:

      -n, --nfrtrt
      enables use of nfrtrt.

      And says no more. It's just a tiny addition, it would really help, and that's what we have editors for!

  2. Awesome april fools joke by Anonymous Coward · · Score: 4, Funny

    For those too lazy to click on the april fools links, the programming examples were some of the funnies things I've seen.

    =====
    Show us some Parrot code.

    GvR: [...]

    # copy stdin to stdout, except for lines starting with #
    while left_angle_right_angle:
    if dollar_underscore[0] =eq= "#":
    continue_next;
    }
    print dollar_underscore;
    }

    [...]There's more than one way to do it, right, [...]

    LW: [...]

    while(@line = Sys::Stdin->readline()):
    continue_next if $line[0] =eq= "#":
    print @line;
    }
    ============
    From the minute I saw that I thought I'd love the language. Truely shows the power of open source.

  3. what is parrot? by egott · · Score: 5, Informative

    from the faq:

    Parrot is the new interpreter being designed from scratch to support the upcoming Perl6 language. It is being designed as a standalone virtual machine that can be used to execute bytecode compiled dynamic languages such as Perl6, but also Perl5. Ideally, Parrot can be used to support other dynamic, bytecode-compiled languages such as Python, Ruby and Tcl.

    --
    There are 10 kinds of people: Those that understand ternary; those that don't; and those that don't care.
    1. Re:what is parrot? by Kristoffer+Lunden · · Score: 3, Informative

      Not only is it supposed to support those languages and more (from Forth to Java via Lua and Lisp ;-), it is also meant to be easy to target with your own custom languages - in fact, several such beasts have been spotted on the mailing list, some of them very impressive already.

      Moreover, libraries will (hopefully?) be possible to share code, especially libraries, across languages(!) so you could write your programs in ruby or python and still have access to all of CPAN, and vice versa. Talk about code reuse! :)

      One of the big things I see a use for this, maybe to some extent already now, is scripting for game libs and engines. Those often have support for one or several languages, homebrewn or regular, in various stages of completion, with or without SWIG and it is all too often a huge big semi-maintained mess. With parrot bindings, you could use any supported language and possibly even mix - different languages are better at different things. Moreover, you could implement your own, custom languages to fit special tasks. Want a language that can handle 3d calcs, physics and AI interactions in a natural way? Just do it and reuse it for the whole series. :)

      Ok, so maybe I am dreaming a bit, but having a powerful interpreter *made* for writing languages for, easily embedded, cross-platform and open source is something to really look forward to in so many ways! I just wish it'd hurry up getting there... and yes, I guess sometime I'll have to stop talking and start contributing myself. ;-)

      And oh, there are already some simple games written using parrot and SDL, check em out. And do what I also should, join the effort! :)

  4. Re:why? by BridgeBum · · Score: 5, Informative

    Performance.

    From the FAQ:

    Why your own virtual machine? Why not compile to JVM/.NET?
    Those VMs are designed for statically typed languages. That's fine, since Java, C#, and lots of other languages are statically typed. Perl isn't. For a variety of reasons, it means that Perl would run more slowly there than on an interpreter geared towards dynamic languages.

    The .NET VM didn't even exist when we started development, or at least we didn't know about it when we were working on the design. We do now, though it's still not suitable.

    So you won't run on 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.

    --
    My UID is the product of 2 primes.
  5. Explanations Please by SomeGuyTyping · · Score: 3, Insightful

    When posting software projects (especially those whose version number 0) please add a quicky bit about the package for the lazy amongs us

    --
    My posts are definitive. Reality is frequently inaccurate.
  6. Re:python performance by Pxtl · · Score: 5, Interesting

    The problem is that Python's slowness isn't just from the interpreter, but the nature of the language. Notice how two similar objects don't require an interface to be used in the same way with the same methods? Because of that it will be hard to store members as anything but dictionaries, which are necessarily slow.

    Either way Parrot will be an improvement, allowing shared Python/Perl/Ruby libraries, importing pure-python modules nicely, and most importantly: maybe we can finally sandbox Python. Rexec has been dead a long time, and Python is currently unusable as an embedding language without a lot of hacking because of that.

  7. Mark Sparshatt is working on a Ruby project... by tcopeland · · Score: 4, Interesting

    ...that would compile Ruby programs into intermediate compiler code so they could be run on Parrot.

    He's done a few releases and appears to be making good progress here.

  8. Python support? by WillWare · · Score: 4, Funny
    Python support: Parrot runs 4/7 of the pie-thon test suite

    Python 2.3.3 (#1, May 7 2004, 10:31:40)
    [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 4 / 7
    0
    >>>

    Ouch!

    Now I'll get my thumb out of my ass and pass along my gratitude to everybody who's worked on Parrot. An open-source VM, particularly one targeted at existing open-source languages, is a mitzvah. It even has the nice side benefit of creating a little commonality between the communities. Thank you.

    --
    WWJD for a Klondike Bar?
  9. pasm rules by Anonymous Coward · · Score: 3, Funny

    Parrot assembler is the nicest asm dialect I've ever had the pleasure to work with. I'm looking forward to a new mod_parrot so I can do enterprise web apps, the way they should be done; in asm.

    I spent far too long yesterday playing with parakeet, definately some interesting things happening in parrot land.

  10. Re:WTF is this? by Bob+of+Dole · · Score: 5, Informative

    That's not what it is. Perl and Python (and most "major" interpreted languages, I would suspect), first compile the script to byte-code, then execute the byte-code in a VM.

    At some point along the line, someone said "Hey! Why are we writting VMs for every single language? They all do pretty much the same thing!".

    So Parrot is that, a common VM. Perl6 compiles to Parrot bytecode, instead of the perl-only-bytecode it was using for Perl5.
    Since that bytecode format is open, and the VM free, any other interpreted (or compiled, I guess) language (Python, Ruby, TCL, LUA, whatever) can make their compilers output Parrot bytecode.
    That way they don't have to build and maintain their own VM, and they get the benefits of future optimizations to Parrot.

    For example, I could write a just-in-time compiler for Parrot for my favorite platform, and every Parrot-enabled language could take advantage of that.
    Doing that now, I'd have to pick a language to optimize. Do I want to make Python faster? Or Perl?

    Python is going to use it in the future,last I heard. (probably as another backend like Jython or IronPython, not as a replacement for CPython)
    I think they were waiting on the byte-code format stabilizing.

    All in all, it's a very cool idea. Makes it a hell of a lot easier for people to make new interpreted languages, since they only have to target Parrot, and they've got a mature, debugged, VM that runs on multiple platforms. (in theory, at least. I don't think it's there yet)

    It's not that similar to the JavaVM (which is only designed to run Java, not a pile of different languages), but it is kinda like the .Net VM.
    The developers of Parrot created Parrot instead of targeting .Net for two reasons:
    1. .Net didn't exist when they began :)
    2. .Net is designed for compiled languages (C++, C#, VB, etc), and supposedly that would cause a performance hit over a VM designed for interpreted languages. (Plus, it's not designed to be portable, like Parrot is)

  11. Another funny virtual machine by descubes · · Score: 3, Interesting

    The Virtual Virtual Machine is, if I understand correctly, a virtual machine to build virtual machines.

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  12. A truly interesting project by Coryoth · · Score: 5, Interesting

    Parrot is a very interesting project indeed, and it looks as if it is now starting to seriously pick up steam. What we're looking at here is VM that works, and is optimised for Perl, Python, Ruby, Forth and all those other lovely scripting languages.

    Given all the current debate raging over JVM vs. .NET and Java vs. C# people seemed to have missed Parrot creeping up from behind. Potentially Parrot can pull together Perl, Python and Ruby - imagine CPAN that works with all of those languages at once, but pulls in all the interesting Python and Ruby libraries too.

    In general scripting languages have been looked down upon, but realistically the gap between scripting languages (and what you even mean by "scripting language") has been drastically narrowed to the point where it is increasingly less relevant. The only serious remaining issue is speed - and that's something Parrot can help fix, putting Perl, Python and Ruby code on a similar footing as Java and C# code running on their VMs. You'll take a small hit for using a higher level language, but it won't be as drastic as it is now.

    Maybe all that GNOME discussion about .NET via Mono or Java via JVM shoudl start considering Perl/Python/Ruby via Parrot as a very serious choice for doing the high level application programming.

    Jedidiah.

  13. To ellaborate on the FAQ by pavon · · Score: 4, Informative

    As it said, Python, Perl, Ruby, Smalltalk, Lisp, and most of the languages targeted by Parrot are dynamically typed and have dynamic message passing (method calls). This means that typechecking is done by the run-time environment, not by the compiler. Likewise, it is not known untill runtime which if an object has a method. Therefore, the runtime has to do a fair amount of checking (mostly symbol table lookups). If you were to do this with a VM designed for static languages (JVM, .NET) that do not do this checking for you, then you would have to implement all of it as byte-code in the VM - in effect you would be writing a big chunk of a Perl interpretor in Java.

    This approach would inevitably be slower than the existing Perl 5 interpretor, while the Parrot approach has managed to be significatly faster than the current Perl 5 interpretor. The reasons are that 1) all of the runtime checking is highly optimized native code 2) after the complex perl code is translated into a simpler form, the traditional compiler optimizations can be applied to the code.

  14. Re:why? by GooberToo · · Score: 4, Informative

    I think he means register based.

    From one of the examples, we get:

    set I1, 1
    set N1, 4.2
    set S1, "Resting"
    print I1
    print ", "
    print N1
    print ", "
    print S1
    print "\n"
    end

    Which seems to indicate a heavy use of register type functionality. This will map to hardware (thusly faster) better, much more so than a stack based (java) VM implementation. Especially for dynamically typed languages (perl, python, ruby, etc).

  15. Re:why? by ajs · · Score: 5, Insightful
    The primary reasons for Parrot are:
    • Language neutrality
    • Support for very high level language inter-operation (e.g. you can sub-class a Python object in Perl and call a method on the Perl class that gets invoked fromt he Python class).
    • Deep support for multiple character sets, not just ASCII and Unicode.
    • Perl 6
    The last item might seem odd, but Perl 6 is definitely a language which needed some serious support. It's very ambitious, and a VM that didn't support its needs as completely as Parrot does would have exponentially complicated writing a compiler for it.

    That said, the combination of the two promises to be one of the most powerful development platforms released to date.
  16. Re:WTF is this? by smcdow · · Score: 4, Insightful
    Actually perl goes farther:
    my $a = "5"; # $a is a string

    $a++; # now $a is both a string and a number. "6" and 6, respectively

    my $b = $a + 1; # $b is a number

    $b = "$b"; # now $b is both a string and a number

    # these two statements produce the same output
    printf( "\$b is %s\n", $b );
    printf( "\$b is %d\n", $b );

    Strong typing sucks.

    --
    In the course of every project, it will become necessary to shoot the scientists and begin production.
  17. Readability? by Pan+T.+Hose · · Score: 3, Funny

    Holy run-on sentence, Batman!

    That's funny you mention it because quite frankly I did preview it and in fact it was not until then when I decided to turn a list of comma separated values into a bullet list as well as brake the second then single-sentence paragraph into three separate sentences exactly because I was somewhat concerned readability-wise--though to be fair braking it into two parts and adding "Read on for a list of changes since the last release, as well as a number of useful links" we owe to Timothy, who has also removed quite a few important links for some reason--but nevertheless I am quite surprised if not outright disappointed that anyone who is even remotely interested in Perl 6 might lack basic linguistic skills to parse a paragraph of simple English, however on the other hand I can understand that for some people interested in the subject my story might indeed contain not nearly enough whitespace.

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
  18. Re:A question by multi+io · · Score: 3, Informative
    That's the whole point of using the same runtime for all three [languages]

    The point of that is also that you have only one debugged runtime and don't have to write your own for each language.

    A very important fact hasn't been mentioned here: When you compile multiple languages to the same VM, you don't automatically get interoperatibility between those languages. Interoperatibility is a different concept that must be separately achieved, mostly by defining additional rules and standards on-top-of the VM specification.

    For example, look at different C or C++ compilers on Linux/x86. They all compile to the same machine code, but Intel machine code has no concept of "symbol names", "class names", "type names" etc., so, for the compiled codes to be interoperable, they must comply to additional specifications like ELF or some C++ ABI ("name mangling").

    Parrot bytecode may define some or all of those concepts, but some scripting languages will probably define additional features (macros, MI, continuations etc.) that have no "native" representation in Parrot, so additional conventions to represent those things in Parrot must be agreed upon. The .NET CLS ("common language specification") is another example of such a set of addional rules to provide for language interoperatibility.

  19. Re:WTF is this? by eidechse · · Score: 5, Informative
    Strong typing sucks.

    This is NOT a strong vs weak typing thing. This is a static vs dynamic typing thing. The strength of a type system has no relation to when it's enforced.

    You can have all combinations:
    • strong/static (e.g. Java)
    • strong/dynamic (e.g. Python)
    • weak/static (e.g. C)
    • weak/dynamic (e.g. Perl)