2017.38 Color Me Booked

There’s been a lot of book activity in the Perl 6 world lately. Andrew Shitov announced his new book Perl 6 Deep Dive (preliminary table of contents). And Moritz Lenz also continued working on his “Parsing with Perl 6 Regexes and Grammars” book. To top it off this week, Zoffix Znet announced the Rakudo Book Project – a plan to write some Rakudo books (/r/perl and /r/perl6 comments).
Butterflies Galore!
Please check out his plans and support him in any way you can!

AlexDaniel++ for his second release

Aleks-Daniel Jakimenko-Aleksejev has done his second Rakudo compiler release! The announcement for Rakudo Perl 6 2017.09 shows quite a number of fixes and improvements again this month. Please note there are currently no plans for creating a Rakudo Star release for this compiler release.

London Perl Workshop – 25 November

Saturday 25 November will see another London Perl Workshop 2017. And yours truly would love to see a lot of Rakudo Perl 6 presentations there: so please submit your presentation. Hope to see you there!

New ThreadPoolScheduler implementation

Jonathan Worthington started work on a new thread pool scheduler (which got merged after the 2017.09 release because of possible ecosystem fallout). This implementation has separate general and timer queues with separate workers, and also introduces affinity queues, which are intended for cases where events will be fed into a Supply, and thus there’s no point having lots of threads competing over them only to immediately stumble over each other. The separate timer queue helps when timer events are being delayed, for example if a process is producing a load of output.

This implementation also adds a supervisor, which is where the smarts on how many threads to have in the pool will be put. For now, it is already smart enough to start a lot less threads than the previous scheduler when they obviously aren’t needed. This helps with memory consumption. And it can add more threads on demand when needed to break deadlocks. The default maximum number of threads has been raised to 64, now that the scheduler does not start up the maximum number of threads even when they don’t have any work to do.

For debugging, the RAKUDO_SCHEDULER_DEBUG and RAKUDO_SCHEDULER_DEBUG_STATUS environment variables can be set.

This work has been kindly sponsored by the Vienna Perl Mongers.

Other Core Developments

These features made it to the 2017.09 compiler release.

  • Samantha McVey marked the .collate method, coll and unicmp infix functions as no longer experimental. The dynamic variable $*COLLATION, which allows you to configure the sort, will remain as experimental for now.
  • Elizabeth Mattijsen made simple (one attribute) object creation about 25% faster, and reduced memory requirements for classes.
  • Philippe Bruhat worked on .succ and .pred on enums. This resulted in more attention to this subject, with the outcome a .WHICH on enums that is O(1).
  • Timo Paulssen fixed a closure issue with permutations and combinations.
  • Aleks-Daniel Jakimenko-Aleksejev fixed needless buffering in Test, causing test information not be updated continuously when running the test in a harness.
  • And quite a few smaller fixes and improvements.

Other blog posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Quite a nice catch this week!

Winding down

Between the rain and the wind, quite a lot happened in the Rakudo Perl 6 world yet again. Sometimes we forget how many ways we found how not to make Perl 6. With that in mind, see you next week for more Rakudo Perl 6 goodies!

Advertisements

2017.37 Collating Sorted

Samantha McVey completed the Unicode Collation Algorithm support in Rakudo Perl 6 on the MoarVM backend. She describes the functionality in the commit that did the merge back into the main branch of MoarVM. She also gave a less complete review on the #perl6 channel. Also check out the temporary documentation! A code example may tell more than a thousand words:

say <9 ① 1 ② 8 one hi>.sort;    # (1 8 9 hi one ① ②)
use experimental :collation;     # activate collation
say <9 ① 1 ② 8 one hi>.collate; # (1 ① ② 8 9 hi one)

TPF Grant Proposals (Sep 2017)

Will Coleda tells us we have only a few days left for this round of TPF Grant Proposals. So if you would like to do some development work on Rakudo Perl 6, write a proposal, do your thing and profit! Well, be sure to write a good proposal that will get accepted, of course 🙂

