»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:20 _thou left, _thou joined 00:21 kurahaupo_mobile joined, JumpingJackeroo joined 00:23 skids joined 00:24 rurban1 joined 00:33 simcop2387 left 00:36 simcop2387 joined 00:37 dmol left, water joined, hoverboard left, water is now known as hoverboard 00:39 fhelmberger left, Exodist joined, fhelmberger joined 00:40 slavik left, kaare_ left, slavik1 joined, kaare__ joined, FROGGS left, xenoterracide left, FROGGS joined, avuserow joined, yath joined 00:58 ilogger2 joined, ChanServ sets mode: +v ilogger2 00:59 yves_ joined, japhb_ left, BooK joined, bonsaikitten joined, japhb_ joined 01:00 awwaiid joined
JumpingJackeroo when should i use the bind operator := instead of = 01:02
shouldn't perl6 knows if a list is going to be infinite
any scenario where := is necessary 01:03
?
01:06 eternaleye joined 01:07 araujo joined 01:08 japhb_ left, japhb_ joined 01:26 colomon_ joined, lee__ joined 01:27 clsn_ joined 01:29 lee_ left, japhb_ left, awwaiid left, awwaiid joined, japhb joined, colomon_ is now known as colomon, japhb left, japhb joined 01:31 araujo left, rurban joined
TimToady JumpingJackeroo: the halting problem implies that we can't always know whether a list is infinite 01:32
01:32 araujo joined, simcop2387 joined
TimToady it knows in the obvious cases, but not all cases are obvious 01:32
JumpingJackeroo thank you 01:33
TimToady anyway, P5 programmers will expect = to be eager regardless of whether we know
r: my @foo = 1..*; # knows
camelia ( no output )
TimToady r: my @foo = 1..*; say @foo[^20]; # knows
camelia rakudo-parrot 3c80d3, rakudo-jvm 3c80d3, rakudo-moar 3c80d3: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20␤»
TimToady but as soon as you put a gather and some generating code, the halting problem arises 01:34
01:53 dayangkun joined 02:01 FROGGS_ joined
BenGoldberg I know in perl5, if I do $x = delete $h{$y}, it will remove key $y from hash %h, and will assign to $x the value that had been in $h{$y} before the deletion occured.... how do I do this in perl6? 02:04
my $x = %h{$y} :delete; ?
(doesn't seem to do the right thing)
BenGoldberg is attempting a sieve of eratosthenese, as follows: 02:05
r: my %sieve; my @primes; my $p_i = 0; my $p = 2; my $q = 4; my $n = 5; @primes := gather { take 2; take 3; OUTER: loop { while ( my $s = %sieve{$n} :delete ) { push %sieve{$n + $_}, $_ for $s; $n += 2 }; while $n < $q { take $n; $n += 2; next OUTER if %sieve{$n} :exists; }; push %sieve{$q + $p * 2}, $p * 2; $p = @primes[++$p_i]; $q = $p*$p; $n += 2; } };
camelia rakudo-jvm 3c80d3: OUTPUT«Unhandled exception: This representation can not unbox to a native str␤ in delete_key (gen/jvm/CORE.setting:8973)␤ in delete_key (gen/jvm/CORE.setting:8969)␤ in (gen/jvm/CORE.setting:1915)␤ in (gen/jvm/CORE.setting:1908)␤ in SLICE_ONE (gen/…»
..rakudo-parrot 3c80d3: OUTPUT«This type cannot unbox to a native string␤current instr.: 'delete_key' pc 370776 (src/gen/p-CORE.setting.pir:156357) (gen/parrot/CORE.setting:8993)␤called from Sub 'delete_key' pc 370699 (src/gen/p-CORE.setting.pir:156300) (gen/parrot/CORE.setting:89…»
..rakudo-moar 3c80d3: OUTPUT«Unhandled exception: This type cannot unbox to a native string␤ at src/gen/m-CORE.setting:8973 (/home/p6eval/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:delete_key:72)␤ from src/gen/m-CORE.setting:8969 (/home/p6eval/rakudo-inst-1/lang…»
BenGoldberg n: my %sieve; my @primes; my $p_i = 0; my $p = 2; my $q = 4; my $n = 5; @primes := gather { take 2; take 3; OUTER: loop { while ( my $s = %sieve{$n} :delete ) { push %sieve{$n + $_}, $_ for @$s; $n += 2 }; while $n < $q { take $n; $n += 2; next OUTER if %sieve{$n} :exists; }; push %sieve{$q + $p * 2}, $p * 2; $p = @primes[++$p_i]; $q = $p*$p; $n += 2; } }; 02:07
camelia ( no output )
BenGoldberg n: my %sieve; my @primes; my $p_i = 0; my $p = 2; my $q = 4; my $n = 5; @primes := gather { take 2; take 3; OUTER: loop { while ( my $s = %sieve{$n} :delete ) { push %sieve{$n + $_}, $_ for @$s; $n += 2 }; while $n < $q { take $n; $n += 2; next OUTER if %sieve{$n} :exists; }; push %sieve{$q + $p * 2}, $p * 2; $p = @primes[++$p_i]; $q = $p*$p; $n += 2; } }; say @primes[^5];
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Unable to resolve method push in type Any␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /tmp/pq2BxZQpL8 line 1 (ANON @ 28) ␤ at /tmp/pq2BxZQpL8 line 1 (ANON @ 9) ␤ at <unknown> line 0 (KERNEL dogather @ 1) ␤ at /home/…»
BenGoldberg Hmm... I think that the "cannot unbox" is a rakudobug. 02:26
With niecza, the following works ok: 02:27
n: my %sieve; sub addit($start is copy, $step) {$start+=$step while %sieve{$start};%sieve{$start}= $step;}; my @primes;my$p_i=1;my$n=5;my$p=3;my$q=9;@primes:=gather {take 2; take 3; loop { if ( my $s = %sieve{$n} :delete ) { addit($n + $s, $s) } elsif $n < $q { take 0+$n } else { addit($q + $p*2, $p * 2); $p = @primes[++$p_i]; $q = $p*$p; }; $n += 2 } }; say @primes[^20];
camelia niecza v24-109-g48a8de3: OUTPUT«2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71␤»
BenGoldberg But with rakudo, it dies with the "This type cannot unbox to a native string" exception.
TimToady I believe loop labels are NYI 02:34
BenGoldberg I rewrote it to not need the label. 02:37
02:37 rurban left, rurban joined
BenGoldberg Well, actually I made it more like the original python code :), but same difference. 02:37
02:39 go|dfish joined 02:41 jnap joined 02:44 timotimo joined 02:45 jnap1 joined, jnap left 02:47 klapperl joined
TimToady a workaround, when you say %sieve{$x}, say %sieve{~$x} instead 02:49
02:49 jnap1 left
TimToady it apparently can't figure out how to hash an integer 02:49
BenGoldberg Ok :) 02:50
rn: my %sieve; sub addit($start is copy, $step) {$start+=$step while %sieve{$start};%sieve{$start}= $step;}; my @primes;my$p_i=1;my$n=5;my$p=3;my$q=9;@primes:=gather {take 2; take 3; loop { if ( my $s = %sieve{~$n} :delete ) { addit($n + $s, $s) } elsif $n < $q { take 0+$n } else { addit($q + $p*2, $p * 2); $p = @primes[++$p_i]; $q = $p*$p; }; $n += 2 } }; say @primes[^100]; 02:51
camelia rakudo-parrot 3c80d3, rakudo-jvm 3c80d3, rakudo-moar 3c80d3, niecza v24-109-g48a8de3: OUTPUT«2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257…»
BenGoldberg \o/
Does anyone besides me think that an infinite lazy list of primes, with roughly constant time for each additional prime, is really cool? 02:52
02:55 alc joined 03:08 _thou joined
lue That bugfix from a while ago fixed the issue of getting panda to run at all, but the bootstrap process now gets stuck on ==> Fetching panda :( 03:11
03:13 _thou left
lue My panda is getting stuck because of that recursive .work/* problem. Using the 'absolute' branch (which seemed like a good choice) doesn't work either. 03:40
03:46 jnap joined 03:51 jnap left, _thou joined 04:07 hoverboard joined 04:35 awwaiid_ joined 04:36 __thou joined 04:37 japhb_ joined, awwaiid left, rurban left, japhb left, _thou left 04:39 rurban joined 04:42 klapperl left, go|dfish left, FROGGS_ left, simcop2387 left 04:46 go|dfish joined 04:47 FROGGS_ joined 04:48 xenoterracide joined 04:49 simcop2387 joined, rurban left 04:50 rurban joined, klapperl joined 04:56 rurban1 joined 05:01 skids joined 05:02 lee_ joined, rurban_ joined, rurban left, awwaiid joined 05:06 awwaiid_ left, clsn_ left 05:08 dayangkun left 05:11 lee__ left 05:15 skids left, rurban1 left, awwaiid left
lue Hrm. I'm trying to write a routine tracer (similar to Grammar::Tracer); I've got the various Dispatcher metamodel classes set up, but apparently I can't do the EXPORTHOW trick Grammar::Tracer does with EXPORT :/ 05:16
05:16 skids joined 05:18 awwaiid joined 05:20 rurban joined 05:25 awwaiid_ joined 05:27 awwaiid left 05:28 raydiak left, Yappo__________7 left, lue joined, tadzik joined, Yappo__________7 joined 05:29 raydiak joined 05:35 raydiak_ joined 05:48 raydiak left 05:49 jnap joined 05:53 jnap left
dalek ast: 10afb2d | larry++ | S02-lexical-conventions/unicode-whitespace.t:
MONGOLIAN VOWEL SEPARATOR moved from Zs to Cf

So don't test it for being whitespace already.
06:03
06:05 tadzik left, ingy left, ingy joined, tadzik joined 06:07 rurban left, xinming_ joined 06:12 telex joined 06:17 __thou left
dalek ecs: 43477ea | larry++ | S05-regex.pod:
bring <cntrl> in line with <:Cc>
06:24
06:30 [Sno] joined 06:31 xinming_ left
FROGGS_ .tell lue You need this: github.com/tadzik/panda/pull/69 06:34
lue heh, I was just about to leave my computer for the night too :) . I'll check it tomorrow, ♘ #perl6 o/ 06:35
TimToady m: say "\c[PILE OF POO]" 06:41
camelia rakudo-moar 3c80d3: OUTPUT«􁝫␤»
TimToady m: say "\c[PILE OF POO].ord.base(16)"
camelia rakudo-moar 3c80d3: OUTPUT«􁝫.ord.base(16)␤»
TimToady m: say "\c[PILE OF POO]".ord.base(16) 06:42
camelia rakudo-moar 3c80d3: OUTPUT«10176B␤»
TimToady not yet
FROGGS_ gnight lue 06:43
FROGGS_ is eager to run the regex spectests 06:48
06:49 jnap joined 06:53 jnap left
FROGGS_ gosh how I love that list: 06:57
Using /home/froggs/dev/nqp/install/bin/nqp-p (version 2014.02-1-g8aab212 / Parrot 6.1.0).
Using /home/froggs/dev/nqp/install/bin/nqp-j (version 2014.02-1-g8aab212 / OpenJDK 1.7.0_51).
Using /home/froggs/dev/nqp/install/bin/nqp-m (version 2014.02-1-g8aab212 / MoarVM 2014.02-5-g6653722).
06:58 berekuk joined
FROGGS_ I just miss this one: 06:59
Using /home/froggs/dev/nqp/install/bin/nqp-js (version 2014.02-1-g8aab212 / node.js 10.7.3).
dalek ast: ced837a | larry++ | S05-mass/rx.t:
MONGOLIAN VOWEL SEPARATOR moved from Zs to Cf
07:00
ast: 42a12c5 | larry++ | S05-mass/charsets.t:
º and ª moved from Ll to Lo
TimToady haven't been able to figure out where <cntrl> is defined; <:cntrl> properl aliases <:Cc>, but <cntrl> doesn't 07:01
maybe we should just delete <cntrl>
07:02 xinming joined
FROGGS_ MoarVM/UNIDATA/PropertyValueAliases.txt:561:gc ; Cc ; Control ; cntrl 07:02
moritz +1
FROGGS_ and it seems like cntrl has a property code (14) and a property value code 07:03
moritz (to removing cntrl)
FROGGS_ moritz: but it seems to be still a valid alias 07:04
TimToady m: say so "\x80" ~~ /<cntrl>/; say so "\x80" ~~ /<:cntrl>/
camelia rakudo-moar 3c80d3: OUTPUT«False␤True␤»
TimToady where's the first def coming from? 07:05
FROGGS_ m: say "\t" ~~ /<:cntrl>/
camelia rakudo-moar 3c80d3: OUTPUT«「 」␤␤»
FROGGS_ ahhh
now I read correctly about <:cntrl>/<cntrl> 07:06
TimToady: I guess it is a method in nqp somewhere
TimToady: nqp/src/QRegex/Cursor.nqp:650: method cntrl() {
TimToady haven't been able to grep it out
ah 07:07
FROGGS_ we're even using it: nqp/src/QRegex/Cursor.nqp:653: $cur."!cursor_pass"($!pos+1, 'cntrl')
07:09 Alina-malina joined 07:11 clsn joined
TimToady needs to be fixed in MoarVM/src/strings/ops.c and should probably just delegate to the Cc class 07:12
or, as I say, we should just delete the non-: form 07:13
it's not all that useful
FROGGS_ if :cntrl is way slower than we might leave <cntrl> it as an internal thing in nqp 07:15
TimToady 1) probably not even used, and 2) if we defer to Cc, it's the same speed 07:16
looks like it's only used in tests :) 07:17
nothing in rakudo-star uses it 07:18
and frankly, all those categories are just in there only because posix had [:cntrl:] or some such 07:20
FROGGS_ cool
(about checking star)
TimToady (well, except the same tests)
FROGGS_ /home/froggs/dev/ecosystem/gge/STATUS:58: <xdigit>, <space>, <cntrl>, <punct> 07:21
/home/froggs/dev/ecosystem/gge/lib/GGE/Match.pm:214: method cntrl() { self.cclass: /<cntrl>/ }
/home/froggs/dev/ecosystem/gge/t/perl6regex/rx_subrules:43:<cntrl>\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij/mob<cntrl>: <\t @ 0>/<cntrl>
whatever gge is, it uses it
TimToady m: say "\c[PILE OF POO]".ord.base(16) 07:23
camelia rakudo-moar 3c80d3: OUTPUT«10176B␤»
TimToady nope
FROGGS_ perl6-m -e 'say "\c[PILE OF POO]".ord.base(16)'
1F4A9
my box is happy :o)
(very happy)
because this fixes like about 50 spectests? 07:24
TimToady I didn't count
FROGGS_ TimToady: ahh, we need to bump moar and nqp revision
camelia does not build head
07:25 darutoko joined
TimToady how...conservative... 07:25
FROGGS_ that is from [Coke]++'s roast log: S05-mass/named-chars.rakudo.moar................... 284 53 0 94 431 07:27
and now it passes on my boc 07:28
box*
07:28 Yappo__________7 left
FROGGS_ TimToady++ # so there are already 53 more passing tests :o) 07:28
TimToady: are you going to bump revision or shall I? 07:29
dalek ecs: bf45e2f | larry++ | S05-regex.pod:
recommend <:alpha> for no underscore
TimToady you may do it 07:30
moritz FROGGS_: if it's a valid Unicode alias, it should be available as <:cntrl>; no need to make it available as <cntrl>
TimToady that's what we were discussing above 07:31
FROGGS_ moritz: yes, I've understand it in between :o)
moritz ok -)
TimToady except if peopel expect all the posixy [:foo:] things to turn into <foo>
dalek p: 5796e43 | (Tobias Leich)++ | tools/build/MOAR_REVISION:
bump moar rev to get unicode fixes, TimToady++
moritz TimToady: then we need to teach them to look for <:foo> instead; shouldn't be too hard, the posixy thing contains colons too, after all :-) 07:32
dalek kudo/nom: 1726c7d | (Tobias Leich)++ | tools/build/NQP_REVISION:
bump nqp (moar) rev to get unicode fixes, TimToady++
FROGGS_ now we have to wait an hour :o)
TimToady or two
07:39 hoverboard left 07:46 xinming_ joined 07:49 xinming left, jnap joined 07:54 jnap left 07:55 kaleem joined 07:56 bjz joined
FROGGS_ masak: I PR'd you :o) 08:00
TimToady: that said PR removes the only usage of <cntrl> in the ecosystem 08:01
commute &
08:01 FROGGS_ left 08:03 dmol joined
moritz I was just wondering why rakudo rebuild on camelia's server was so slow 08:08
turns out there was a JVM process from camelia using 100% CPU 08:09
m: say "\c[PILE OF POO]".ord.base(16) 08:14
camelia rakudo-moar 3c80d3: OUTPUT«10176B␤»
nwc10 rn: say "\c[PILE OF POO]".ord.base(16) 08:26
because I'm curious 08:27
camelia rakudo-jvm 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unrecognized character name PILE OF POO␤at /tmp/tmpfile:1␤------> say "\c[PILE OF POO⏏]".ord.base(16)␤»
..rakudo-parrot 1726c7, rakudo-moar 1726c7, niecza v24-109-g48a8de3: OUTPUT«1F4A9␤»
08:27 sqirrel joined 08:29 virtualsue joined, virtualsue left 08:30 kaleem left 08:33 FROGGS joined 08:37 pdcawley joined 08:41 zakharyas joined 08:46 xinming joined 08:49 xinming_ left 08:50 jnap joined, alc left 08:54 jnap left 08:56 berekuk left
timotimo o/ 09:01
FROGGS o/ 09:03
09:09 denisboyun joined 09:14 pdcawley left 09:18 pdcawley joined 09:23 xinming_ joined 09:27 xinming left 09:28 Yappo__________7 joined 09:47 pdcawley left 09:49 pdcawley joined 09:51 jnap joined 09:55 jnap left
nwc10 [Coke]: oh woe, no automated spectest runs. So we won't know how much closer to JVM ++TimToady's commit got us 10:01
10:01 pdcawley_ joined 10:03 pdcawley left
nwc10 I hope you're able to find a new home for that soon. 10:05
I have none to offer 10:06
10:13 Ven joined 10:16 sqirrel left
Ven r: class A { has $.a; submethod init($.a) { } }; my A $a .= new; say $a.perl; $a.init(5); say $a.perl; 10:25
camelia rakudo-parrot 1726c7, rakudo-moar 1726c7: OUTPUT«A.new(a => Any)␤Cannot assign to a readonly variable or a value␤ in submethod init at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-jvm 1726c7: OUTPUT«A.new(a => Any)␤java.lang.RuntimeException: $.x parameters NYI␤ in submethod init at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
Ven oh, omly the :$ with (a =>) form is implemented I guess 10:26
10:29 yoleaux joined, ChanServ sets mode: +v yoleaux
Ven `is`, `will` and kinda `but` 10:38
10:41 mavcunha joined 10:43 kaleem joined 10:52 jnap joined 10:56 jnap left 11:04 Sqirrel joined 11:24 rindolf joined
dalek nda: b89cd24 | (Donald Hunter)++ | lib/Panda/Fetcher.pm:
Use eager for loop to resolve recursing into .work directory.
11:26
nda: d6f8a3a | tadzik++ | lib/Panda/Fetcher.pm:
Merge pull request #69 from donaldh/eager-for

Use eager for loop to resolve recursing into .work directory.
Ven r: sub f(:(::T $ where Int | Bool --> T) $x) { ($x(3), $x(True)) } 11:39
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Missing block␤at /tmp/tmpfile:1␤------> sub f(:(::T $ where Int | Bool --> T) ⏏$x) { ($x(3), $x(True)) }␤ expecting a…»
dalek nda/moar-support: 934a4f3 | tadzik++ | ext/File__Find:
Update File::Find
11:40
panda/moar-support: 1b8e421 | tadzik++ | ext/File__Find:
panda/moar-support: Update File::Find
11:40 dalek left
tadzik I killed it 11:40
but, moar-support is merged, panda is now workings :)
11:40 dalek joined, ChanServ sets mode: +v dalek
Ven r: sub f(:(::T $ where Int | Bool --> T) $x) { return ($x(3), $x(True)) } 11:41
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Missing block␤at /tmp/tmpfile:1␤------> sub f(:(::T $ where Int | Bool --> T) ⏏$x) { return ($x(3), $x(True)) }␤ expe…»
Ven err 11:43
11:43 Guest26732 joined
Ven not sure about that one 11:47
r: sub f(&x:(::T $ where Int | Bool --> T)) { return (x(3), x(True)) } 11:50
camelia rakudo-jvm 1726c7: OUTPUT«===SORRY!===␤Can not invoke this object␤»
..rakudo-moar 1726c7: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
..rakudo-parrot 1726c7: OUTPUT«===SORRY!===␤invoke() not implemented in class 'QAST::WVal'␤»
11:53 jnap joined 11:57 jnap left
timotimo Ven: the problem with your init method is that you were trying to set a value to $.a, which isn't defined as "is rw" 12:00
if you want to set a value for $.a you need to access it via the attribute storage, not via the accessor 12:01
so you want to have method init($!a) { } rather than init($.a} { }
Ven timotimo: ah, I was trying that code from S06 12:06
any idea for my second code ?
(but I don't get why I need to use $!a for $.a :o) 12:08
r: class A { has $.a; submethod init($!a) { } }; my A $a .= new; say $a.perl; $a.init(5); say $a.perl; 12:09
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«A.new(a => Any)␤A.new(a => 5)␤»
Ven Well~ timotimo++ 12:10
r: class A { has $.a is rw; submethod init($.a) { } }; my A $a .= new; say $a.perl; $a.init(5); say $a.perl; 12:14
camelia rakudo-jvm 1726c7: OUTPUT«A.new(a => Any)␤java.lang.RuntimeException: $.x parameters NYI␤ in submethod init at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-parrot 1726c7, rakudo-moar 1726c7: OUTPUT«A.new(a => Any)␤A.new(a => 5)␤»
Ven alright.
FROGGS tadzik++
tadzik FROGGS++ 12:40
12:41 bluescreen10 joined
tadzik for some reason panda can't connect to feather though 12:41
Could not download module metadata: Failed to connect: host is unreachable
12:43 xenoterracide left
dalek nda: 026cd23 | (Tobias Leich)++ | / (7 files):
use absolute paths where possible
12:43
nda: d37c017 | tadzik++ | / (7 files):
Merge pull request #71 from tadzik/absolute

use absolute paths where possible [based on moar-support branch]
colomon tadzik: I don't seem to be having difficulty here?
tadzik moar commits
colomon: must be something with my conneciton then :/
12:43 mtk joined
colomon though ABC build just failed. or… ==> Installing ABC from a local directory 'ABC' ? 12:44
None of the parametric role variants for 'ABC::Pitched' matched the arguments supplied. 12:45
colomon now wonders if the Parrot version will work. He's already got a full module smoke test on Parrot underway…
12:53 jnap joined 12:58 jnap left
colomon huh 12:59
If I just run straight from the ABC .pm files, all tests pass.
It's compiling ABC::BrokenRhythm that triggers the None of the parametric role variants for 'ABC::Pitched' matched the arguments supplied messae 13:00
Ven can you do something like c++ template specialization ?
ie `multi class a [::T] {}; class a [Int]` or something 13:01
13:03 spider-mario joined, skids left 13:04 kaleem left 13:05 kaleem joined 13:16 kbaker_ joined 13:22 denisboyun left 13:25 denisboyun joined
TimToady roles dispatch like multis, if that's what you're asking 13:29
13:31 FROGGS left
TimToady role a[::T] { method foo() { say "::T" } }; role a[Int] { method foo() { say "Int" }}; class aInt does a[Int] {}; class aT does a[Str] []; say aInt.new.foo; say aT.new.foo 13:33
r: role a[::T] { method foo() { say "::T" } }; role a[Int] { method foo() { say "Int" }}; class aInt does a[Int] {}; class aT does a[Str] []; say aInt.new.foo; say aT.new.foo
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse class definition␤at /tmp/tmpfile:1␤------> nt does a[Int] {}; class aT does a[Str] ⏏[]; say aInt.new.foo; say …»
TimToady r: role a[::T] { method foo() { say "::T" } }; role a[Int] { method foo() { say "Int" }}; class aInt does a[Int] {}; class aT does a[Str] {}; say aInt.new.foo; say aT.new.foo
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«Int␤True␤::T␤True␤»
TimToady like that? 13:34
Ven: ^^
Ven TimToady: something like that :-) 13:35
I actually realize what I'd want needs type inference
TimToady we don't quite do that yet 13:36
Ven TimToady: Hindley-Milner for Perl 7, ha ! 13:37
r: role Semigroup[::T]; role Monoid[::T] is Semigroup[T] {}; role Functor[::T]; role Applicative[::T] is Functor[T]; role Monoid[::T] is Monoid[T] is Application[T] {} 13:41
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!===␤Cannot type check against type variable T␤»
Ven something like that I guess
TimToady r: role Semigroup[::T]; role Monoid[::T] does Semigroup[T] {}; role Functor[::T]; role Applicative[::T] does Functor[T]; role Monoid[::T] does Monoid[T] does Application[T] {} 13:43
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Too late for semicolon form of role definition␤at /tmp/tmpfile:1␤------> oes Semigroup[T] {}; role Functor[::T]; ⏏role Applica…»
Ven I guess it was bound to be does
I just wondered whether between role and role it'd be inheritance
TimToady r: role Semigroup[::T] {}; role Monoid[::T] does Semigroup[T] {}; role Functor[::T] {}; role Applicative[::T] does Functor[T] {}; role Monoid[::T] does Monoid[T] does Application[T] {}
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse role definition␤at /tmp/tmpfile:1␤------> }; role Monoid[::T] does Monoid[T] does ⏏Application[T] {}␤ …» 13:44
Ven mmh ?
TimToady r: role Semigroup[::T] {}; role Monoid[::T] does Semigroup[T] {}; role Functor[::T] {}; role Applicative[::T] does Functor[T] {}; role Monoid[::T] does Monoid[T] does Applicative[T] {} 13:45
camelia rakudo-moar 1726c7: OUTPUT«Unhandled exception: Could not instantiate role 'Monoid':␤Not enough positional parameters passed; got 1 but expected 2␤ at <unknown>:1 (/home/p6eval/rakudo-inst-1/languages/nqp/lib/Perl6/Metamodel.moarvm:specialize:4294967295)␤ from src/gen/m-Met…» 13:46
..rakudo-jvm 1726c7: OUTPUT«Unhandled exception: Could not instantiate role 'Monoid':␤Not enough positional parameters passed; got 1 but expected 2␤ in specialize (gen/jvm/Metamodel.nqp:2025)␤ in (gen/jvm/Metamodel.nqp:2465)␤ in (gen/jvm/Metamodel.nqp:2461)␤ in compose…»
..rakudo-parrot 1726c7: OUTPUT«Could not instantiate role 'Monoid':␤Not enough positional parameters passed; got 1 but expected 2␤current instr.: 'specialize' pc 22132 (src/gen/perl6-metamodel.pir:10426) (gen/parrot/Metamodel.nqp:2102)␤called from Sub '' pc 27863 (src/gen/perl6-…»
Ven role Monoid[::T] does Monoid[T]
r: role Semigroup[::T] {}; role Monoid[::T] does Semigroup[T] {}; role Functor[::T] {}; role Applicative[::T] does Functor[T] {}; role Monad[::T] does Monoid[T] does Applicative[T] {} 13:47
camelia rakudo-parrot 1726c7: OUTPUT«Could not instantiate role 'Monad':␤Not enough positional parameters passed; got 1 but expected 2␤current instr.: 'specialize' pc 22132 (src/gen/perl6-metamodel.pir:10426) (gen/parrot/Metamodel.nqp:2102)␤called from Sub '' pc 27863 (src/gen/perl6-m…»
..rakudo-jvm 1726c7: OUTPUT«Unhandled exception: Could not instantiate role 'Monad':␤Not enough positional parameters passed; got 1 but expected 2␤ in specialize (gen/jvm/Metamodel.nqp:2025)␤ in (gen/jvm/Metamodel.nqp:2465)␤ in (gen/jvm/Metamodel.nqp:2461)␤ in compose …»
..rakudo-moar 1726c7: OUTPUT«Unhandled exception: Could not instantiate role 'Monad':␤Not enough positional parameters passed; got 1 but expected 2␤ at <unknown>:1 (/home/p6eval/rakudo-inst-1/languages/nqp/lib/Perl6/Metamodel.moarvm:specialize:4294967295)␤ from src/gen/m-Meta…»
TimToady well, looks like it's close to doing what you want
Ven type-inference is what I want, but replicating the typeclassopedia in p6 would be a nice start :) 13:48
maybe by 2025, perl 6.5 will have type inference, eh :[
s/'['/')'/ 13:49
TimToady we'd have to find some smart people who can figure out how to do it without requiring the user to be just as smart as they are :)
13:50 FROGGS joined
Ven TimToady: I think HM works nicely in Haskell 13:50
I love static type check, so that probably doesn't fit a scripting language -- which is fine
TimToady well, Haskell is definitely aimed at a different target audience than Perl 6 13:51
daxim bartoszmilewski.com/2014/02/26/c17-...ur-future/ # compare the syntax here with jnthn's talk series about futures
TimToady The only question is how much of the Promethian Fire we can put into the Procrustean Bed. 13:52
Ven TimToady: I do believe that's a task perl 6 is trying to tackle, though ? Mixing what probably shouldn't be mixed ;) 13:53
TimToady *Promethean
indeed, we're too stupid to know it's impossible :)
13:53 stevan_ joined
Ven "They didn't know it was impossible, so they did it", eh ? I guess I just like breed mixing :) 13:54
13:54 jnap joined
TimToady one can call it either "bastardization" or "hybrid vigor" :) 13:55
Ven If I liked stuff to be "pure" or something called like that I'd probably do lisp all day
(not "pure" in the functional sense. Else I'd do Agda or something)
TimToady well, the purity of lisp is a bit overstated at times
13:56 kbaker_ left
TimToady but yeah, lisp definitely uses its circularity saw at a very low level 13:57
Ven oh, it definitely is. I guess I can't really say I only do cool-looking stuff though, because "^^[]{}@@=>->|..=><[]>+~>%"#@".>>.&*$~_?\\`°" is a valid expression in a language I'm working on :P
(it's a no-op though ...) 13:58
TimToady looks a bit like Teco :)
13:58 jnap left
TimToady which, one recalls, the first emacs was built upon, which says...something... 13:59
Ven TimToady: Hahahhaa ! The whole language doesn't look like that, though. I guess you can show a really crazy perl example and scare people off, when really ...
[Coke] m: "^^[]{}@@=>->|..=><[]>+~>%"#@".>>.&*$~_?\\`°"
camelia ( no output )
[Coke] (it's valid here, too. :P) 14:00
Ven oh wow :D
[Coke]++
TimToady he cheated
geekosaur note the string quotes :p
Ven oh yeah
[Coke] what, I pasted his code verbatim. :)
Ven well
there's #@ inbetween though
[Coke] I thought -he- was cheating.
Ven [Coke]: livescript.net, I'll let you try it :p 14:01
(as I said, it's a no-op, `->` is a function, and it's never called
14:01 jnap joined
TimToady curious now 14:02
m: ^^[]{}@@=>->|..=><[]>+~>%"#@".>>.&*$~_?\\`°
camelia rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/hRiuIeQw1F␤Two terms in a row␤at /tmp/hRiuIeQw1F:1␤------> ^^[]{}⏏@@=>->|..=><[]>+~>%"#@".>>.&*$~_?\\`°␤ expecting any of:␤ postfix␤ subscript␤ …»
Ven Could you add methods to the grammar to make it work,though :)?
I guess you can
TimToady every other langauge is just a dialect of Perl 6
including Perl 7 :)
Ven oh, I guess that goes for everything. I once met a guy saying lisp's reader macros where available in every language, and pasted a C example to modify the source code as an argument :) 14:03
but Perl 7 will be too godly for Perl 6 :p. 14:04
or I guess "holy" should be the word here, I can't english !
TimToady well,just think of it as a form of 'use strict;'
Ven I'd love a use stricttypes; with a more static type checking 14:05
(gradual typing is cool and all, though)
TimToady that's the big bet 14:06
Ven (so long you're not dart and you're not typechecking anything ..)
14:06 ajr joined
TimToady gotta keep people honest occasionally 14:06
Ven TimToady: are type annotations more of a burden (perf-wise) right now ?
TimToady depends 14:07
14:07 ajr is now known as Guest21395
TimToady on assignment, yes 14:07
on multi signatures, no
Ven something like int VS something like subset Duck of Mu where *.^can('quack')
TimToady since you'd have to be writing switches or doing dispatch anyway
Ven and on simple signatures ? 14:08
TimToady sure, constraints quickly run into halting problems if you try to be analytical
Ven mmh ?
TimToady you generally have to run the constraint to figure out whether it's true or not 14:09
Ven yes, but on the error hand, it leaves room for optimization
TimToady and your duck example is potentially optimizable
Ven with `sub (Dog $d) { $d.barf; }` you know which method to call (almost)
(because it allows for Dog subtyping IIRC) 14:10
TimToady probably more so than 'subset Even of Int where * %% 2;'
Ven that shouldn't allow much optimizations though
I don't know of many methods that take longers on Odds 14:11
TimToady well, you can prove it's true right after a left shift :)
Ven TimToady: yes ! but it's still overhead compared to "Int"
whereas knowing statically $d will always be a Dog object makes it easier to generate more efficient code 14:12
TimToady sure, which is why we call it "nominal typing"
Ven I've seen atrocious perf hits in some languages because the JIT had to back off a method (suddenly, a single call with a Duck after 10k calls with a Dog)
TimToady: well, ^.can allows for kinda-structural typing, which is nice 14:13
TimToady imagines a constraint that is enforced randomly, so you eventually catch the error, but not at the expense of much runtime, course that doesn't help with constraint-based dispatch
Ven (static analysis ?)
TimToady which is why I said your example was somewhat optimizable
14:13 xragnar_ joined, xragnar_ is now known as xragnar
Ven TimToady: In a few years, maybe 14:16
or if moar gets a JIT with GSoC
14:17 bluescreen10 left
TimToady one imagines a CanQuack role that automatically composes itself into anything that can quack 14:18
presuming that can be determined without an instance 14:19
Ven TimToady: that's structural typing
can you do that yet ?
TimToady not the automatic part
it's kind of an AOPish thing
needs something like a global COMPOSE phaser 14:20
Ven r: say &infix:<@#> 14:21
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared name:␤ &infix:<@#> used at line 1␤␤»
Ven No way this operator doesn't exist
TimToady whazzit do?
Ven No idea, that's just from earlier, when trying to compiling my snippet. it was like `r: "lots of stuff"#@"other stuff"` and I wondered how it worked 14:22
when [Coke] cheated
TimToady I see a #@ 14:23
Ven True that, I messed the order :). Whazzit do? 14:24
TimToady r: say 42 #@ "eels";
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«42␤»
Ven OH
hahahaha
++<<[ TimToady, [Coke] ] 14:25
TimToady it's more of an infix macro, which has the unfortunate ability to eat your semicolons
along with your right argument :) 14:26
because it takes the entire rest of your line as the right argument 14:27
Ven don't push it :p 14:28
TimToady ;)
14:34 stevan_ left
FROGGS TimToady: have you seen this? github.com/rakudo/rakudo/commit/3c80d3ae0e 14:34
I wonder what is needed to do to fix this issue... 14:35
r: my @j; my int $j = 42; @j.push($j); say @j # RT #121349
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=121349
camelia rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«42␤»
..rakudo-parrot 1726c7: OUTPUT«Cannot assign a non-Perl 6 value to a Perl 6 container␤ in method REIFY at gen/parrot/CORE.setting:8407␤ in method reify at gen/parrot/CORE.setting:7279␤ in method gimme at gen/parrot/CORE.setting:7724␤ in method push at gen/parrot/CORE.setti…»
14:38 skids joined 14:42 benabik joined
TimToady p: my @j; my int $j = 42; @j.push(+$j); say @j # RT #121349 14:43
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=121349 14:44
camelia rakudo-parrot 1726c7: OUTPUT«42␤»
TimToady fixed it fer ya :P
FROGGS :P
I have no positive feeling about that^^ 14:45
colomon ADT and Sum modules started failing sometime in the last week (Parrot) 14:47
timotimo: ^
FROGGS when was you last test?
TimToady Sum could be related to X or Z changes 14:48
or [Z+]
or the [] as a list bug
FROGGS ADT also: github.com/timo/ADT/blob/master/lib/ADT.pm6#L30 14:49
TimToady that looks like it should work, unless >> is returning a [] rather than a () 14:51
say <1 2 3>».Str.WHAT
FROGGS p: say (<a b c>>>.Str).perl
camelia rakudo-parrot 1726c7: OUTPUT«("a", "b", "c")␤»
TimToady r: say <1 2 3>».Str.WHAT 14:52
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«(Parcel)␤»
TimToady r: say <1 2 3>».Str.VAR.WHAT
FROGGS there is a Z=> also: github.com/timo/ADT/blob/master/li...T.pm6#L140
camelia rakudo-parrot 1726c7, rakudo-jvm 1726c7, rakudo-moar 1726c7: OUTPUT«(Parcel)␤»
FROGGS but Z=> should work too, at least it does for panda
14:53 btyler joined
colomon FROGGS: my last smoke run prior was the 23rd 14:55
TimToady well, but it's autoviving an Array, so maybe it needs a .list
14:55 molaf joined 14:56 rurban joined
FROGGS colomon: and the latest run? because I think we fixed something yesterday 14:56
TimToady Z=> is fine, but not if you expect [] to flatten
colomon FROGGS: latest run was this morning.
masak why would you expect [] to flatten?