Skip to content

Instantly share code, notes, and snippets.

Tobias Leich FROGGS

Block or report user

Report or block FROGGS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View p6-Net-LDAP.pm6
use v6;
unit class Net::LDAP;
use NativeCall;
constant LDAP_SUCCESS = 0;
constant LDAP_VERSION3 = 3;
constant LDAP_OPT_PROTOCOL_VERSION = 0x0011;
constant LDAP_OPT_X_TLS_REQUIRE_CERT = 0x6006;
FROGGS / Routes.pm6
Created Mar 10, 2018
adding HTTP methods to cro
View Routes.pm6
use Cro::HTTP::Router;
sub r(Str $method, &handler --> Nil) { $*CRO-ROUTE-SET.add-handler($method, &handler) }
sub routes() is export {
route {
get -> {
content 'text/html', '<h1> hello </h1>';
r 'LINK', -> {
View fix.diff
diff --git a/src/core/CompUnit/ b/src/core/CompUnit/
index 2976e02..16a0eb2 100644
--- a/src/core/CompUnit/
+++ b/src/core/CompUnit/
@@ -244,7 +246,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
$RMD("id: $, src: $dependency.src(), spec: $dependency.spec()") if $RMD;
my $path =$compiler-id, $;
if $path.e {
- spurt($path ~ '.rev-deps', "$\n", :append);
+ spurt($path ~ '.rev-deps', "$id\n", :append);
View gist:8c9556cf97fb301f8f84
grammar BUU {
token TOP { <abc>+ };
token abc { ('a') <bc>* };
token bc { [ ('b') <c>* ]+ }
token c { 'c' };
class BuuAbc {

What I wanna use serialization for

The most pressing use case is loading modules databases Really Fast™. There we we need to be able to deserialize a .moarvm file, which most likely is a structure of hashes and arrays, besides strings representing identifiers and file names. (I would like to serialize CompUnits and IO::Paths directly, but that would not survive a rakudo rebuild. A json backup on the otherhand could serve as a fallback, but that also means we are limited to what json can. Not much.)

View jvm.diff
diff --git a/src/Perl6/Metamodel/BOOTSTRAP.nqp b/src/Perl6/Metamodel/BOOTSTRAP.nqp
index 3c4380d..9156616 100644
--- a/src/Perl6/Metamodel/BOOTSTRAP.nqp
+++ b/src/Perl6/Metamodel/BOOTSTRAP.nqp
@@ -1103,9 +1103,13 @@ BEGIN {
Attribute.HOW.add_method(Attribute, 'new',
nqp::getstaticcode(sub ($self, :$name!, :$type!, :$package!, :$inlined = 0, :$has_accessor,
:$positional_delegate = 0, :$associative_delegate = 0, *%other) {
+ nqp::say('BOOTSTRAP:1106 ' ~ $$self) ~ ' ' ~ $name);
my $attr := nqp::create($self);
unit module Ser;
use nqp;
sub serialize($obj is copy) is export {
my Mu $sh := nqp::list_s();
my $name = 'Ser_' ~ nqp::time_n();
my Mu $sc := nqp::createsc(nqp::unbox_s($name));
nqp::setobjsc($obj, $sc);
nqp::scsetobj($sc, 0, $obj);
my $serialized = nqp::serialize($sc, $sh);
View gist:3ab0151f513b570eeb4e
my %h = 1 => [ [<what what>], [<how how>] ], 2 => [ [<this this>] ];
my $i = 0;
%h.values».map({"{++$i} " Z~ @($^a)}).say;
Created Apr 8, 2015
sample output of perl6-gdb-m
$ perl6-gdb-m -e 'say uniname(nqp::null_s)'
This is Rakudo Perl 6 running in the GNU debugger, which often allwos to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.
The currently used MoarVM backend is not compiled with debugging symbols, you might want to
reconfigure and reinstall MoarVM with --debug enabled.
This Rakudo version is built on MoarVM version 2015.3.64.g.79.b.6087,
running on ubuntu (14.4.2.LTS.Trusty.Tahr) / linux (81.Ubuntu.SMP.Tue.Mar.
View reports.2015.3
Acme::Meow * True True moar
JSON::Tiny * True True moar
Testing * True True moar
mandelbrot * moar
IO::Prompter * True False moar
Math::Polynomial * True True moar
Math::Vector * True True moar
Math::ContinuedFractions * True True moar
Math::ChebyshevPolynomial * True True moar
Math::OddFunctions * True True moar
You can’t perform that action at this time.