2016.45 Shapes Get A Boost

The past week has seen a lot of work on optimizing shaped arrays (and to some extent: native shaped arrays). What are shaped arrays, you might say? Simply put: at compile time you can specify how many dimensions and how many elements per dimension an array will have.

my @a;           # an array that can have anything in it
my @a[10];       # an array with 10 elements
my @a[10;10;10]; # a 3-dimensional array of 10x10x10

This Perl 6 feature was implemented in the weeks before the release last Christmas, and as such did not receive a lot of optimization love yet. A little while ago, Jonathan Worthington pointed out that there were highly optimized nqp functions for handling 2 and 3 dimension cases. The existing code only used the generic N-dimensional nqp functions. After these optimizations, generic shaped array handling is at least 2.5x as fast. Also, iterating over a 1 dimensionally shaped array is now 30% faster than over an ordinary array. Native shaped arrays should receive similar treatment in the coming week.

Lexical Module Loading

Another Perl 6 feature that was mostly implemented just before the Christmas release, was lexical module loading. Since then, Stefan Seifert has worked a lot on this area, improving efficiency and features. One feature that didn’t make it then, was enforcing the complete lexicality of a loaded Perl 6 module. In Perl 5, if you use Foo, and Foo had as use Bar in it, all of the code running could then make use of Bar, even though it had not explicitly loaded that. Currently, that is also true for Perl 6, but that is really a bug and not a feature. In the lexical_module_loading branch, Stefan Seifert fixed this. Unfortunately, this will break some modules in the ecosystem that depend on the old, Perl 5 like behaviour.

Adventing Again

Moritz Lenz reminds us that it is almost that time of the year again. If you have something to write about for the Perl 6 Advent Calendar, contact Moritz or Zoffix on the #perl6 channel so they can add your blogpost-to-be to the schedule.

Why Hasn’t Perl 6 Taken Off Yet?

A rather extensive discussion on Hacker News with over 200 comments. And not all bad. Any publicity is good publicity! There are also some reddit comments.

The Times They Are A-Changin’

Mark Keating informs us that Karen Pauley has stepped down as President of the Perl Foundation. In the Perl 6 Weekly I can only give a big Thank You! If you get the chance, please thank her for all of the hard work she has done for The Perl Foundation in the past 8½ years. Or just send her an email! I know I have!

Other Core Developments

  • Jonathan Worthington fixed a number of issues relating to NativeCall and garbage collection. He also fixed an issue with Lock.protect that would not release the lock if an control exception (such as next, last or return) occurred in the code being protected. Finally, he fixed error reporting around start: if the code running asynchronously caused an exception, that exception will now also be shown when the broken Promise is evaluated, instead of just the location where the Promise was evaluated.
  • Tobias Leich made sure that MoarVM can be built on any version of macOS (formerly known as OS X), regardless of snafus caused by Apple.
  • Elizabeth Mattijsen implemented the :kv, :p, :k and :v filtering adverbs for single element accesses to shaped arrays (e.g. say @a[1;1]:kv will give something like ((1 1) 42)).
  • Zoffix Znet fixed a bug related to the set operator and Mixes having keys with negative weights, after John Haltiwanger exposed this problem.

Documentation Developments

Wenzel P. P. Peppmeyer tells us there is a new Perl 6 Grammar Tutorial for all those who wanted to ask about grammars but where to afraid to do so.

Other Blog Posts

Ecosystem Additions

Again, only two this week.

Winding Down

I like the shape of things to come! Check in next week for more fresh Perl 6 news!

Got something to note?