Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/Perl6/Module/Loader.pm b/src/Perl6/Module/Loader.pm
index 18ae71e..43ff5ab 100644
--- a/src/Perl6/Module/Loader.pm
+++ b/src/Perl6/Module/Loader.pm
@@ -69,7 +69,7 @@ method need_foreign($name, %name_adverbs) {
# Perl6's two phase import mechanism complicates things slightly
# We need to remember the $lsm to we can get at the exports *later*
- my $exports_closure := sub() {
+ my $exports_closure := pir::newclosure__PP(sub() {
sub Dlog (Str $name, Code $code, *@_) {
my $old_ = $_;
$_ = @_ ?? @_.perl !! q<()>;
my @ret = do-log( $name, get-logger( caller ), $code, @_ );
$_ = $old_;
return @ret;
}
my &Dlog-trace is export = &Dlog.assuming('trace');
sub x1 () { } # 1
sub x2 () { x1; x1 } # 3
sub x3 () { x2; x2 } # 7
sub x4 () { x3; x3 } # 15
sub x5 () { x4; x4 } # 31
sub x6 () { x5; x5 } # 63
sub x7 () { x6; x6 } # 127
sub x8 () { x7; x7 } # 255
sub x9 () { x8; x8 } # 511
sub x10 () { x9; x9 } # 1023
$ cat foo.cs
public class MainC {
public static void Main() {
string st = "foo";
unsafe { fixed (char *s = st) { *s = 'g'; } }
System.Console.WriteLine(st);
}
}
$ gmcs /unsafe foo.cs
$ mono --security=verifiable foo.exe
Principles of JSYNC as understood by sorear
1. JSYNC exists to interchange data. As such, it should be made as simple to
parse as possible, so that parsers are more likely to be correct.
2. It should be possible to use existing JSON tools to manipulate JSYNC texts.
Therefore, if two texts are semantically equivalent (and thus interchangable)
as JSON, they *must* also be interchangable as JSYNC.
3. JSYNC should be semantically equivalent to YAML. That means, it needs to
Announce: Niecza Perl 6
I am happy to make the first general announcement of Niecza Perl 6[1], a Perl 6
compiler project focusing on optimization research.
I have been tinkering with this for about 6 months now and I feel I finally
have something worth sharing.
While other Perl 6 compilers have focused on exploration of semantic issues,
Niecza is exploring implementation efficiency issues. The goal of this project
Announce: Niecza Perl 6
I am happy to make the first general announcement of Niecza Perl 6[1], a Perl 6
compiler project focusing on optimization research.
I have been tinkering with this for about 6 months now and I feel I finally
have something worth sharing.
While other Perl 6 compilers have focused on exploration of semantic issues,
Niecza is exploring implementation efficiency issues. The goal of this project
diff --git a/lib/CLRBackend.cs b/lib/CLRBackend.cs
index e3f0f36..80ff2a5 100644
--- a/lib/CLRBackend.cs
+++ b/lib/CLRBackend.cs
@@ -386,7 +386,7 @@ namespace Niecza.CLRBackend {
}
public static Method[] fromArray(object x) {
- return JScalar.A(0, x, delegate (object o) {
+ return JScalar.A<Method>(0, x, delegate (object o) {
#!./perl6
# this is close to the Dynamic programming solution from Wikipedia,
my class knapsackItem{has $.name; has $.weight;has $.unit;}
sub func (@a, $w, $v = 0){
return $v if $w == 0 || !@a;
my @rest = @a;
my $i = shift @rest;
my @skip = func(@rest,$w,$v);
#!./perl6
# this is close to the Dynamic programming solution from Wikipedia,
my class knapsackItem{has $.name; has $.weight;has $.unit;}
my $MAX_WEIGHT = 400;
my @table;
push @table, knapsackItem.new: name => 'map' , weight => 9 , unit => 150;
push @table, knapsackItem.new: name => 'compass' , weight => 13 , unit => 35;