Planet Raku

Raku RSS Feeds (individual feeds | subscribe to all via Atom)

Elizabeth Mattijsen (Libera: lizmat #raku) / 2026-04-22T11:25:45


2026.16 Selkie TUI Framework

Published by librasteve on 2026-04-21T18:33:32

Post Image: Carolyn Emerick, CC BY-SA 3.0 https://creativecommons.org/licenses/by-sa/3.0, via Wikimedia Commons

Matt’s Corner

Matt Doughty has served up a double helping of Selkie this week. This is a TUI (Terminal User Interface) module written in Raku that provides a simple, declarative way to roll your own TUI app in Raku. Please do check it out – I look forward to seeing a crop of Raku TUIs to feature in the weekly.

and

The pitch: you build a widget tree declaratively, mutate state, and the framework handles dirty tracking, rendering, focus cycling, resize, and teardown. Native performance without the pain.

Sizing uses a fixed/percent/flex model similar to CSS flexbox. There’s an optional re-frame style reactive store if you want centralized state with event dispatch, effect handlers, and path subscriptions.

Ships with a decent widget set out of the box: text inputs (single and multi-line), scroll views, list views, card lists, tables with sortable columns, tab bars, modals, progress bars, a command palette, file browser, image display via pixel blitter, and theming throughout.

Seven example apps in the repo covering everything from a minimal counter to a tabbed dashboard.

Also includes a testing toolkit (keystroke synthesis, Supply observation, store assertions, snapshot testing against a headless notcurses instance) so you can test widget behaviour without a terminal.

Richard’s Corner

Richard Hainsworth says

I am really pleased to let you know that finally Damian Conway and I have significantly upgraded the specification of RakuDoc V2, so much so that I am calling it informally v2+. Elizabeth Mattijsen has added extra directives into RakuAST to accommodate these upgrades. I have upgraded Rakuast::RakuDoc::Render so that it now handles the whole RakuDoc V2 specification, and bumped the module version to v1.0.0.

There is a docker image (https://docker.io/finanalyst/browser-editor) that will serve localhost html to a browser and can be used to edit and evaluate RakuDoc. There is also a docker image (https://docker.io/finanalyst/rakudoc_browser) that will do the same for a web-based version.

For members of the Raku community, I have the web based version running at https://raku.finanalyst.org/rakudoc_editor/ This URL can be shared with the Raku community in the weekly, but not more widely.

I encourage anyone who is interested in Rakudoc to test drive the great new enumeration features at the links above. Awesome work by Richard, Damian and Elizabeth.

TPRC Submit your Talk

Don’t Miss the Perl and Raku Conference 2026 in Greenville, SC
SAVE THE DATES! Friday through Sunday, June 26-28

Registration is open: https://tprc.us/tprc-2026-gsp

Weekly Challenge

Weekly Challenge #370 is available for your joy.

Raku Tips ‘n Tricks

This week, Anton Oks has proposed that we focus on some cool Raku from over 200 examples featured on https://rosettacode.org/wiki/Category:Raku. This is his contribution to get the ball rolling (disclosure he is the author of this entry)…

#| Recursive, parallel, random pivot, single-pass, quicksort implementation
multi quicksort(\a where a.elems < 2) { a }
multi quicksort(\a, \pivot = a.pick) {
    my %prt{Orderis default([]) = a.classify: * cmp pivot;
    my Promise $less = start { samewith(%prt{Less}) }
    my $more = samewith(%prt{More});
    await $less andthen |$less.result, |%prt{Same}, |$more;
}

This code shows off a cool set of Raku features:

Very nice – thanks to Anton for creating some aspirational[*] Raku.

Your contribution is welcome, please make a gist and share via the #raku channel on IRC or Discord.

Comments About Raku

New Doc & Web Pull Requests

New Raku Modules

Updated Raku Modules

Winding down

[*] Aspirational. Just to clarify, it is not that we should all aspire to that style, but that if this is a style you want – a taut, compact routine that engages all facets of your language, then Raku excels. Other coding styles are available in Raku.

Anton shared these words with me:

… I believe no other language can do that so short and still readable. 😉 Raku is so much fun to work with – I do not understand why it is not much more popular …

Please keep staying safe and healthy, and keep up the good work! Even after week 64 of hopefully only 209.

~librasteve

P.S. Here is why I think Raku is so much fun…

Asking “Why wasn’t Shakespeare a German?” can be reframed as a question about language: why did his genius emerge in English rather than in German? One answer lies in the remarkable flexibility and absorptive quality of English during the late Renaissance. By Shakespeare’s time, English had already drawn heavily from Latin, French, and other languages, creating a hybrid vocabulary that allowed for nuance, invention, and wordplay. Shakespeare could shift easily between high and low registers, coin new expressions, and layer meanings in ways that felt natural within this fluid linguistic system.

German, by contrast—though rich and expressive—was less standardized in the 16th century and often more structurally rigid. Its grammatical complexity and regional fragmentation made it harder to achieve the same kind of rapid, playful experimentation that Shakespeare employed. Where English encouraged improvisation and borrowing, German tended to preserve clearer boundaries within its forms, limiting linguistic elasticity. Shakespeare’s writing thrives on ambiguity, puns, and tonal shifts, and these qualities depended on a language as adaptable as English.

2026.15 Hugs & Busses

Published by librasteve on 2026-04-13T17:59:27

Post image attribution: Eddie Leslie from Lancashire, CC BY-SA 2.0 https://creativecommons.org/licenses/by-sa/2.0, via Wikimedia Commons

Whateverables Corner

This week sees the release of 3 (yes, 3) new Whateverables.

The Whateverables are a collection of IRC bots primarily useful for Raku developers. They are written in Raku and are based on IRC::Client. Many of the use cases involve running Raku code using pre-built versions of the Rakudo compiler for each commit.

They work over the IRC-Discord bridge too mostly (make sure you are in the main #raku channel and note that sometimes the gremlins can get under the bridge – or is that the trolls).

Oh – and have something for the weekly? Then the Notable bot can be fed using weekly: my hot news

TPRC Submit your Talk

Don’t Miss the Perl and Raku Conference 2026 in Greenville, SC
SAVE THE DATES! Friday through Sunday, June 26-28

Registration is open: https://tprc.us/tprc-2026-gsp

Weekly Challenge

Weekly Challenge #369 is available for your giggles.

Raku Tips ‘n Tricks

This week, my eye was caught by an interesting post on Quora by Jan M Savage: Why do we use variables in programming languages?

Variables capture data that we can re-use, but more importantly, judicious use of variables lets our code tell a story.

sub sec-parser($secs) {
    my $rsecs =   $secs mod 60;
    my $rmins =  ($secs div 60) mod 60;
    my $rhrs  = (($secs div 60) div 60) mod 24; 
    my $days  = (($secs div 60) div 60) div 24;
    (:$days, :$rhrs, :$rmins, :$rsecs);
}

say sec-parser(240_000);    # (days => 2 hrs => 18 mins => 40 secs => 0)

Of course, you’ve made use of variables (declared with my) in order to capture data, but: your code is not telling a story since the variables are poorly named; pray what is rhrs???

Jan will show you how to write the same function such that all the div and mod operations occur underground (so to speak), so that all you can see is what matters:

sub sec-parser($total-sec) {
    my ($secs, $mins, $hrs, $days= $total-sec.polymod(60, 60, 24);
    (:$days, :$hrs, :$mins, :$secs);
}

say sec-parser(240_000);    #(days => 2 hrs => 18 mins => 40 secs => 0)

This code shows off a cool set of Raku features:

Very nice – thanks to Jan for combining great advice on variables and showing off some Raku.

Your contribution is welcome, please make a gist and share via the #raku channel on IRC or Discord.

Questions About Raku

Comments About Raku

New Doc & Web Pull Requests

New Raku Modules

Updated Raku Modules

Winding down

As we say in London, it’s like you wait forever for a bus and then 3 come along all at once. So it is with the spasm of activity this week on Whateverables (the last updates to that wiki were in 2023 … and 2020). Thanks to the authors for reviving the fun.

Please keep staying safe and healthy, and keep up the good work! Even after week 63 of hopefully only 209.

~librasteve

2026.14 Trim Flip-flops

Published by librasteve on 2026-04-06T18:45:19

Habere’s Corner

Habere-et-Dispertire has shared some new notes on using the raku command:

raku -ne "put .trim" {{/path/to/file}}

raku -ne '.put if "START" ff "STOP"' {{/path/to/file}}

raku -ne '.put if "START" ^ff^ "STOP"' {{/path/to/file}}

TPRC Submit your Talk

Don’t Miss the Perl and Raku Conference 2026 in Greenville, SC
SAVE THE DATES! Friday through Sunday, June 26-28

Registration is open: https://tprc.us/tprc-2026-gsp

Weekly Challenge

Weekly Challenge #368 is available for your entertainment.

Raku Tips ‘n Tricks

This week, my eye was caught by what looked like a simple question on the IRC (Discord) channels:

my (%a, @b, %c, @d= (1, 2).map({ |({"a" => 1}, [1]) });

Why does this seeming straightforward list assignment with = (see docs) cause an error?

Odd number of elements found where hash initializer expected:
Found 5 (implicit) elements: ...

Let’s tease that apart, say we make the LHS just a single Array @b and then a single Hash %a

my @b = (1, 2).map({ |({"a" => 1}, [1]) }); 
#OUTPUT say @b; #[{a => 1} [1] {a => 1} [1]]

my %a = (1, 2).map({ |({"a" => 1}, [1]) });
#ERROR

The docs say that list assignment is governed by the LHS – an Array will take all the RHS elements. We can surmise that a Hash will take all the RHS elements – even splitting key, values – and translate them into key => value pairs. Thus the error if presented with an odd number in total.

Despite this frustration, Raku has two ways to make this work:

my (%a, @b, %c, @dZ= (1, 2).map({ |({"a" => 1}, [1]) });
#-or-
my (%a, @b, %c, @d:= (1, 2).map({ |({"a" => 1}, [1]) });

say {:%a,:@b,:%c,:@d}
#OUTPUT {a => {a => 1}, b => [1], c => {a => 1}, d => [1]}

You can use binding := instead and since the LHS and the RHS have the same data structure this will work. Or you can combine Z (the zip metaoperator) with = (item assignment), like this:

my (a, b, c) Z= (a, b, c);
#turns that assignment into boring
my a = @x[0]; my b = @x[1]; my c = @x[2]

Your contribution is welcome, please make a gist and share via the #raku channel on IRC or Discord.

Questions About Raku

Comments About Raku

New Doc & Web Pull Requests

New Raku Modules

Updated Raku Modules