2017.50 Of Quasi and Injectile

Carl M√§sak reports on the progress of 007, the toy language he is developing as a proving ground for full-blown Rakudo Perl 6 macro support. Check it out if you want to keep abreast of developments in this area. Or even better, want to help Carl and his compatriots in this effort!

Adventing Along

The following advent blog posts flocked our way this week:

Core Developments

  • Bart Wiegmans fixed a problem in the JIT expression compiler that was tickled by multi-dimensional array slices.
  • Samantha McVey improved the Unicode database compiler, aka ucd2c.pl.
  • Alex Chen and PaweŇā Murias worked on fixing an incorrect optimization of || in nqp.
  • Zoffix Znet made some meta-operations on Rats 30%-50% faster. He also fixed a generic issue with .tail and the count-only and bool-only optimizations.
  • Elizabeth Mattijsen improved the inlinability of several internal methods. She also fixed List.new, which would not decontainerize values when it should, and a bug in multidimensional slices that would not allow Cool values as indices.
  • Tom Browder fixed some more issues with regards to tables in pod.
  • And a lot of other smaller fixes and documentation and test additions.

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Winding Down

Feels like the dark days before Christmas. With a lot of snow, at least for yours truly. Hoping to see everybody again next week for another scoop of Rakudo Perl 6 goodies!

Advertisements

2017.49 Mischieventing

Zoffix Znet wrote the first of the Rakudo Perl 6 Advent posts and hit the Jackpot on Hacker News. Mischief achieved indeed! The Grinch would be so proud! And then there were also some Reddit comments.

Other Rakudo Perl 6 Advent posts so far:

Squashathon

Last weekend saw yet another Squashathon (yes, there is one on every first Saturday of the month). The goal of this squashathon was to go through tickets that were not updated in two or more years (these tickets are automatically labeled with MOLD tag). As a result, 121 out of 224 tickets (more than half) were updated. Most of the updates were simply about reproducing the issue with the current version of Rakudo Perl 6, but some tickets got more attention and received tests and fixes. A fuller overview of all Squashatons is also available. Kudos to Aleks-Daniel Jakimenko-Aleksejev for organizing and everybody else for participating!

Other Blog Posts

Core Developments

  • Jonathan Worthington enabled inlining on a number of exception related constructs, that were previously barred from being inlined. This resulted in the test-t canary code to run about 12% faster. And it shaved off about 12 seconds off of make spectest for yours truly. I must say this bodes well for future inlinings!
  • Samantha McVey fixed a problem with the Unicode database that showed up in the handling of the character class.
  • Timo Paulssen made the setup of a multi-needle split a lot cheaper for up to 20% speed improvement.
  • Elizabeth Mattijsen fixed :exists on Telemetry objects, as well as several mouldy old tickets.
  • And some more smaller fixes and improvements.

Meanwhile on FaceBook

  • Peter Evans:

    Since last year we had some issues with WordPress messing up code examples in Perl 6 Advent articles, Zoffix hacked up a little helper tool: You write your Advent article in Markdown, run the tool, and out it spits WordPress-friendly HTML. It does syntax highlights too, which is pretty sweet.

  • Andrew Shitov:

    The funny thing I learned today is that the atom character can also be italic ūüėÄ (well, probably just slanted, not proper italic)

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Winding Down

Yours truly spent most of the past week on the road, and recovering from a bad cold, and a bumpy overnight ferry. On the plus side, it was good to get out and see new stuff and meet old friends in faraway places. A bit like Rakudo Perl 6 and Pumpking Perl 5 really. See you next week for more Rakudo Perl 6 news!

2017.48 Community First

People visiting the London Perl Workshop this year know what this means: it was an excellent event with a lot of high quality Rakudo Perl 6 and Pumpking Perl 5 talks and workshops. Please check out the resulting blog posts about 2 days after the event:

Yours truly was touched by the many high quality conversations about the future of Perl, and how the importance of community was expressed by so many.

The Perl 6 Recipes Book

Andrew Shitov may be at it again. He intends to write a Perl 6 Recipes Book with the help of a Kickstarter Campaign. On FaceBook he explained:

Hi, let this year be a year of the Perl 6 books. I want to make a big addition to it and publish the Perl 6 Recipes book next year. Its structure will be based on the content of Perl (5) Cookbook and Using Perl 6 and of course will include all the new cool things available in Perl 6, from Unicode to ‚öõ operations.

An effort well worth supporting!

