Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends

by raiph (Chaplain)
on May 06, 2014 at 02:07 UTC ( #1085133=perlnews: print w/replies, xml ) Need Help??

This post is about the immature Perl 6, not the rock solid Perl 5

Rakudo Star is a "batteries included" distribution that couples the Rakudo Perl 6 compiler with an installer, the C calling interface, bundled modules, and doc.

The new Rakudo Star 2014.04 release is the first to be shipped with a MoarVM and JVM backend (as well as a Parrot VM backend). This marks the stage where not only is the Rakudo compiler on the MoarVM and JVM backends passing more spectests than on the Parrot backend but also the ecosystem -- installer, modules, doc -- has generally caught up too.

The biggest impact so far of including these new backends is on performance, use of concurrency1, and use of Java code2.

Rakudo on Parrot is currently fastest for code that does a lot of string slicing and dicing. This is Rakudo on Parrot's main current advantage, one it's likely to retain for another few months. Ignoring that, Parrot is much slower for most scripts and the Rakudo/NQP backend does not support concurrency.

Rakudo on MoarVM runs most P6 scripts a lot faster using a lot less RAM than either Rakudo on Parrot or Rakudo on JVM. Concurrency is supported, though not as robustly as on the JVM.

Long running scripts sometimes end up running a lot faster on the JVM backend than on either MoarVM or Parrot due to JVM's JIT. The JVM also supports P6's concurrency features and calling Java libs.

Finally I'd like to highlight the debugger and its command line UI. Partly because it's a good tool, but mostly to illustrate how easy it can be to contribute to the core as I did via a bugfix and a speedup.

1 Reactive programming in Perl 6 is a good intro to P6's reactive programming features but make sure to use the latest version of the example code in the reactive examples code repo.

2 See jnthn's examples of calling Java code.

  • Comment on Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends

Replies are listed 'Best First'.
Re: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends
by Arunbear (Prior) on May 07, 2014 at 10:14 UTC

    Can you give an example of how to call Java code from Perl6 ?

      From jnthn's examples of calling Java code:

      use java::util::zip::CRC32:from<java>; my $crc =; for 'Hello, Java'.encode('utf-8') { $crc.'method/update/(B)V'($_); } say $crc.getValue();

      As you can see, it requires an arcane string in place of a regular method name. Aiui jnthn knows what they have to do to fix this (so you can just use a regular method name) but I don't think any core hacker currently has it high on their todo list.

Re: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends
by grondilu (Friar) on May 06, 2014 at 08:06 UTC
    > the C calling interface.

    Last time I checked though NativeCall could not be installed on 32bits machines.

    But apart from this, awesome work guys.

      After some quick research my update is that there are some failing NativecCall tests when using the MoarVM backend with some (all?) 32 bit systems. (I think the problem is actually compiler specific.) If you force install on those systems NativeCall should still work for C libs that don't fall afoul of the issues highlighted by the failing tests.

        In other words, if you ignore the problems, it works GREAT!

        I'm going to make a t-shirt that quotes you, Ralph. It will have Camelia saying "Except for all of the failure, EVERYTHING IS GOING ACCORDING TO PLAN!"

        It will be ready by Christmas. Also you can get it in t-shirt, hoodie, and jumpsuit. Except the embroidery will be only half-done on all of them. Also everyone should throw out all of their wardrobes right now. I mean it. Everything. Even if you have to walk around arse-naked for 14 years, it will be worth it.

Re: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends
by Anonymous Monk on May 06, 2014 at 09:56 UTC
    concurrent P6 code

    The code snippets on those slides do look pretty cool.

    Do they all work on this version of Rakudo Perl 6? (And at a reasonable speed?)

    Btw I wish that Supply class (and built-in thread pool scheduler) was available in Perl 5...

      I've changed my OP to include a link to the latest version of the examples in the reactive programming presentation. I can already see that the method .unchanged has been renamed to .stable since the PDF was generated so you'll definitely need to refer to the repo. The latest code should work with both the MoarVM and JVM backends bundled with Star.

      We've recently reached the point where there's the first microbenchmark that runs faster in P6 than P5. But in general it's still early days for Rakudo/NQP/MoarVM optimization. If you expect Rakudo Perl 6 to be extremely slow then you can't be disappointed and you might even be pleasantly surprised. :)

      If you end up trying Rakudo I strongly recommend you visit the freenode IRC channel #perl6.

Re: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends
by wjw (Priest) on May 10, 2014 at 03:48 UTC
    Good to see another open source project making progress!

    ...the majority is always wrong, and always the last to know about it...
    Insanity: Doing the same thing over and over again and expecting different results...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://1085133]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2018-06-25 09:41 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.