Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Concurrency in Perl 6

by raiph (Deacon)
on Nov 06, 2013 at 07:09 UTC ( [id://1061402]=perlnews: print w/replies, xml ) Need Help??

»»» Caution: this post is about the immature Perl 6, not the rock solid Perl 5 «««

A quick summary of recent news on concurrency in Perl 6:

  • jnthn has recently published a nice set of slides ("Composable Concurrency in Perl 6") that defines terms (especially "asynchrony", "parallelism" and "concurrency") and introduces the current rationale behind the design of Perl 6's concurrency features.

  • jnthn also wrote a completely new Perl 6 Concurrency Synopsis.

    (This is a pleasant read, replacing the relatively incoherent old Perl 6 "Processes and Concurrency" synopsis document.)

  • Most of the features mentioned in these new documents have already been implemented (on Rakudo/JVM).

  • The naming of things is undergoing rapid change right now, eg the async keyword has just been renamed start in the spec but is still the former in current Rakudo/JVM.

If you're interested in concurrency features and would like to participate in their development for Perl 6, please visit the #perl6 IRC channel and join in the discussion.


»ö« . o O ( "the celebrity tell-all of the Perl-6 cult?" )

Replies are listed 'Best First'.
Re: Concurrency in Perl 6
by syphilis (Archbishop) on Nov 06, 2013 at 12:42 UTC
    If you're interested in concurrency features...

    The one aspect of perl 6 that does intrigue me is its extendability ... but I never see any posts about that.

    AFAIK there's no XS with perl 6, so just *how* does one extend perl6 ?
    I mean, if I find a really cool C library whose functionality I want to wrap, precisely how do I go about doing that ?
    Is the procedure well laid out in the perl 6 documentation ?
    Is it a big learning curve ?

    Cheers,
    Rob
      AFAIK there's no XS with perl 6, so just *how* does one extend perl6 ?

      The highest level sugar of all for extending P6 with code from other langs starts with a use some::module:from<otherlang> statement. For example that's how you call Java code.

      I mean, if I find a really cool C library whose functionality I want to wrap, precisely how do I go about doing that ?

      In an ideal world you'd use the above sugar. In the real world things aren't quite that simple (a long discussion about this today on #perl6).

      Fortunately there's a really nice lower level interface called NativeCall (codename Zavolaj) so you use that instead.

      Is the procedure well laid out in the perl 6 documentation ?

      Imo the formal doc is weak. I recommend interested parties first focus on this Advent Calendar post from a couple years ago.

      NB Right now you need to use Rakudo/Parrot to use NativeCall. (The final fixes for it on Rakudo/JVM are expected this month. My guess is that it'll be another few months before Rakudo/MoarVM catches up.)

      Also note that some of the doc is ahead of implementation, some of it behind.

      Is it a big learning curve ?

      For a 60 second intro, see this short example.

      I particularly like the way NativeCall supports use of P6's is repr trait to overlay P6 objects and C structs. This combines high performance (the same memory is used by both langs for fast and memory efficient execution) with coding convenience -- you just write ordinary object oriented Perl 6 code to read/write from/to a C Struct!


      »ö« . o O ( "the celebrity tell-all of the Perl-6 cult?" )

      I mean, if I find a really cool C library whose functionality I want to wrap, precisely how do I go about doing that ?

      You probably want to use the NativeCall module.

      Documentation? That is not -Ofun! You have confused Perl-6 with a project built for users. These slides are the only documentation Perl-6 will ever have.

        Apart from all the documentation... I'm not a 'sixer' but found this stuff and have used it to learn most of the language features I care about and have used.

        http://perlcabal.org/syn/S21.html <- native call synopsis http://doc.perl6.org <- perldoc/javadoc core api equivalent

        I really don't understand the frequency of snide anon monk around Perl6 posts. If you don't get off on all the stuff in 6 land just ignore it. Why take epic dumps on everyone else's parade? There are users we just aren't fanatical. This is my first post on perlmonks for example. I've used Perl5 for more than a decade... I'm just tired of seeing nay saying and bickering rather than excitement. Someone tells you there are some cool concurrency features in a perlesk language. This is exciting not the end of the world.

Re: Concurrency in Perl 6
by BrowserUk (Patriarch) on Nov 06, 2013 at 09:14 UTC

    Oh dear!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found