Skip to content

Instantly share code, notes, and snippets.

@japhb
japhb / rakudoc-install-fail.txt
Created May 4, 2021 00:02
Failure of `zef install rakudoc`
$ zef install rakudoc
===> Searching for: rakudoc
===> Searching for missing dependencies: Pod::Utilities:ver<0.0.1+>, IO::MiddleMan:ver<1.001003+>
===> Testing: Pod::Utilities:ver<0.0.1>
===> Testing [OK] for Pod::Utilities:ver<0.0.1>
===> Testing: IO::MiddleMan:ver<1.001003>
===> Testing [OK] for IO::MiddleMan:ver<1.001003>
===> Testing: rakudoc:ver<0.2.3>:auth<github:Raku>:api<1>
[rakudoc] No such method 'read-dist' for invocant of type
[rakudoc] 'CompUnit::Repository::Distribution'
@japhb
japhb / u
Last active January 29, 2024 05:45
japhb's Unicode search/display script 'u'
#!/usr/bin/env raku
use sigpipe;
use Text::MiscUtils::Layout;
sub show-cp($cp) {
my $char = $cp.chr;
my $width = duospace-width($char);
my $spacer = ' ' x (2 - $width);
@japhb
japhb / Dockerfile
Created March 11, 2021 01:14
(Docker + raku -c) bug
FROM rakudo-star:2020.10
WORKDIR /app
COPY . .
# This is the bug trigger; comment out and no BUG
USER raku
RUN raku -c -I. -MDockertest -e ''
@japhb
japhb / recreate-test-mock-failure
Last active February 28, 2020 21:21
Script to recreate Test::Mock testing failure
#!/bin/bash
set -e -x
mkdir build-root
cd build-root
git clone https://github.com/rakudo/rakudo.git
git clone https://github.com/ugexe/zef.git
#!/usr/bin/env perl6
sub MAIN($before, $after) {
my $pct = 100 * ($before - $after) / $before;
say abs($pct).fmt: "%9.2f%% {$pct < 0 ?? "more" !! "less"} time";
say $pct < 0 ?? ($after / $before).fmt("%9.2f times slower")
!! ($before / $after).fmt("%9.2f times faster");
}
@japhb
japhb / p6ccoc.md
Last active August 29, 2015 14:25
Ideas for a "Perl 6 Community Code of Conduct"
  1. We aim to be actively welcoming, friendly, respectful, and helpful to everyone interested in Perl 6 and our shared community.
  2. We don't discriminate on any basis other than ability to be a kind, positive member of our community.
  3. Our standard of behavior is "awesome". If your behavior is LTA (Less Than Awesome), we will call you on it.
  4. There is no form of negative behavior that will impress us or gain you favor in our community.
  5. We try to hug trolls where possible, but if that doesn't work, we eject them. The health and happiness of our community comes first.
@japhb
japhb / requests.md
Created April 3, 2015 16:33
japhb's ++jnthn requests

Concurrency

  • General resiliency under heavy task load, when tasks > all(cores, threads)
    • Correct results
    • No crashes
    • No "cliff-like" performance as overload point is passed
      • Note: better to OOM than GC thrash
      • Similarly better to serve some tasks well than all badly via e.g. context switch storms
  • Idle/block on inputs without burning CPU
  • (and/or use idle time for something productive like GC)
@japhb
japhb / rakudo-path
Created January 8, 2014 01:11
japhb's current update-rakudo and rakudo-path scripts
#!/usr/bin/perl
my $share = '/YOUR/SHARE/ROOT/HERE';
my $share_bin = "$share/perl6/bin";
my ($vms, $ver) = @ARGV;
my @vms = split /\s*,\s*/ => $vms || '';
@vms or die "Must specify one or more VMs in path priority order (e.g. 'jvm,parrot') as the first argument.\n";
my @vm_bins;
@japhb
japhb / 3D-Proposal.md
Created January 7, 2014 04:18
Proposal: Performance-oriented Perl 6 3D math lib

One Perl 6 3D Math Lib to Rule Them All

There are currently several different 3D-related math libraries for Perl6: Math::Vector, Math::Quaternion, etc. They don't interoperate smoothly, have different API designs, and aren't designed with efficiency/performance as a primary goal.

I propose we create a new 3D/graphics-oriented math library with the following design parameters.

Design Parameters

  • Build sugary syntax on top of efficient underlying implementation, allowing the library user to choose their tradeoff point
@japhb
japhb / metamodel-test.pl
Created November 14, 2013 20:11
Using the Perl 6 metamodel to serialize class *definitions*.
use v6;
#= Composed into an Attribute subclass that can serialize attribute definitions to Perl source
role PerlableAttribute {
method traits_perl() {
my $traits = '';
$traits ~= ' is rw' if self.rw;
$traits ~= ' is box_target' if self.box_target;
$traits;
}