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
>>--
onQuantHash
es, fixed an issue with deprecatedsub
s /method
s that were alsohidden-from-backtrace
, and improved an error message when using==>
(aka feeds) on shaped arrays.
Questions about Raku
- Oneliner to test if string matches against any elements in an array by Steve Dondley.
- What would it take to port Perl’s PAWS modules for AWS services? by Steve Dondley.
- Can Raku byte-compile data to persist it to disk? by Daniel Sockwell.
- Using scalar variables to refer to an array inside an explicit generator by Lars Malmsteen.
- Guidance for writing a wrapper for Perl’s
File::Homedir
by Steve Dondley.
Meanwhile on Twitter
- Rakudo cooked right by Alexey Melezhik.
- Something like this by Fernando Corrêa de Oliveira.
- For dummies by Dr. James Wasmuth.
- Probably something like this by Fernando Corrêa de Oliveira.
- Partial to Raku by Massa Humberto.
- Thanks to her by Marc Chantreux.
- Support for ArchLinux by Alexey Melezhik.
- Building Rakudo with Rakusta by Alexey Melezhik.
- Sparky has moved by Alexey Melezhik.
- An unfinished effort by Perry E. Metzger.
- Take a look! by Fernando Corrêa de Oliveira.
- Actually getting it right by Joelle Maslak.
- Same, in the nude by Joaquín Ferrero.
Meanwhile on the mailing list
- Regex surprises by Sean McAfee.
- How can I check the content of a pre-compiled file? by Dominique Dumont.
Comments about Raku
- Birthing a new language by echelon.
- Top 10 highest paying programming languages of 2022 on Exponent.
- Do the Raku thing by aghamut.
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
- Cromtit, Sparrowdo, Tomtit, Tomty by Alexey Melezhik.
- Win32::Registry by Steve Dondley.
- Digest::HMAC by JJ Merelo.
- UpRooted by Pawel Pabian.
- CSS::Grammar, LWP::Simple, LibXSLT by David Warring.
- HTML::Tag by Márton Polgár.
- App::tmeta by Brian Duggan.
- String::Utils, as-cli-arguments by Elizabeth Mattijsen.
- PublicSuffix by JJ Atria.
- RakuConfig, Collection-Plugins by Richard Hainsworth.
- FindBin-libs by Steven Lembark.
- Gnome::Gtk3 by Marcel Timmerman.
- Text::Utils by Tom Browder.
- Path::Finder by Leon Timmermans.
- Chemistry::Stoichiometry by Anton Antonov.
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!