2022.38 Another Wave

Ben Davies has been working a lot on Data::Record, a module that introduces record types for maps, lists and tuples to the Raku Programming Language. Still not happy with the feature set, they described how the next wave of changes to the module may look. Pretty interesting features and ideas (/r/rakulang comments)!

Tomasz’s Corner

Tomasz Wegrzanowski included the Raku Programming Language in their latest series of blog posts researching regular expressions in different programming languages.

Kang-min Liu’s Corner

Kang-min Liu (perhaps better known as gugod to some) published a blog post about solving FizzBuzz with types (original Chinese, Google translated English version).

Did You Know?

That you can introspect the minimum and maximum number of positional arguments to any Callable?

sub num-args(&code) {
    say "&code.arity() <= x <= &code.count() arguments";
}
num-args * - 1;           # 1 <= x <= 1 arguments
num-args sub a($a?) { }   # 0 <= x <= 1 arguments
num-args { $^b cmp $^a }  # 2 <= x <= 2 arguments

But why would you want to check that? Well, in some cases you might want to adapt the internal logic of code depending on the possible number arguments. One example in the core, is the .sort method: if the specified Callable can only take 1 positional argument maximally, then it will do a Schwartzian Transform under the hood to reduce the number of comparisons!

say <a H b g c l>.sort;  # (H a b c g l)

my int $i;
say <a H b g c l>.sort: { ++$i; .lc }  # (a b c g H l)
say $i;  # 6 (did a Schwartzian Transform)

my int $j;
say <a H b g c l>.sort: { ++$j; $^b cmp $^a }  # (l g c b a H)
say $j;  # 8 (no Schwartzian Transform possible)

Check out the “did you know” registry, started by Wenzel P.P. Peppmeyer. Suggestions as Pull Requests welcome!

Weeklies

Weekly Challenge #183 is available for your perusal.

New Problem Solving Issues

New Pull Requests

Core Developments

  • Elizabeth Mattijsen corrected the behaviour of >>-- on QuantHashes, fixed an issue with deprecated subs / methods that were also hidden-from-backtrace, and improved an error message when using ==> (aka feeds) on shaped arrays.

Questions about Raku

Meanwhile on Twitter

Meanwhile on the mailing list

Comments about Raku

New Raku Modules

  • Int::polydiv “The counterpart of the polymod method” by Márton Polgár.
  • ProblemSolver “Simple Constraint Programming Problem Solver” by Fernando Corrêa de Oliveira.
  • App::Zef-Deps “Report on module dependencies for raku” by Will Coleda.
  • Git::Files “List known files of a git repository” by Elizabeth Mattijsen.

Updated Raku Modules

Winding down

Seventeen different people worked on Raku modules this week, that could very well be a record!

This week’s image has always been an inspiration to many. To remind us of Ukraine in their and our fight against the Russian aggression. Слава Україні!  Героям слава!

In the meantime, please stay safe, stay healthy, keep up the good work!

If you like what I’m doing, committing to a small sponsorship would mean a great deal!

Leave a Reply

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 )

Facebook photo

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

Connecting to %s