Handling of unclosed files has changed

The ecosystem started showing issues (RT #132030) after non-TTY handles had buffering switched on by default last week. Solution #1 (as suggested by Jonathan Worthington) was subsequently implemented by Elizabeth Mattijsen. What does this mean?

  • If you don’t care about keeping resources tied up, just open your files for reading and writing. When the program exits, any buffers to be written will be automatically flushed before actually returning to the OS. This approach is fine for most applications, unless the application is about opening a lot of files: in that case you run the risk of running into the “too many open handles” OS resource error. Please note that if you’re using any of the IO::Path methods for reading or writing, or use slurp() or spurt() you do not have to worry about this, as those methods/subs will close the handle for you when they’re done.
  • If you do care about your resources, make sure that any open file will be closed as soon as you’re done with it. This can be as simple as having a LEAVE phaser in the scope where the file is opened, or by adding the will leave trait to the variable containing the opened handle.

Please note that this behaviour only applies to the MoarVM backend. The old semantics of only automatically closing files when they are garbage collected, still applies to the JVM backend. But since there is no output buffering on the JVM backend, you only run the risk of running out of open handles.

Blog Posts

Other Core Developments

  • Christian Bartolomäus started unbitrotting the JVM backend. Pretty sure he would appreciate more eyes and more hands on that!
  • Zoffix Znet made sure that .make can now pass on type objects again.
  • Jonathan Worthington fixed the scoping issues on "foo{$x}bar", which could show up with recursive calls inside the {} and/or when being run by multiple threads at the same time.
  • John Harrison fixed an issue with IO::Notification.watch-path($dir).
  • Elizabeth Mattijsen cleaned up program end / exit() handling to ensure they are identical, and that any END blocks are guaranteed to be only run once by a single thread. She also reduced the memory usage of the BUILDALLPLAN, which affects the memory footprint of each class: this may also make building objects slightly faster in some situations.
  • Timo Paulssen continued his work on the heap analyzer and also re-instated the literal junction optimizer.
  • And many other smaller fixes and improvements.

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding down

An exciting week once again! Next weekend will see the 2017.09 release of Rakudo Perl 6. After the release, a number of optimizer and JIT improvements will find their way into the main branch again. So check back next week for more exciting Rakudo Perl 6 news!

2017.36 Blogs-a-reading

In his compelling blog post titled “On Troll Hugging, Hole Digging, and Improving Open Source Communities (How to be Better)”, Zoffix Znet describes how to make Open Source communities even better, building on Audrey Tang’s “hug a troll” concept.

…here’s a well-shaped hole. Everyone’s more connected. It’s easy to get in and start digging. And even those who dug the deepest can still go and help out those who are about to start.

Example of a well shaped hole

The hole digging metaphor isn’t just about the shape of the hole. It’s also about people’s position within it.

He also introduces the seven Hugs for a better community:

  1. Gift a Shovel
  2. Feed The Hand That Bites You
  3. We All Leave Footprints
  4. Speak Up
  5. Simply a Hug
  6. Love Others
  7. Go For The Third Option

Zoffix shows in his examples that we can all learn to become better. And that he finds himself to be a lot happier because of this learning process:

…I’ve been applying the ideas I discussed in this article for about a week. I think they have something real behind them, as I feel a lot happier now than a week ago and I see some positive changes around me that I think I could attribute to these ideas

A well recommended read!

P6::Journey

Thanks to the pingback functionality, yours truly was pointed to a new blog about Rakudo Perl 6: P6::Journey by p6steve. His blog posts so far:

All yours truly can add is: Welcome to the Rakudo Perl 6 Blogoverse!

Unicode Grant update #4

Samantha McVey continued working on the Unicode support in Rakudo Perl 6 and reports on her progress in a blog post. It describes how using the Knuth-Morris-Pratt String Search Algorithm improved string searching, how looking for a single grapheme can be 9x faster in some situations, that the database is updated to Unicode 10, and that several bugs were fixed and documentation improved. Among many other things. A good read if you want to keep up-to-date in that area of Rakudo Perl 6!

Swiss Perl Workshop in review

Steve Mynott created an excellent diary-like blog-post about the Swiss Perl Workshop, with lots of pictures. Looking forward to many more of these in the future!

In related news, the videos of the Swiss Perl Workshop have been made available by Lee Johnson. The Rakudo Perl 6 related presentations for which videos were made, are:

Other blog posts

Other videos

Some more recent than others, but these somehow slipped through the cracks the past weeks.

Other core developments

This week yours truly was reminded that a lot can happen in two weeks. Let me try to recap this in a way that is not overly long without letting important things fall through the cracks:

  • Andrew Ruder fixed several issues with Supply.batch. Elizabeth Mattijsen continued on that work by making sure Lists are returned rather than Arrays, which saves an extra copying step.
  • andreoss made it possible to pipe Perl 6 source code to perl6 without having the REPL being invoked.
  • Daniel Green made the handling of the ignorecase and ignoremark when interpolating strings into regexes, much faster thanks to the new nqp::eqatic, nqp::eqatim and nqp::eqaticim opcodes added by Samantha McVey.
  • Jonathan Worthington did a lot of work on MoarVM, about which he will surely elaborate in a soon to be seen blog post. Meanwhile, he also made sure that --ll-exception flag is also honoured in the case of a broken Promise returned by a start block. And he activated output buffering for non-TTY handles by default. This (and other optimizations) makes the writing a million lines benchmark only 1.2x slower than the Pumpking Perl 5 version.
  • Elizabeth Mattijsen made sure that you can now concatenate a string to a Junction, or concatenate two Junctions. This also implies that you can now interpolate a Junction into a string, and that List.join is no longer guaranteed to return a Str (because it will return a Junction if one of the elements of the List was a Junction).
  • And many other fixes and improvements that aren’t not really visible yet. Such as the merging of a lot of the work that Bart Wiegmans has done on the new JIT, and the work that Timo Paulssen is doing on speeding up the MoarVM heap analyzer.

Meanwhile on FaceBook

  • Jeff Goff said: 0th cut of perl6-Grammar-Common up on GitHub – https://github.com/drforr/perl6-Grammar-Common. Add also does Grammar::Common::Expression::Infix to your grammar, supply a token and you get an rule that you can drop anywhere you want a simple but complete mathematical expression. It provides both grammar rules and some simple actions to generate a basic .ast consisting of nested hashes that you can walk on your own, or override the provided methods and generate your own object tree.
  • Anushka Jodha asked: “Can we use Rakudo Perl 6 with Angular 2 like typescript and scala.js ???”. Jeff Goff answered: “Depends upon what you mean by “use” – It’s always been possible for Pumpking Perl 5 and Angular to coexist, what this project does is adds routes to Bailador that lets it serve your Angular 2 code. What I intend to do with this is add a Rakudo Perl 6 wrapper around whatever tool that generates the Angular 2 code which puts a Bailador route in place, then shells out to the Angular toolkit.”

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding Down

Hope I didn’t miss too much this week. Please let me know if I did. Hope to see you all again next week for more Rakudo Perl 6 news!

2017.35 Serving Cro

Jonathan Worthington dropped something of a bomb during his presentation (slides) on the second day of the Swiss Perl Workshop, in which he presented

Cro, a Perl 6 framework for building reactive systems

With HTTP/1.1, HTTP/2.0, HTTPS, WebSockets and ZeroMQ support out of the box! Still in beta, but API-wise it should be fairly stable.

Which almost let me forget that Jonathan actually did another presentation, named ‎”How does deoptimization help us go faster”, and other questions you were sensible enough not to ask‎ (slides), which gives you a good impression of the problems you get when you try to develop a fast dynamic language with precompilation features. Videos of either presentation are not available yet at this time, but should be soon!

ASCII Forever!

That in short seems to be the general tone of the 233 comments (so far) about last week’s Perl 6 Weekly, spread over three reddits: r/perl, r/perl6 and r/programming. Fortunately, there were some positive comments as well. Ah well, the caravan of butterflies moves on.

Monthly Bug Squash Day

Aleks-Daniel Jakimenko-Aleksejev initiated a new monthly (online) event:
Monthly Bug Squash Day. The first time will be on Saturday 2 September, and the subject will be the perl6/doc repository, which currently has 279 unsolved issues. You can also print a poster to invite your local (hacker) friends (made by Zoffix Znet).

Relocation Message

Zoffix Znet‘s very useful overview of open tickets on Rakudo Perl 6 has been moved to fail.rakudo.party (from rakudo.fail) (Zoffix’ Tweet).

Pictures, Pictures!

Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding Down

Didn’t have time to really see what other core developments we had the past week. Since many of the core developers were on the road or visiting conferences or otherwise in a vacation mood (with a few notable exceptions, though), it feels safe to keep whatever the developments were until a 2-week overview next week. See you then for more Rakudo Perl 6 news!

2017.34 Going ⚛

This week Rakudo Perl 6 went Atomic! Well, in the sense of “forming a single irreducible unit or component in a larger system”.

Locking is one of the evils in multi-threaded programming: Rakudo Perl 6 now has several lock-free primitives for updating native integer variables from several threads simultaneously. They’re all described on a brand new documentation page. In short, the new operators are:

So when would an “ordinary” module developer need to use these, even when they’re not writing threaded programs? Well, your module might be used in a threaded program. And any situation where a variable is incremented to produce something unique, would need this, or run the risk of two or more threads running away with the same “unique” (not!) value. Observe:

my int $a;
await do for ^10 { start { $a++ for ^1000 } }
say $a    # something less than 10000, like 9628, so 372
          # increments lost because of simultaneous updates

versus:

my atomicint $a;
await do for ^10 { start { $a⚛++ for ^1000 } }
say $a    # always 10000, because no updates are overwritten

Apart from these, a working version of cas (Atomic Compare and Swap) was also implemented. All thanks to the work of Jonathan Worthington, which was made possible by the kind sponsorship of Nick Logan.

AlexDaniel++ for his first release

Aleks-Daniel Jakimenko-Aleksejev has done his first Rakudo compiler release! This signals the end of an era in which Zoffix Znet did 14 consecutive Rakudo compiler releases. For which I can only give a big Thank You!

If you look at announcement for Rakudo Perl 6 2017.08, you will see quite a number of fixes and improvements this month. Let’s hope AlexDaniel will be able to do many more of these with an even larger number of new features and improvements!

Other core developments

  • Samantha McVey fixed several issues with ignoremark and a number of edge cases when concatenating strings.
  • Stefan Seifert fixed an issue with native closures failing on a second run. He also made sure that Rakudo Perl 6 will exit with a value of 0 if invoked with --help.
  • And some other smaller fixes and improvements.

Swiss Perl Workshop

The schedule of the Swiss Perl Workshop has been published. It contains the following Perl 6 related presentations (in chronological order):

For what it’s worth: you can still register!

TPCiA Followup

Unfortunately, the official videos of TPCiA have not arrived yet. But we do have some pictures that have been shared:

Wendy also gave an interview. And informed me that 80 copies of Perl 6 books (Perl Fundamentals, Think Perl 6 and Perl 6 At A Glance) and 52 copies spanning 13 different Perl 5 related books were sold during TPCiA.

Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding down

Yours truly spent most of the past week recovering from TPCiA. And now needs to focus on slides for the Swiss Perl Workshop. Wish me strength. See you next week for more Perl 6 news!

2017.33 In Review

Evan Miller has written an extensive review about Rakudo Perl 6. And the Internet was set ablaze. Well, eh, not really, but quite extensive discussions on Hacker News and Reddit followed from it. Although he clearly was caught out by some documentation issues (e.g., you can have both positional and named parameters in a call), the review appears to be balanced and just, and did I mention extensive? Some quotes:

The Perl 6 feature I was most excited to read about — in fact the initial reason I was drawn to Perl 6, aside from morbid curiosity — is the inclusion of grammars in the language.

Perl 6’s string support, and Unicode support in particular, is the best in the business.

Perl 6 might have my favorite function-dispatching mechanism of any language I’ve used; it’s certainly the most flexible.

The most pleasant set of surprises for me with Perl 6 function-calling — in fact some of the more pleasant surprises in all of Perl 6 — is the nearly frictionless interfacing with C libraries.

Perl 6 is one-of-a-kind; no one can argue with that.

What can I add to that? Read the whole review and judge for yourself!

Welcome Aleks-Daniel Jakimenko-Aleksejev!

The number of people with a commit bit to the rakudo repository has just been incremented. Or as Zoffix Znet so partylike tweeted:

AlexDaniel++ joined the team

I can only add that AlexDaniel has already been responsible for quite a number of Pull Requests in the past years, built quite a few IRC bots and will now also be responsible for the next Rakudo compiler release the coming weekend!

Videos from TPCiA

The official videos of TPCiA are still in post-production. Below are the ones that were streamed to FaceBook using a camera in the hands of Andrew Shitov:

Core Developments

  • Jonathan Worthington mostly worked on MoarVM internals: this resulted in a 17% performance improvement of the test-t “real life” benchmark. And fixed some possible memory leaks with supply and react blocks.
  • Stefan Seifert made some NativeCall improvements, which also had a positive effect on the Inline::Perl5 version of said “real life” benchmark. He also made RAKUDO_MODULE_DEBUG output reproducible.
  • Samantha McVey fixed some issues with ignoremark and ignorecase.
  • And some more smaller fixes and changes.

Other Blog Posts

Meanwhile on Twitter

First the Perl Conference in Amsterdam related tweets:

And the other tweets:

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding Down

What a week for the members of the organisation team and volunteers of the The Perl Conference in Amsterdam, of which yours truly happened to be one. Normalcy is scheduled to return in the coming days. Well, until the Swiss Perl Workshop of course. For which yours truly still has to start on her presentation. Ah well, it will be great on the day with a cast of presenters like Jonathan Worthington and Damian Conway! Meanwhile, see you all for the next Perl 6 Weekly!

2017.32 Weekly 101

So, one day you start writing the Perl 6 Weekly. And before you know it, you’ve done a 100 of them. Which was last week. Yours truly hopes to be writing many more of these. Well, as long as you readers let me 🙂

Benvenuto!

Yes, the famous Perl 6 Introduction website now also has an Italian version: Perl 6 Introduizone. Of course, if Italian is not your thing, you might want to try: Bulgarian, Chinese, Dutch, French, German, Japanese, Portuguese or Spanish!

Blog Posts

Core Developments

  • Most of the visible developments this week came from all of the work that Jonathan Worthington has done revamping a lot of MoarVM internals, which he describes in his most recent blog post. Apart from that, he also fixed some race conditions in the implementation of supply and whenever.
  • Nick Logan improved Version smartmatch with uneven lengths.
  • Stefan Seifert optimised NativeCall quite a bit.
  • And many other smaller fixes and improvements.

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Ecosystem Additions

Winding Down

Alas, not a lot of that happening this week with The Perl Conference in Amsterdam. Yours truly hopes to see a lot of regular readers there and hear what thoughts they have on making the Perl 6 Weekly better! And if you can’t make it there, be sure to check out next week’s Perl 6 Weekly!