Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by raiph (Deacon)
on May 06, 2014 at 02:07 UTC ( [id://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.

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 = CRC32.new(); 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.

      A reply falls below the community's threshold of quality. You may see it by logging in.
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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlnews [id://1085133]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found