A Guide To Parsing

raiph started a discussion on Reddit about Tomassetti‘s A Guide to Parsing: Algorithms and Terminology and how Rakudo¬†Perl¬†6 parsing was distinctive relative to the landscape as outlined by that guide. He would like to get feedback from the Perl¬†6 community about his suggestions for inclusion in Tomassetti‘s guide. Please help him get the unique grammar features of Rakudo¬†Perl¬†6 better known to the world!

A unified Supply concurrency model

Jonathan Worthington describes the work that has been sponsored by Vienna Perl Mongers: how it has replaced the two concurrency models that previously backed Supply with a single unified model, and so enabled new use cases of supply and react. As usual, highly recommended reading if you want to get a deeper grasp of some of Rakudo Perl 6 inner workings.

Let’s Go!

Ahmad M. Zawawi took a hint from Jonathan Worthington: it seems that an Inline::Go project is born! I’m assuming Ahmad can use all the help you all can give him!

Other Blog Posts

Core Developments

  • Aleks-Daniel Jakimenko-Aleksejev did the Rakudo 2017.11 Compiler Release.
  • Samantha McVey fixed several issues in generating the internal Unicode database and improved error message on problems involving synthetic codepoints.
  • Fernando Correa de Oliveira fixed various issues with (not) closing the source Supply of .zip, .zip-latest and .throttle.
  • Elizabeth Mattijsen fixed a bug when doing a set difference “(-)” with a Map on the left side.
  • Christian Bartolom√§us continued his quest to keep the JVM backend in working order.
  • Zoffix Znet fixed some error reporting Socket::Async, which unfortunately did not make the underlying error clearer.
  • Elizabeth Mattijsen also prototyped a new functionality in the Iterable/Seq universe: .toggle, a bit like .grep, but with a twist. For now, it is being played with by interested people, while deciding on a final API.
  • And some other smaller fixes and improvements.

Meanwhile in an alternate universe

Off-topic Alert! Yours truly has been using email for 40 years now, as well as being able to chat with other people online. Or read discussion forums. Or visit “websites”. How was this possible? It’s all discussed in The Internet that wasn’t by Sharon Weinberger. Which is a review of The Friendly Orange Glow by Brian Dear: the Untold Story of the PLATO System and the Dawn of Cyberculture. Wow, what a trip down memory lane. We will now continue with our regular Rakudo¬†Perl¬†6 related news.

Meanwhile on FaceBook

  • Jeff Goff:

    Ah, the joys of conference-driven development. Test All The Things is now out, probably going to be a series, maybe even a book. It’s just a quick take on refactoring test suites in Perl 6. Maybe it goes too far, but at least it goes somewhere.

  • JJ Merelo:

    We’re starting to prepare Love Of Perl 2018, a Perl (& friends) workshop in Granada next February 14th. Interested? Want to help? DM or email or Telegram me.

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Meanwhile on PerlMonks

Winding Down

Wow. What a week! Perhaps not too many core developments. But plenty of development around it. Hope to be able to top that again next week. So check in again then!

2017.47 More TPCiA Videos

In the past weeks, more videos from the The Perl Conference in Amsterdam have become available. Rakudo Perl 6 related videos that have been added:

Kudos to all behind the scenes who made the recording, processing and uploading of these videos happen!

Blog Posts

Core Developments

  • Samantha McVey made collapsing of MoarVM strands (the parts of a concatenated string that hasn’t been turned into a single string yet) about 4x faster in most cases. She also fixed a bug with the utf8-c8 encoding that would combine a synthetic code point with other code points when they shouldn’t. Finally she fixed a bug in the Unicode properties database (uppercase letters not returning the Lu General_Category).
  • Jonathan Worthington fixed a race condition related to cancellations and an optimizer issue regarding improper inlining of blocks.
  • Bart Wiegmans fixed an off-by-one error that would cause try/catch to sometimes fail on jitted frames.
  • Elizabeth Mattijsen fixed the RAKUDO_EXCEPTIONS_HANDLER=JSON feature (which outputs execution errors in JSON format) for those exceptions that contain other exceptions. She also made sure that a Proxy will no longer leak out of a Lock.protect block. Finally she made sure that an execution error in an END will not stop any other END blocks from being run. Oh, and she made concatenation of Buf and Blob objects between 1.8x and 7x faster.
  • And many other fixes and improvements.

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on FaceBook

Format::Lisp is on the ecosystem. Not *quite* fully featured, but it handles some of the recursive directives, and the test suite will tell what it can currently handle.

