It’s that time of the year again: the time for writing Raku Advent Calendar blog posts! So that we can all enjoy them in the darkest days of the year (well, at least on the Northern Hemisphere). The elven have opened up the 2025 list of articles to be. Please add your name and proposed article title: beginner or medium or advanced. Or tongue-in-cheek, or ultra technical. It will all be well appreciated!
London Perl (and Raku) Workshop 2025 is On
Andrew / Organiser:
Well, it was a busy weekend, so I’ll have to update the site on Monday. Thanks for your patience. The event is going ahead as the Short Notice London Perl and Raku Workshop 2025 on 29th November, we’ve got some great talk proposals in, and am looking to confirm the venue the week of the 10th November (hopefully before Friday 14th November), and then it’s all go! =D.
Please visit https://www.londonperlworkshop.com and keep an eye out for the Call for Papers and further announcements. I hope to see you there!
Raku Tips ‘n Tricks
This is the third of the new tips and tricks item, with Nahita as a new contributor:
#RTnT#3: Generate N standard Normals
my \N = 750;
my @normals = sqrt(-2 × log(rand)) × cos(2×π × rand) xx N;
# Visualize their distribution
my $bin-width = 0.3;
my %binned is default([]) = @normals.classify(*.round: $bin-width);
put (-3, *+$bin-width … +3).map({ .fmt: "%4s {"-" x +%binned{$_}}\n" });
## Sample output
#`[
-3 ----
-2.7 --
-2.4 ------
-2.1 ---------
-1.8 ---------------
-1.5 ------------------------------------
-1.2 --------------------------------------------
-0.9 ------------------------------------------------
-0.6 --------------------------------------------------------------
-0.3 ----------------------------------------------------------------------------------
0 -----------------------------------------------------------------------------------------------------
0.3 ------------------------------------------------------------------------------------
0.6 ----------------------------------------------------------------------------
0.9 ------------------------------------------------------------------
1.2 -------------------------------------------
1.5 --------------------------------
1.8 ----------------------
2.1 ----------
2.4 ------
2.7 -
3 -
]
#`{ What's happening
Short answer:
- Box-Muller transform can make a Normal random number from two Uniform ones. Its formula almost verbatim
translates to Raku. The powerful `xx` with its "thunking" ability allows one to suddenly have a vector of Normals.
- Empirical distribution of the generated numbers is one sanity check of normality; `&round` with its (unexpected)
non-integer argument allows one to "bin" a number, and ever-helpful `&classify` assigns everyone to
their corresponding bin. Second step puts an ASCII representation of the distribution on the terminal.
Long answer: paste.debian.net/1405349
Some references
---------------
- https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
- https://docs.raku.org/language/operators#infix_xx
- https://en.wikipedia.org/wiki/Thunk
- https://docs.raku.org/language/glossary#Thunk
- https://docs.raku.org/type/List#routine_classify
- https://docs.raku.org/type/Cool#routine_round
- https://docs.raku.org/type/Variable#trait_is_default
}
I hope you like this regular weekly item. To contribute please make a gist and share via the raku channel IRC or Discord.
Weeklies
Weekly Challenge #347 is available for your discovery.
CRA Corner
There is a new Open Source Software Stewards and CRA Whitepaper that describes this new, important role in Open Source projects under the Cyber Resilience Act (CRA) who duties including the publishing of Security Policies – a good read for those who may be interested in OSS security developments. I suspect a call for Stewards will come sometime soon!
New Docs Pull Requests
- issue 4560, class Any (use first commit only) by Eric Forste
- In Hash.rakudoc, remove extra colon by David Schultze
- In Enumeration.rakudoc, add output of .WHAT to example by David Schultze
- In structures.rakudoc, match semicolon usage to previous example, and reword a sentence by David Schultze
- In list.rakudoc, add explanations and references about indexing by David Schultze
- rm duplicate paragraph in Language/signatures by Eric Forste
- changing method to routine for deepmap, in type/Any by Eric Forste
- Fix link to categorize method in List documentation by Eric Forste
- eliminate superstitious parentheses in operators.rakudoc by Eric Forste
New Pull Requests
- Transform comp_line_directives from an AoS to a SoA by timo
- Add RakuAST Optimizer by Jimmy Zhuo
- RakuAST: Check return type by Jimmy Zhuo
- Format at compile time by Jimmy Zhuo
- Don’t allow a Range in an array shape specification by Elizabeth Mattejson
New Raku One-liners
- outputs all matches from one line of STDIN by jubilatious1
Questions About Raku
- What is the difference between where so and flattening by ToddAndMargo
- Where do I find Proc in the src code? by ToddAndMargo
- run and release? by ToddAndMargo
Comments About Raku
- The #idris2 tutorial book requires #rakulang 🦋 in the build process! by Samuel Chase
- this category also includes MoarVM by Abhinav Sarkar
- YAPC::Fukuoka 2025 is happening on 14-15 Nov 2025 by Mohammad Sajid Anwar
- Wow, Raku looks like a really interesting language by jamiejquinn
New Raku Modules
- Raku::Elements by Elizabeth Mattijsen
- Hilite::Simple by Steve Roe
Updated Raku Modules
- Pod::To::HTML, POFile, Template::Mustache, Pod::To::Markdown, OO::Monitors by Various Artistes
- Terminal::Print by zef:terminal-printers
- Sparky-Job-Api, Sparky, Sparrow6::Rakudo::Install by Alexey Melezhik
- App::Mi6 by zef:skaji
- Net::Ethereum by zef:knarkhov
- App::Crag, Physics::Measure by Steve Roe
- Log::Async by Brian Duggan
- Terminal::Capabilities, Terminal::Tests, Terminal::Widgets by Geoffrey Broadwell
- Jupyter::Chatbook by Anton Antonov
Winding down
Really nice to see Nahita proposing an item for the Tips & Tricks section – I mean frankly, I think I could write 100s of these myself [please don’t!] … so don’t be shy and keep them coming.
Readers with sharp eyes will notice that this WordPress.com hosted blog now has Raku code highlighting – thanks to the new raku Hilite::Simple module (author yours truly). It is built on the Rainbow module by Patrick Böker and uses RakuAST under the hood. It uses the same default colour scheme as the new https://raku.org website. (and btw it’s a challenge to make HTML that WordPress does not regurgitate).
Big shout out to SmokeMachine for this weeks cover image that recalls the infamous mug throwing incident that started the work on Raku (the language formally known as Prince Perl6).
Please keep staying safe and healthy, and keep up the good work! Even after week 42 of hopefully only 209.
Meanwhile, still: Слава Україні! Героям слава!
~librasteve (editor-in-chief)
