2015.47: The Knights Who Fail Nil

Ohai everyone!

This time it’s timotimo at the post editor again. Again, a whole bunch of thanks to lizmat for covering the last three, er … four .. actually … seven posts for me! I think I’ve become a bit rusty at this, so please bear with me as I cover the changes between the 10th and the 16th of November:

One of the biggest changes from a user’s perspective is, I expect, that Nil is now let through the return type check, just like Failure used to be. Failure itself is now derived from Nil. TimToady explains that  “The upshot is that Nil is now regarded as the simplest form of failure, and people will be less tempted to use type objects to indicate failure”.

Other than that, there’s a bunch of things best covered as a few bulleted lists!

[Edit: added a note about nine’s excellent work in the curli branch just a bit below]

Assorted fixes & changes

  • nqp and rakudo can now be cross-built with the sysroot and sdkroot options for cross-compilation and similar tasks (Jens Rehsack)
  • The third argument in a loop(;;) now gets sunk. (TimToady)
  • = (assignment) can now be used in meta-operators and always means item assignment there. (TimToady)
  • Putting curly braces directly after a trait (like in sub foo is export{ … }) will now give you a helpful error message when those curly braces were actually meant to be the body of the sub or method. (TimToady)
  • Added a “put” sub that uses .gist (like say), but puts no newline (like print). (TimToady)
  • There were some problems in regexes with Longest Token Matching and the | operator in regexes when synthetic graphemes were involved or when “ignoremark” was set. (jnthn)
  • Having subs or methods in multiple dispatch that differed only in RW-ness of parameters used to be trouble. Now it works as expected. (psch and jnthn)
  • Named arguments that come after a flattened hash in calls now properly override the nameds that were in the hash. (jnthn)
  • Multi submethods accidentally got inherited into other classes. That no longer happens. (jnthn)
  • Captures that were backtracked over in regexes used to still show up in the final match. They no longer do. (jnthn)
  • Backreferences to captures that have multiple matches now have a “most recent continuous match” logic to them. The backreference then matches the text between $first.from
  • nine has been hard at work fleshing out the new CompUnitRepo Installation concept with code in the “curli” branch of rakudo. This will – among other things – give back precompiled modules, but also matching versions in use statements and such. Mad Props to nine for this!

Speedups

As always there’s a bunch of speedups all over the place:

  • The return typecheck of types with definedness or undefinedness type smileys is now quite a bit cheaper.
  • List.reverse is 4x as fast (6x on empty lists), List.rotate is 30% faster, List.roll(n) is 50% faster, List.sort is 30% faster
  • Buf.subbuf between 1.5x and 4x as fast
  • using [+], the reduce metaoperator on addition, is now special cased, so that adding up ranges of integers can be done with the O(1) algorithm instead. This also introduced a method “sum” on Any.
  • On the same note, the “sum” method on List is 30% faster than on a generic iterable.

Ecosystem and such

Zoffix has been putting a whole lot of work into the modules.perl6.org site, which has a branch in the works to turn it into a Mojo app.

On the documentation side, there’s of course always a bunch of changes and additions.

There’s also a little project underway to make sure modules in the ecosystem get more documentation. You can find the discussion in this github issue.

But in the ecosystem itself, there was a big number of modules added:

  • hartenfels’ Text::Markdown::Discount, a Text::Markdown compatible binding to libmarkdown (“discount”).
  • teodozjan’s Pod::Coverage, an important part of the “document all modules” project.
  • dwarring’s Crypt::RC4, for use in things like reading PDF.
  • cygx’ Image::PNG::Inflated, which writes an RGBA image to a PNG file without compression.
  • cygx’ Image::RGBA::Text, which lets you define images in a text format. Works well with Image::PNG::Inflated.
  • cbk’s Webservice::HazIP, which lets you get your machine’s public IP address from the HazIP service.
  • jonathanstowe’s  JSON::Infer, which creates class definitions for you from JSON objects like REST APIs based on JSON would provide, for example.
  • kolikov’s Lingua::EN::Conjugate, which conjugates english verbs.
  • Skarsnik’s Config::Simple, which supports JSON and Ini-like formats for storing configuration data.
  • vendethiel’s Hydrate, which lets you create an object hierarchy from hashes and lists.
  • bluebear94’s Terminal::WCWidth, which lets you find out how wide a given character will be printed in a terminal.
  • Not a Perl 6 module per se, but something worth a mention anyway: MadcapJake’s Perl 6 Support for Atom – Fun Edition.

Blog posts and videos

  • Larry Wall’s Perl 6 Release Talk at SF.pm has been online for a bit already, but I think it hasn’t been featured on the weekly yet and has recently made small waves on twitter again. That’s why I figured I’d link to it again.
  • Larry Wall gave an Interwiev on twit.tv’s “Triangulation” with Leo Laporte. You can find the video on twit.tv’s site.
  • Zoffix shares a bit of unicode fun for his HSV color module on twitter. Picture One, Picture Two.

One more thing…

arnsholt just revived my multiple-years-untouched iperl6kernel repository on github and added a pure-perl6 kernel for Jupyter. At the moment all it does is output on the terminal what it got from the front-end and react to heartbeats, but given a bit more time, I’m convinced it can be all you’d want it to be 🙂

Low Hanging Fruit for newcomers

With the Christmas Release fast approaching, most of our core developers are busy getting semantics right so that nobody accidentally relies on wrong behavior after The Release Everybody Looks At. That leaves a bunch of tasks on the wayside that aren’t necessarily hard.

I’ve got two [edit: three] little tasks that outsiders could reasonably easily pick up if they want to get into Perl 6 development. If you’re interested in trying or just want a few more hints, feel free to stop by on #perl6 on freenode or send a mail my way.

[HTML5, JS] Profiler App Improvements

Running any Perl 6 script with –profile spits out a HTML5 app based on Angular.js that lets you explore the gathered data interactively.

Unfortunately, there’s a few bugs still around, like the X button in some pop-ups not closing the pop-up.

More importantly the breadcrumb trail on the Call Graph portion of the profiler sometimes gets confused and you end up not being able to go up any more at all.

Also, the “icicle graph” in the top portion of the Call Graph section has terrible performance when the call graph is too deep, and quite often routines deep into the call graph are just 1px wide, rendering them useless.

All those things could be fixed in an example profile and then put into the profiler template.

[C] Fix an ABI compatibility issue between MoarVM and Rakudo

Adding more MoarVM ops causes spesh’s opcodes to shift. Rakudo accidentally compiles these opcode numbers into one of its .o files, and thus ABI breakage happens. I’ve described the problem as well as possible solutions in this github issue.

[Perl5] Add a probe to MoarVM’s build system for a too new compiler flag

This MoarVM github issue describes that RHEL5’s gcc doesn’t support -Werror=declaration-after-statement, a flag we’ve put in so that the linux-using or mac-using coders don’t accidentally break the build on windows.

Ideally, the probe.pm script would check if that flag is supported or not and then setup.pm would not include it.

That’s it!

This post took me a bit longer to write than I expected, but since that’s because so many nice things happened, I’m fine with that 🙂

Thanks to all our contributors Perl 6 looks better every day!

See you again next week!

Advertisements

Got something to note?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s