Meanwhile on perl6-users

Winding Down

We’re still waiting for the 2017.11 release of the Rakudo Compiler. There have been a few blockers that turned up at the last moment, which appear to have been vanquished, at least temporarily. But not in time for the deadline for this Perl¬†6 Weekly. So please check in again for next week’s Perl¬†6 Weekly for the continuing story!

2017.46 Spesh Explained

Jonathan Worthington completed his four part blog about the MoarVM Specializer Improvements he did in the past 3 months, supported by a grant from the Perl Foundation. The four parts are:

  • Gathering Data
    In which he explains the path towards the new spesh worker thread.
  • Optimization Planning
    About the introduction of the planner of specializations.
  • Optimizing Code
    About the different forms of specializations and the facts they are based upon.
  • Argument Guards
    About making sure that code execution will remain correct when any of the prerequisites for a given optimization change.

Required reading for anybody interested in the current and future inner workings of the Moar Virtual Machine!

Rakudo Star 2017.10 Released

Steve Mynott did all the hard work again and released Rakudo Star 2017.10, now available for download. Precompiled binaries for MacOS and Windows (64 bit) are also available.

Perl 6 Advent Calendar

Zoffix Znet reminds us that it is still possible to claim a slot in the Perl¬†6 Advent Calendar for this year. We’d like to hear from you! Your Advent Calendar Needs You! Just let us know!

No More Grants This Year

The Perl Foundation has run out of allocable funds for grants for this year. Your donation or a donation by your employer will allow for more grant work to be supported next year. So please give kindly, especially if you need to finish off budgets before the end of the year!

Core developments

  • Daniel Green improved the performance of a very specific case of concatenation of strings from O(n¬≤) to O(1). The reason: that specific case was used in a lot of benchmarks and the solution did not have any adverse effects on all other string concatenation.
  • Timo Paulssen fixed a segfault that would occur when trying to create a low level iterator on a type object. This bug was exposed by trying to do a .pick on an empty Bag or BagHash, which didn’t check for emptiness. That particular bug was fixed by Elizabeth Mattijsen. Who also made sure that safe signals are now handled by the timer worker pool, which should make it less likely that your control-c will be lost in a barrage of general worker tasks.
  • Samantha McVey improved error reporting on situations in quoting, s/// and tr/// , when a starter would be followed by a combining code point. She also revived a two-year old nqp-branch which brings us + support for %b in sprintf (which made a lot of TODO tests pass!).
  • Christian Bartolom√§us implemented nqp::getport on the JVM backend (which made a lot of IO::Socket::INET tests pass on that backend) as well as generally making sure none of the MoarVM backend related work busts building the JVM backend.
  • Jonathan Worthington fixed a scoping issue on the CLOSE phaser.
  • Elizabeth Mattijsen also made sure that OS thread exhaustion is more gracefully handled by $*SCHEDULER: if there are no more threads available, it will now only try once a second to create another OS thread (instead of trying this 100 times / second, which would leave less CPU for the other threads to complete their tasks).
  • Nick Logan did some fixes and cleanups in Rakudo’s make testing.
  • Finally, Elizabeth Mattijsen continued to be carried away by work on Telemetry. Most important additions were an ad-hoc instrument that allows you to snap the state of a number of variables (Telemetry::Instrument::AdHoc), and an instrument that takes basic Thread usage data such as number of OS threads started / completed / aborted (Telemetry::Instrument::Thread).
  • And many other fixes and improvements.

Other Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Winding Down

It was a bit of a quiet week: nothing on perl6-users or on perlmonks. Which is also nice every now and then, as it makes the work of yours truly for the Perl¬†6 Weekly easier. The coming weekend will see the Rakudo 2017.11 compiler release with already more than 300 commits under its belt. The coming weekend will also see yours truly giving a one-hour “Introduction to Rakudo¬†Perl¬†6” presentation at T-Dose (in Dutch), as well as a Perl stand with a lot of Rakudo¬†Perl¬†6 books and goodies. Whether or not you will be able to attend, it seems wise to check in again next week for more Perl¬†6 related news ūüôā

2017.45 Uplink Established

Elizabeth Mattijsen got carried away trying to devise an API for getrusage. The result is a new set of modules available with use Telemetry. And a helper module for easy activation: snapper. The simplest use case: perl6 -Msnapper yourscript.pl6. This will start up a separate thread that will take snapshots every 0.1 seconds. Once it is done, it will display a report much like this on STDERR:

Telemetry Report of Process #72908 (2017-11-06T21:26:26Z)
Number of Snapshots: 7
Supervisor thread ran the whole time
Initial Size:        67676 Kbytes
Total Time:           0.58 seconds
Total CPU Usage:      0.59 seconds

wallclock  util%  max-rss
   105476  13.28    17680
   105220  13.27       12
   105178  12.73     1024
   105149  12.85      152
   105141  12.42        4
    49525  12.98       12
--------- ------ --------
   575689  12.92    18884

Legend:
wallclock  Number of microseconds elapsed
    util%  Percentage of CPU utilization (0..100%)
  max-rss  Maximum resident set size (in Kbytes)

Even this hot off the press, Wenzel P. P. Peppmeyer took this new development to actually create a distribution that runs an httpd daemon in your program, so that you can look at usage data of your (long running program) in your browser!

But that’s only the tip of the iceberg: there are also a number of ways to get at system information ad-hoc, such as:

$ perl6 -MTelemetry -e 'say T<wallclock cpu max-rss>'
(140878 264269 84756)

Or plan your snapshots and reporting more precisely:

while $working {
    snap;
    LAST snap;
    # do a lot of work
}
say report(:csv)  # output in CSV format

Other features of Telemetry include a Telemetry::Instrument role for creating your own “instruments” for plugging into this framework (with two Instruments already supplied: Telemetry::Instrument::Usage (basically giving all the data of getrusage + wallclock in microseconds) and Telemetry::Instrument::ThreadPool (giving all the data pertaining to actions of the $*SCHEDULER, such as being able to see when new worker threads are started). Exciting times!

LPW Rakudo Perl 6 Presentations

Well, a program as such hasn’t been decided yet, but it looks like the following Rakudo¬†Perl¬†6 related presentations will be given at the London Perl Workshop on 25 November 2017 at the University of Westminster:

Hope to see you there!

Optimizing Code

Jonathan Worthington published another part of his MoarVM Specializer Improvements series: Optimizing Code. A long read, but if you fancy understanding MoarVM capabilities better, it is highly recommended reading indeed!

Building a Single Page Application with Cro

This seem to have slipped through the cracks the past weeks. Jonathan Worthington describes how to set up a simple Single Page Application using Cro as the backend, and webpack, ES6, React and Redux as the frontend (no prior knowledge needed). It shows a SPA for a (food/beer) festival where people could leave their tips about what’s hot and what’s not, and being able to see them in real time. It supports:

  • Submitting new tips (a POST to the backend).
  • Having the latest tips appear live (delivered over a web socket).
  • Being able to agree to disagree with a tip (also a POST).
  • Being able to see a list of the tips sorted most agreeable to most disagreeable (obtained by a GET).

A must read if you are looking into building fully interactive web-applications, specifically using all of the asynchronous functionality that Rakudo Perl 6 offers today!

Other Core Developments

  • Although not strictly a core feature, but in the eyes of yours truly as important to Rakudo¬†Perl¬†6 as Rails was to Ruby: a new release of Cro (version 0.7.1). New features are: cro web starting a web interface for stubbing, running, tracing & viewing logs from services in development, the router having include/delegate support for composing routes. A large number of issues was fixed, especially in HTTP/2.0 support.
  • Brian S. Julin‘s Pull Request to support the $.^name syntax has been finally merged. I guess it got a bit Warnocked ūüė¶
  • Elizabeth Mattijsen fixed the multi sub foo(:@c is copy) syntax, which apparently was overlooked during the GLR. She also made certain combinations of attribute initializations throw an X::NYI (Not Yet Implemented) exception with a workaround suggestion, rather than silently not initializing.
  • Samantha McVey sped up joining of large strings (like more than 300 graphemes) up to 10x.
  • Daniel Green implemented an nqp op to quickly create an Int from another Int, but without any mixins. He also sped up various types of interpolation into regular expressions.
  • Timo Paulssen improved the “no such attribute” error on a failing nqp::getattr. This has helped yours truly already a lot in the past week!
  • And many more smaller fixes and improvements!.

Other Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Winding down

Not a small Perl¬†6 Weekly again this week. It’s almost become a dayjob! But a fun one! So keep all the new stuff coming so yours truly can report them again in the next issue of the Perl¬†6 Weekly. See you then!

2017.44 Nom Mastered

It has been a long time coming, but finally the default branch of Rakudo Perl 6 is no longer called nom (for New Object Model), but called master (which is what most git tools take as the default default). More than 6 years after it became the default branch. For a lot of people involved in the development of Rakudo Perl 6 it almost feels like a rite of passage. Zoffix Znet keeps us up to date on these developments.

Advent Calendar 2017

It’s almost that time of the year again, with just over a month to go: the Rakudo¬†Perl¬†6 Advent Calendar. Zoffix Znet issued the Call for Authors. Have an idea for a blog post? Don’t wait too long with it: only 15 slots left at the moment of this writing!

Rakudo 2017.10 Released

After a long period of labor, compiler release Rakudo 2017.10 has seen the light after the last showstoppery issues were resolved. The third release that Aleks-Daniel Jakimenko-Aleksejev has done in a row! Not too long after that Claudio Ramirez made sure the world knows about the Linux packages he has created from that compiler release.

New Rakudo Star in the works

Steve Mynott tells us that there is now also an RC0 (Release Candidate #0) release of Rakudo Star 2017.10 (draft announcement). An important change with previous versions of Rakudo Star is that panda is no longer shipped because it has been deprecated in favour of zef.

Binary RC0 releases for MacOS (DMG) and 64-bit Windows (MSI) and a new experimental linux cross distro 64 bit build (using AppImage) are also available. The AppImage was built using scripts by Samantha McVey and should work on any recent (3 year old or newer) mainstream Linux distro by setting as executable and running (no installation needed).

Please download and test! Please give any feedback on the #perl6 IRC channel, or create an Issue. It’s hoped the final Rakudo Star 2017.10 release will take place around November 8th.

Squashaton Again!

This week sees the first Saturday of the month, so that means Squashaton time! This time the focus will be on the documentation again, aka the doc repository.

Books, Books, Books!

Andrew Shitov announced a new book “Using Perl¬†6” for immediate availability. On FaceBook he described it like this:

About a year ago, I decided to write a book about using Perl¬†6. Later, the plans changed and I published “Perl¬†6 at a Glance”, after which I wanted to write “Migrating to Perl¬†6” but instead wrote “Perl¬†6 Deep Dive” for Packt Publishing. Here and there, I was giving trainings on Perl¬†5, Python, and JavaScript, and was always suffering from finding a good list of easy tasks that a newcomer can use to train their skills in the language. Finally, I made up the list and solved it in Perl¬†6. This is the content of “Using Perl¬†6” ‚ÄĒ a book with solutions to 100 programming challenges, from simple to intermediate, with explanations of the Perl¬†6 constructions used. (…) The PDF version can be bought and downloaded already today.

Meanwhile, it became clear that Moritz Lenz has another book planned for late December: Parsing with Perl 6 Regexes and Grammars. I wonder how long it will take before this overview becomes too crowded! Who would have thought that a year ago?

Near Future Of Programming Languages

Stephen Diehl provided an overview last January. Guess which language is missing? Fortunately, some recent comments on Hacker News (this and that) picked up on that.

my %h is Set = ...;

Elizabeth Mattijsen made my %h is Set = <a b c> finally work (of course, also for the other QuantHash types: SetHash, Bag, BagHash, Mix and MixHash). This can be especially useful for the mutable QuantHash types, as you can now:

my %h is SetHash = (integers from some source);
%h .= grep: *.is-prime; # only keep the prime numbers in %h

And any other action that you would like to do “in place”.

Other Core Developments

Most of the tuits this week were spent on fixing the showstoppery issues that were blocking the release. Aleks-Daniel Jakimenko-Aleksejev provided an overview of ticket activity of the past two weeks that more or less reflects that. Other notable developments were:

  • Zoffix Znet and Elizabeth Mattijsen worked on various aspects of the new ThreadPoolScheduler, focusing on efficiency and stability.
  • Zoffix Znet solved an issue with multiple initializations of native arrays and an issue that prevented getc from not waiting for a keypress on MacOS.
  • Stefan Seifert continued his work on JITting the interface with NativeCall, making the interface between Rakudo¬†Perl¬†6 and e.g. Inline::Perl5 much more efficient.
  • And many other smaller fixes and improvements.

Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Meanwhile on PerlMonks

Winding Down

As one of the distractions this week, I was looking at Code Golf, which has a lot of entries for Rakudo Perl 6. A good sight to see! Now, if I could only figure out how one can see the actual code samples. Perhaps next week. Join us then for another Perl 6 Weekly!