Skip to content

Instantly share code, notes, and snippets.

vrurg / coerce-bench.raku
Created July 7, 2022 02:05
Benchmarking for Raku coercion protocol
View coerce-bench.raku
class CNewMulti {
has $.val;
multi method new(Int:D $val) {
samewith :$val;
class CNewSingle {
has $.val;
method new(Int:D $val) {
View timing-test.raku
use Test;
my $v = 0;
my $st = now;
for ^100000 {
my $et = now;
diag "Test time: " ~ ($et - $st);
View Bar.rakumod
unit class Bar;
use Foo;
also does Foo;
vrurg / rakudo-segv
Created February 1, 2022 16:18
Rakudo SEGV
View rakudo-segv
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f9a85de6249 in exists_key () from //home/vrurg/src/Raku/rakudo-master/install/lib/
[Current thread is 1 (Thread 0x7f9a857db440 (LWP 3931316))]
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f9a857db440 (LWP 3931316) 0x00007f9a85de6249 in exists_key ()
from //home/vrurg/src/Raku/rakudo-master/install/lib/
2 Thread 0x7f9a857d9700 (LWP 3931317) 0x00007f9a85e3a0a5 in add_usage_for_bb ()
from //home/vrurg/src/Raku/rakudo-master/install/lib/
View nominalizable-test.raku
role R[::T] {
my subset RS of T where { note "VALIDATING ", $_, ", T:", T.^name; True };
method the-subset { RS }
method foo(RS $vrs) {
pass "got value " ~ $vrs.raku

My comments are in quotes like this one.


I think title must reflect the subject somehow. Perhaps, include the "architechture" word.

Red is a ORM for Raku that tries to mimic Raku's Seq's API but to query databases.

Since the document is aiming at potential contributors, this sentense is redundant. They already know its ORM, its about DBs. The only useful part of it is about Seq mimicing.

View Comma MoarVM debug


  • Project:
  • Rakudo stack is built with ./ --gen-moar --gen-nqp --backends=moar – nothing specific
  • Just in case, as the project needs chained dispatchers, there is a branch v-dispatcher for it in either the main rakudo repo or in my fork at
  • A breakpoint is set in lib/Vikna/EventHandling.rakumod. Basically any line within !run-ev-loop method is ok. Last time it was line 58.
  • The script I'm using for testing is t/desktop/010-screen-resize.t
  • The debugging can be configured with option start suspended set to any on or off, makes no difference. I usually start suspended, so my scenario is based on this.

What happens:

View gist:8357c16c419c293e0953240b31ad20f1
in compute_mro (gen/jvm/Metamodel.nqp:1240)
in compose (gen/jvm/Metamodel.nqp:3972)
in <anon> (gen/jvm/World.nqp:3355)
in <anon> (gen/jvm/World.nqp:5474)
in ex-handle (gen/jvm/World.nqp:5472)
in pkg_compose (gen/jvm/World.nqp:3355)
in package_def (gen/jvm/Actions.nqp:3247)
in !reduce (gen/jvm/stage2/QRegex.nqp:1607)
in !cursor_pass (gen/jvm/stage2/QRegex.nqp:1550)
View class-qualified.p6
role R {
has $!a = 0;
method inc-a { $!a++ };
method a { $!a }
method info {
say "R::info ::?CLASS: ", ::?CLASS;
View proxy-bench.p6
use Bench;
my $rcnt = 0;
my $wcnt = 0;
class C {
has $.a is rw;
has $.b is rw;
submethod TWEAK {
my $a;