Skip to content

Instantly share code, notes, and snippets.

$ RAKUDO_MODULE_DEBUG=1 make pmtest
rm -f lib/PASM/Backend/AST.pir lib/PASM/Backend/GNUC.pir lib/PASM/Backends.pir lib/PASM/Grammar.pir
perl6 test.pl
MODULE_DEBUG: loading /usr/local/lib/parrot/5.1.0-devel/languages/nqp/lib/Perl6/BOOTSTRAP.pbc
MODULE_DEBUG: done loading /usr/local/lib/parrot/5.1.0-devel/languages/nqp/lib/Perl6/BOOTSTRAP.pbc
MODULE_DEBUG: loading /usr/local/lib/parrot/5.1.0-devel/languages/perl6/lib/lib.pir
MODULE_DEBUG: done loading /usr/local/lib/parrot/5.1.0-devel/languages/perl6/lib/lib.pir
MODULE_DEBUG: loading lib/PASM/Backends.pm
MODULE_DEBUG: loading lib/PASM/Backend/AST.pm
MODULE_DEBUG: loading lib/PASM/Grammar.pm
(do {
multi _($a, :foo($) where 'bar') {
say "bar $a"
}
multi _($a, :foo($) where 'baz') {
say "baz $a"
}
(&_)
})(42, :foo<bar>);
diff --git a/build/Config/BuildEnvironment.pm b/build/Config/BuildEnvironment.pm
index 9cfaa6f..5b2b9bd 100644
--- a/build/Config/BuildEnvironment.pm
+++ b/build/Config/BuildEnvironment.pm
@@ -74,8 +74,8 @@ my %TOOLCHAINS = (
# Required flags
cmiscflags => '-D_REENTRANT -D_LARGEFILE64_SOURCE -Wparentheses -Wreturn-type',
- lmiscflags => '-L3rdparty/apr/.libs',
- llibs => '-Wl,-Bstatic -lapr-1 -Wl,-Bdynamic -lpthread -lm',
@gerdr
gerdr / shift.t
Created July 3, 2013 17:21
shift tests
use v6;
use Test;
plan 60;
sub check ($a, $b, $ls, $rs) {
is $a * 2**$b, $ls, "expected value $ls for shl $a by $b is sane";
is floor($a / 2**$b), $rs, "expected value $rs for shr $a by $b is sane";
is $a +< $b, $ls, "got expected value $ls for shl $a by $b";
@gerdr
gerdr / gist:5922055
Last active December 19, 2015 07:58
shift semantics
Rakudo/Parrot, int and (soon) Int:
17 +> 3 = 2 # 17 div 2**3
-17 +> 3 = -3 # floor(-17 / 2**3)
17 +> -3 = 136 # 17 <+ 3 = 17 * 2**3
-17 +> -3 = -136 # -17 <+ 3 = -17 * 2**3
17 +< 3 = 136 # 17 * 2**3
-17 +< 3 = -136 # -17 * 2**3
17 +< -3 = 2 # 17 +> 3 = 17 div 2**3
-17 +< -3 = -3 # -17 +> 3 = floor(-17 / 2**3)
@gerdr
gerdr / gist:6184541
Last active December 20, 2015 19:38
MoarVM configuration refactor

The current build system is too restrictive. I did an ad-hoc fix to get my setup to work, but a proper solution should respect the following configuration options:

host os --os

win32 vs posix

determines things like binary suffix or which libraries need to be linked (-lm -lpthread vs -lws2_32 -lmswsock ...)

build shell --shell

@gerdr
gerdr / Configure.pl
Last active December 20, 2015 20:39
MoarVM Configure.pl
#!perl
use 5.010;
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
my %SHELLS = (
@gerdr
gerdr / foo.c
Last active December 20, 2015 21:59
how we structure C type definitions
// enumerations cannot be forward-declared
// the compiler needs to see its definition
// if it wants to choose an underlying type other than int
// therefore, we start with enum definitions
enum foo
{
FOO,
BAR
};
@gerdr
gerdr / gist:6204335
Last active December 20, 2015 22:19
moarvm naming ambiguities
should all of these be MVM*?
no prefix:
HashAttrStoreBody, Uninstantiable
P6 prefix:
P6int, P6num, P6str
mixed prefix:
MVMP6opaque
@gerdr
gerdr / gist:6228451
Last active December 21, 2015 01:29
moarvm gerdr/libuv-build fail
prove -e D:\dev\p6\win32\bin\nqp.exe t\moar t\qast
t\moar\6model.t ................. ok
t\moar\annotated.t .............. ok
t\moar\associative.t ............ ok
t\moar\attribute.t .............. ok
t\moar\boxing.t ................. ok
t\moar\branching.t .............. ok
t\moar\calling.t ................ ok
t\moar\clargs.t ................. ok
t\moar\close_filehandle.t ....... ok