»ö« 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:10 vendethiel left
raydiak oh right 00:12
tony-o: you might have more luck if you make it an "our" method
m: class Foo { our method foo ($foo) {say $foo} }; my $f = &Foo::foo; $f(Foo,123);
camelia rakudo-moar 91d899: OUTPUT«123␤»
00:15 vendethiel joined
TimToady an "our" method is not really a method, it's just a subroutine in disguise 00:24
the problem with m:g and smartmatch is that m:g does not yet return a fake Match object 00:27
m: say (m:g/\w/.WHAT given "abcde")
camelia rakudo-moar 91d899: OUTPUT«(List)␤»
TimToady m: say (m:g/\w/ given "abcde")
camelia rakudo-moar 91d899: OUTPUT«「a」␤ 「b」␤ 「c」␤ 「d」␤ 「e」␤␤»
TimToady so use given for now, instead of ~~
smls: ^^ 00:28
tony-o guess i'm changing this to a module then :-) 00:33
TimToady if you really want a method, you'd can as the MOP for the method reference using .can
but it won't be stored in a package
unlike in Perl 5 00:34
tony-o i'm trying to pass an instance method as a reference
TimToady with or without its invocant?
tony-o with
TimToady the only way to do that is with $code.assuming($obj), where $code is what you get back from the MOP 00:35
but it probably means you just want to be using functions instead 00:36
well, okay, you can also just return a closure instead of using assuming 00:37
-> |args { $obj.method(|args) } or so
in that case the method lookup would be late bound 00:38
unlike looking up $code = $obj.can("method")[0], which is earlier bound 00:39
tony-o m: class c { method g() {'g'.say;} }; sub r($call) {'r'.say;$call();'/r'.say;}; r(c.new.can('g')[0]); 00:44
camelia rakudo-moar 91d899: OUTPUT«r␤Too few positionals passed; expected 1 argument but got 0␤ in method g at /tmp/8sYbjHE0lJ:1␤ in sub r at /tmp/8sYbjHE0lJ:1␤ in block <unit> at /tmp/8sYbjHE0lJ:1␤␤»
tony-o m: class c { method g() {'g'.say;} }; sub r($call) {'r'.say;$call();'/r'.say;}; my $c = c.new; r($c.^can('g')[0]);
camelia rakudo-moar 91d899: OUTPUT«r␤Too few positionals passed; expected 1 argument but got 0␤ in method g at /tmp/aB9zymykGC:1␤ in sub r at /tmp/aB9zymykGC:1␤ in block <unit> at /tmp/aB9zymykGC:1␤␤»
00:45 dayangkun joined
tony-o m: class c { method g() {'g'.say;} }; sub r($call) {'r'.say;$call();'/r'.say;}; my $c = c.new; r(-> |args { $c.g(|args); }); 00:47
camelia rakudo-moar 91d899: OUTPUT«r␤g␤/r␤»
tony-o closure is probably easiest 00:48
00:48 smls left
tony-o thanks TimToady 00:48
00:48 Spot_ left 00:49 Spot__ joined 00:50 clkao left, ipa_blah joined, ggherdov left
Timbus m: class c { method g() {'g'.say;} }; sub r($call) {'r'.say;$call();'/r'.say;}; my $c = c.new; r(c.new.can('g')[0].assuming($c)); 00:51
camelia rakudo-moar 91d899: OUTPUT«r␤g␤/r␤»
Timbus yeah. blocks are definitely the best way to pass 'lazy code' around. would macros be able to fix that 00:53
or course they could 00:54
of*
00:55 ggherdov joined 00:58 pmurias left 00:59 stapler joined, dayangkun left
stapler hi! 00:59
00:59 vendethiel left
Timbus helo 01:01
TimToady tony-o: to do it the .can way, you also have to provide teh invocant with .assuming
01:06 vendethiel joined 01:12 ssqq joined
tony-o interesting 01:14
similar to the .apply in js
but more secure 01:15
japhb I haven't been able to update my r-j build today (first time in ~a month), because it crashes attempting to install bootstrap panda. Is this known? 01:25
Also, is it expected that pl6anet.org is unstyled? 01:27
01:28 stapler left 01:29 stapler joined 01:32 ash___ joined
ash___ Hi guys 01:32
Can you explain the loop/winner construction for working with channels?
Namely, I am not sure about how this works: 01:33
$ch = Supplier.for(1..10).Channel;
01:33 bjz left 01:34 ssqq left
ash___ loop { winner $ch { more $ch -> $x {say "x=$x"} more $ch -> $y {say "y=$y"} done {...}}} 01:34
here, the two more keywords, do they state any kind of parallelism>
?
ugexe japhb: if its the thread exception error im thinking of, then just keep trying 01:41
01:49 vendethiel left
dalek osystem: 6a13a31 | tony-o++ | META.list:
Simple "REST"ful style router for http-async
01:51
01:52 vendethiel joined
timotimo ash___: i don't think supplying the same argument to more twice makes sense 01:54
winner is about race-free-ly matching one of many channels/promises to give a result/value or finish 01:55
also, i think winner has been re-named to earliest recently?
perlcabal.org/syn/S17.html#Channels - maybe this explanation helps? 01:56
well, "specification" really
japhb ugexe: Ewww. >.< 01:57
timotimo japhb: yeah, pl6anet.org was supposed to be a very short-term stop-gap solution 01:58
japhb timotimo: Ah, I see.
BenGoldberg Is there a more concise way to do the following? 02:01
m: my @a = (^6).pick(*); my $p = Promise.new; for ^4 { my @b = @a; start { repeat { @b .= pick(*) } until [<=] @b; $p.keep(@b) } }; say await $p;
camelia rakudo-moar 91d899: OUTPUT«0 1 2 3 4 5␤»
BenGoldberg Keeping it as a concurent bogosort, of course ;)
timotimo BenGoldberg: can you try to turn the @b + @b .= pick(*) ... [<=] @b into a sequence? 02:02
(because fsck memory usage, am i rite)
tony-o i had to look up bogosort to figure out why you'd do something that way
timotimo :D 02:03
tony-o that should be a module..lol
02:04 dayangkun joined
BenGoldberg m: my @s := [(^5).pick(*)], [$_.pick(*)] ... [<=] @$_; say @s[0]; say @s[1]; 02:06
camelia rakudo-moar 91d899: OUTPUT«2 0 1 3 4␤Nil␤»
02:07 ipa_blah is now known as clkao
timotimo m: my @s := [(^5).pick(*)], [(@$_).pick(*)] ... [<=] @$_; say @s[0]; say @s[1]; 02:11
camelia rakudo-moar 91d899: OUTPUT«1 2 4 0 3␤Nil␤»
timotimo m: my @s := [(^5).pick(*)], [(@$_).pick(*)] ... { [<=] @$^a }; say @s[0]; say @s[1]; 02:12
camelia rakudo-moar 91d899: OUTPUT«3 0 2 4 1␤␤»
timotimo i wonder if it flattens the individual arrays before applying the endpoint check
m: my @s := [(^5).pick(*)], [(@$_).pick(*)] ... { say "checking $^a.perl()" }; say @s[0]; say @s[1]; 02:13
camelia rakudo-moar 91d899: OUTPUT«checking [4, 1, 3, 0, 2]␤4 1 3 0 2␤Nil␤»
timotimo m: say [<=] @$_ given [4, 1, 3, 0, 2]
camelia rakudo-moar 91d899: OUTPUT«False␤»
timotimo oh, wait 02:14
we'd have to reverse that, no?
hm, no, we wouldn't
ah 02:15
it probably doesn't build the code properly 02:16
m: my @s := [(^5).pick(*)], { [(@$^a).pick(*)] } ... { [<=] @$^a }; say @s[0]; say @s[1];
camelia rakudo-moar 91d899: OUTPUT«0 1 4 3 2␤3 2 1 0 4␤»
timotimo m: my @s := [(^5).pick(*)], { [(@$^a).pick(*)] } ... { [<=] @$^a }; say @s[0]; say @s[*-1]
camelia rakudo-moar 91d899: OUTPUT«2 3 4 0 1␤0 1 2 3 4␤» 02:17
japhb m: my @a = ^6.pick(*); my $p = Promise.new; for ^4 {start {$p.keep((@:=$@a, *.pick(*) ... {[<=] $^a})[*-1])}}; say await $p;
camelia rakudo-moar 91d899: OUTPUT«0 1 2 3 4 5␤␤eption in code scheduled on thread 139789340813056»
japhb ^^ Either produces the right answer in parallel, or a thread exception, or both. In the above case, both. :-(
tony-o is the thread-exception thing a known issue with moar? 02:18
i've been getting it a lot ..
now that i'm no longer working in serials
japhb I dunno. It really shouldn't be, but something is clearly wrong.
timotimo well, jnthn has said often enough that the parallel stuff hasn't had enough time to harden yet 02:19
tony-o what happened to diakopter and moar?
japhb diakopter is deep in no-free-hacking-'time land
tony-o is moar still being developed? 02:20
japhb tony-o: Oh definitely. jnthn is the founder and still active (just not today). There are a number of other contributors as well. 02:21
tony-o ahh, i thought diakopter started that project, he recruited me into the 5 lines i commited to it :p 02:22
japhb I believe he was #2 or #3.
02:24 jimmy_ joined 02:26 dayangkun left
[Coke] japhb: that prints out 0 1 2 3 4 5 locally. 02:26
This is perl6 version 2014.11-46-g62c092f built on MoarVM version 2014.11-59-g25a4405 ( OS X) 02:27
doing a fresh rebuild to check...
japhb [Coke]: If you re-run it a few times, do you always get the same (correct) result? 02:35
02:36 vendethiel left
[Coke] japhb: fresh build, same thing. 02:40
while [ 1 ] ; do perl6 foo.p6 ; done # gets me a page full of the same results. 02:41
ProductName:Mac OS X
ProductVersion:10.9.5
IWBNI panda said "please wait, panda-ing" during a rebootstrap instead of vanishing. 02:43
[Coke] is bummed that X 1..13 doesn't work anymore. 02:44
timotimo tony-o: i'm among the people who work on moar, though my contributions are very rarely features, mostly little tweaks and attempts to improve performance 02:59
japhb [Coke]: No, I meant, just rerun it over and over (up-arrow, enter :-) 03:03
[Coke] japhb: ... my way is more efficient. no, same result. :P
japhb [Coke]: Oh, sorry, didn't see the line where you while-1'ed.
In any case, I guess I should be happy it's rock solid on *some* OS. Clearly not on whatever camelia is running on at the moment, 03:04
s:2nd/,/./ 03:05
[Coke] wierd that it's OS X, though. :)
03:05 KCL_ joined
japhb is working his way through reading the source for all concurrency classes in Rakudo to get a handle on how to start testing the underlying nqp::ops. 03:07
03:07 Mso150 joined
[Coke] commits some stuff to github.com/coke/poker, which he hasn't done in ages. whee. 03:10
03:22 noganex joined 03:26 noganex_ left 03:34 onebitboy joined 03:50 dayangkun joined, dayangkun left 03:51 erkan joined, erkan left, erkan joined, Mso150 left
stapler you guys seem alive an kicking for the most part 03:56
03:58 immortal joined, immortal left, immortal joined 04:00 erkan left 04:04 erkan joined 04:05 stapler left 04:06 immortal left 04:21 sorear left 04:24 sorear joined 04:36 adu joined 05:01 mr-fooba_ left 05:02 BenGoldberg left 05:04 araujo left 05:11 kaare_ joined 05:22 Possum left 05:24 araujo joined 05:34 onebitboy left 05:35 onebitboy joined 05:36 jimmy_ left 05:38 onebitboy left 05:39 onebitboy joined 05:43 onebitboy left 05:44 onebitboy joined 06:02 telex left 06:04 telex joined 06:06 [Sno] left 06:14 dayangkun joined 06:27 jimmy_ joined, dayangkun left 06:42 kaleem joined 06:44 Possum joined 06:50 rindolf joined 06:54 araujo left 06:55 Possum left 06:57 Possum joined
TimToady was livelier before the sun wandered out over the Pacific... 07:00
07:00 anaeem1 joined
TimToady we need some minions in Hawaii :) 07:00
07:00 anaeem1 left 07:01 anaeem1_ joined 07:04 V_S_C joined 07:08 [Sno] joined
lizmat the minions in Perl just woke up 07:11
woolfy I see Perl houses 07:12
lizmat (the other Perl people are still asleep, apparently :-) 07:13
07:16 sqirrel_ joined 07:21 Possum left, FROGGS joined 07:26 rindolf left 07:30 V_S_C left, oetiker_ is now known as oetiker 07:31 oetiker left, oetiker joined 07:33 chenryn joined 07:46 zakharyas joined 07:52 sqirrel_ left 07:57 adu left 07:59 Isp-sec joined 08:00 Possum joined 08:03 ribasushi left 08:06 ribasushi joined 08:07 virtualsue joined 08:11 cibs left, cibs joined, zakharyas1 joined 08:13 zakharyas left 08:18 darutoko joined 08:25 krunen joined 08:30 araujo joined 08:35 kurahaupo left 08:36 sqirrel_ joined 08:39 onebitboy left 08:42 onebitboy joined 08:46 KCL joined
sergot morning o/ 08:48
TimToady \o
08:49 immortal joined, vendethiel joined, KCL_ left 08:51 erkan left 08:54 Mso150 joined 08:58 mathw_ is now known as mathw
dalek kudo/newio: 6e8aaa2 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Fix some spurt() related spectest glitches
08:58
mathw o/
09:00 molaf_ joined 09:02 molaf left 09:12 vendethiel left 09:14 dddddd joined, ssqq joined 09:15 mvuets joined
dalek p: 6bde551 | TimToady++ | src/ (4 files):
reduce NFAs 40% by removing 2/3 of epsilons

Edges that point to simple epsilon states can instead point to whatever the epsilon points to (transitively). Identical fates can be similarly merged. Once the useless states are delinked, we resequence the states and associated edges, removing any states that no longer have any reference, and remapping the state pointers.
Also fixed a bug in quant that can produce states with no edges when quant is called with a 'to' of -1.
Also installed a whole lot of debugging code to figure all this out.
Also added tests for epsilons pointing to 0 on parrot and jvm (moar already has this check). Should become unnecessary once nqp is rebootstrapped, but the stage 0 NFAs have the edgeless state bug that triggers this.
09:15
p: 70056d5 | TimToady++ | tools/build/MOAR_REVISION:
bump moar
jimmy_ \o TimToady++ 09:17
lizmat TimToady++ indeed!
commute to Amsterdam&
09:17 lizmat left 09:21 woolfy left 09:23 salv0 left
TimToady there is, apparently, still some subtle bug causing t/spec/integration/99problems-41-to-50.t to fail, but that's the only failure that seems related 09:24
09:24 gtodd left
jimmy_ TimToady: dentout's arg looks like unused? 09:24
TimToady it returns it 09:25
09:26 gtodd joined
TimToady so we can unindent after whatever the final statement is 09:26
dalek kudo/nom: 03d1599 | TimToady++ | tools/build/NQP_REVISION:
bump nqp
09:32
TimToady it's vaguely possible that the parsing bug that is biting 99problems-41-to-50.t will also affect something downstream, but hopefully not 09:33
it seems to involve a 0 state transition from a non-epsilon somehow, but I'll look at that tomorrow 09:34
tadzik TimToady++
moritz stage parse: 30s
TimToady++
TimToady uh, are you using nqp/master? or did you wait for the bump? 09:36
09:36 sqirrel_ left
moritz nqp/master 09:36
and moar/master
TimToady what was yours before?
nwc10 good *, * 09:37
nwc10 did wonder that
TimToady this shouldn't really speed up the parser by more than a few percent
moritz TimToady: no idea; it's also been a while since I last looked at the build time on this machine
TimToady given the nfa was only 10% of the parser before this
also, compiling grammars has more overhead, but they run faster once they're compiled, so parsing a parser is a bit of a wash 09:38
should also help any regex that uses nfa 09:39
09:40 virtualsue left, salv0 joined 09:44 dakkar joined
TimToady and startup should be a bit faster too 09:44
since the optimization is applied before serialization
09:45 vendethiel joined
jimmy_ didn't see a faster startup, I think that's because coresetting init spents too much time 09:46
09:52 Ugator joined 09:55 abraxxa joined
TimToady this is bizarre, when I checked out rakudo on a different machine and configed it, it says it pulled in 650333f for MoarVM, just as the tag is, but it's missing the patch that showed up in #moarvm a couple hours ago 10:03
how can two different versions have the same hash? 10:04
10:05 yoleaux left
TimToady my nqp and moar are both on branch master, and the bumps both looks right 10:05
lemme try downloading again 10:06
10:06 Isp-sec left, fhelmberger joined 10:08 vendethiel left 10:13 pecastro joined
TimToady fresh clone seems to have fixed it somehow 10:15
ssqq which file define token *<ident>* in the nqp repo? 10:19
FROGGS TimToady++ # 6bde551 10:20
TimToady and jvm only fails the same 99problems test on my laptop, so I think I'll go to bed and let my other machine crank on all the spectests while I sleep
10:21 vendethiel joined
TimToady zzz & 10:21
FROGGS sleep wall 10:23
err, well
TimToady with a will
10:24 ssqq_ joined 10:27 bjz joined, ssqq left 10:33 jimmy_ left 10:37 virtualsue joined 10:42 pecastro left, mvuets left 10:43 virtualsue left, vendethiel left 10:44 denis_boyun_ joined
Ulti could I get an invite for the advent calendar? Wordpress username is 'matteoates' 10:52
10:53 virtualsue joined
Ulti also whatever changes have happened in the last couple of days ++ 23% speed up on my bioinformatics stuff 10:55
:)
jnthn mebbe TimToady++'s NFA work, if you're parse-heavy... 11:00
Ulti actually I haven't run the parsing test but I noticed yesterday that was fast enough that I couldn't notice it doing it on a reasonable sized file when it used to take a while 11:02
this is mostly splitting strings into lists and back again
11:03 Mso150 left 11:06 pecastro joined 11:08 chenryn left 11:11 vendethiel joined
Ulti out of interest what memory usage should I expect from rakudo on moarvm just for hello world? 11:12
tadzik up to 200M, I think? 11:16
just guessing :)
Ulti ~132MB for me here 11:18
tadzik here it seems to be below 100, freshly built 11:22
how are you measuring it though?
11:34 vendethiel left 11:36 Possum left 11:37 chenryn joined 11:44 mvuets joined 11:48 mr-foobar joined 11:51 Akagi201_ left 11:53 ssqq_ left 11:54 Possum joined
Ulti memusg which basically calls ps over and over 11:54
11:55 kurahaupo joined
Ulti so has a bias for longer running jobs, like it says ruby and perl use about 1KB to do hello world which feels too small 11:55
moritz $ /usr/bin/time ./perl6-m -e '' 11:56
0.20user 0.02system 0:00.23elapsed 99%CPU (0avgtext+0avgdata 94612maxresident)k
so about 100M max RSS
11:56 Alina-malina left
moritz though I guess the virtual memory size might be more interesting 11:57
11:57 Alina-malina joined, ssqq_ joined 11:59 kaleem left 12:01 ssqq joined 12:06 jferrero joined 12:12 smls joined
smls m: say +"aa\nbb\n".comb(/^^/); say +"aa\nbb\ncc".comb(/^^/); 12:13
camelia rakudo-moar 91d899: OUTPUT«2␤3␤»
smls ^ Why does it not match the final newline in the first case?
12:16 rindolf joined
colomon smls: Because you asked it to match the beginning of lines, and no line begins there? 12:18
12:18 mr-fooba_ joined
smls does an empty line not have a beginning? :) 12:18
12:20 mr-foobar left 12:23 mr-fooba_ left 12:24 prevost joined 12:29 psch joined
psch hi #perl6 12:29
S05:804 # smls, as reference
synopsebot Link: perlcabal.org/syn/S05.html#line_804
psch no idea if it would make more sense to have line-beginning at the end of a line that ends with "\n", but it's been thought about apparently 12:30
s/end of a line/end of a string/
smls ok, thanks
12:31 ssqq left
timotimo my core setting moarvm file is still 13 mb, i wonder how much of that is serialized NFA 12:32
12:37 kurahaupo left
colomon smls: there was oodles of thought given to what empty strings you might get back from comb. I don't remember all the rules, alas. 12:37
smls yeah come to think of it, the way it works probably does DWIM for most use-cases of ^^ 12:38
in my case I'll just use (1 + .comb(/\n/)) 12:39
12:39 sven_123 left, sven_123 joined 12:40 ssqq joined 12:43 rindolf left, ssqq_ left 12:45 chenryn left
colomon m: say "aa\nbb\n".comb(/^^/); say "aa\nbb\ncc".comb(/^^/); 12:48
camelia rakudo-moar 91d899: OUTPUT« ␤ ␤»
12:49 virtualsue left 13:21 mephinet- left, mephinet- joined, mephinet- left, mephinet- joined, mephinet- is now known as mephinet
jnthn timotimo: It's your Perl6/Grammar.nqp that shoulda shrunk for the most part 13:26
timotimo ah, of course 13:27
3.1 megabytes. i wonder how big it was before 13:28
13:28 kaleem joined
psch timotimo: i have a Perl6/Grammar.moarvm from a few days ago with 5.5MB here 13:31
the "rougly 40%" seems to be a decent estimate
13:33 dayangkun joined
timotimo cool 13:34
nwc10 is there any command line parsing for NQP other than src/HLL/CommandLine.nqp ?
and if so, is there any way to use it other than tools/build/gen-cat.pl?
why am I asking - because I would like to write a build tool *in* NQP
13:35 ash___ left 13:37 prevost left 13:39 dayangkun left
psch i don't think there's anything but src/HLL/CommandLine.nqp, but it's also used in HLL/Compiler.nqp which hands the Result to the process, iirc 13:43
13:44 mr-foobar joined
psch still finds bootstrapping compiler somewhat magical 13:45
jnthn Bootstrapping compiler finds itself somewhat magical... :) 13:47
arnsholt I'm discovering enough magic in making a non-bootstrapping compiler
moritz :-) 13:48
arnsholt To get all functions to be class instances I'll probably cheat a bit, at least for the initial iteration 13:50
smls m: note "foo"; sub note ($msg) { CORE::note("Info: $msg") } 13:53
camelia rakudo-moar 91d899: OUTPUT«Cannot find method 'Any'␤ in sub note at /tmp/WdJJaTCqov:1␤ in block <unit> at /tmp/WdJJaTCqov:1␤␤»
smls ^ Is something like that possible?
arnsholt Oh come to think of it, the spec actually allows for some cheating, with the separation between built-in and user-defined functions
Yaaay \o/
psch smls: delayed declaration? or overwriting builtins? 13:54
smls wrapping built-ins
e.g. add ANSI color codes to all warn/note messages
psch m: my &note = &note.assuming("Info: " ~ *); note("test")
timotimo m: say &SETTING::note
camelia rakudo-moar 91d899: OUTPUT«No such method 'assuming' for invocant of type 'Callable'␤ in block <unit> at /tmp/2TdHeYzyXt:1␤␤»
rakudo-moar 91d899: OUTPUT«(Any)␤»
moritz that's the beauty of the built-ins just being in an outer scope
timotimo m: say SETTING::note 13:55
camelia rakudo-moar 91d899: OUTPUT«(Any)␤»
moritz m: say CORE::<&note>
camelia rakudo-moar 91d899: OUTPUT«sub note (Any |) { #`(Sub|69342656) ... }␤»
timotimo ah
moritz it's not a package
psch i wonder if it's sensible to &assuming with a WhateverCode. probably not...
m: my &note = -> { note("Info: " ~ $^a) }; note("test") 13:56
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/2QNg0AET_Y␤Placeholder variable '$^a' cannot override existing signature␤at /tmp/2QNg0AET_Y:1␤------> my &note = -> { note("Info: " ~ $^a) }⏏; note("test")␤ expecting…»
psch oh, right 13:57
m: my &note = { note("Info: " ~ $^a) }; note("test")
camelia rakudo-moar 91d899: OUTPUT«Memory allocation failed; could not allocate 1583080 bytes␤»
colomon :\
psch m: { my &note = { &CORE::<note>("Info: " ~ $^a) }; note("test") }
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/4TMEoZ0ppT␤Undeclared routine:␤ &CORE used at line 1␤␤»
psch eh, now i have all the pieces i think... :) 13:58
sorry for the spam
13:59 telex left
jnthn hah, that large allocation was probably yet more stack frames :P 14:00
smls m: sub note { CORE::<&note>("Info: $^a") }; note "test"
camelia rakudo-moar 91d899: OUTPUT«Info: test␤»
smls \o/
14:00 telex joined
psch moritz++ for the right place to look for &note 14:00
14:00 xinming left 14:01 xinming joined, anaeem1_ left
smls m: say $*DISTRO.name 14:02
camelia rakudo-moar 91d899: OUTPUT«linux␤»
smls ^ will that always say 'linux' on any linux distro?
14:04 virtualsue joined
moritz hopes so 14:06
smls Why do we have $*DISTRO.is-win but not .is-unix .is-posix etc.? 14:09
FROGGS smls: because in most cases you'll find: if $is-win { ... } else { ... } 14:10
14:12 adu joined
timotimo sad truth? 14:12
smls m: my &note = $*DISTRO.is-win ?? CORE::<&note> !! { CORE::<&note>("\x1b" ~ $^a ~ "\x1b") }; note "test" 14:13
camelia rakudo-moar 91d899: OUTPUT«test␤»
smls ^^ On a scale of 1 ro 10, how evil would you rate this? :P
*to
moritz 3 14:14
smls Would it be better to have a new sub that checks each time whether it should add colors?
14:14 vendethiel joined
smls (each time it is called) 14:14
14:14 silug left
dalek ake: cd52f91 | (Arne Skjærholt)++ | src/Snake/ (2 files):
Implement hash literals.
14:15
FROGGS smls: we have have a env var in rakudo about colors... starts with RAKUDO_
this should be taken into account too
14:16 blackbolt joined
smls FROGGS: Even in a user script? 14:16
FROGGS smls: I use that variable in modules too that output color, aye 14:17
14:23 jluis left
nwc10 how does one use nqp::readfh from NQP? I can only find examples that use it which are Perl 6 14:24
14:30 jluis joined
timotimo FROGGS: that's for Pod::To::Text 14:30
FROGGS timotimo: and for backtrace printing 14:31
14:31 rindolf joined
timotimo oh? 14:32
didn't know that
FROGGS nqp-m: my $fh := nqp::open("foo", "r"); say(nqp::readfh($fh)); nqp::closefh($fh); 14:33
camelia nqp-moarvm: OUTPUT«Arg count 1 doesn't equal required operand count 3 for op 'read_fhb'␤ at gen/moar/stage2/QAST.nqp:1466 (/home/camelia/rakudo-inst-2/languages/nqp/lib/QAST.moarvm:compile_mastop:209)␤ from gen/moar/stage2/QAST.nqp:1682 (/home/camelia/rakudo-inst-2/languages…»
FROGGS nqp-m: my $fh := nqp::open("foo", "r"); my $result; say(nqp::readfh($fh, $result, 42)); nqp::closefh($fh); 14:34
camelia nqp-moarvm: OUTPUT«Failed to open file: no such file or directory␤ at /tmp/_Ps3Utgnql:1 (<ephemeral file>:<mainline>:23)␤ from gen/moar/stage2/NQPHLL.nqp:1239 (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPHLL.moarvm:eval:172)␤ from gen/moar/stage2/NQPHLL.nqp:1432 (/ho…»
FROGGS nwc10: ^^
nqp-m: my $fh := nqp::open("/home/camelia/rakudo-inst-2/VERSION", "r"); my $result; say(nqp::readfh($fh, $result, 4)); nqp::closefh($fh); 14:35
camelia nqp-moarvm: OUTPUT«Failed to open file: no such file or directory␤ at /tmp/ctifKM74Ba:1 (<ephemeral file>:<mainline>:23)␤ from gen/moar/stage2/NQPHLL.nqp:1239 (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPHLL.moarvm:eval:172)␤ from gen/moar/stage2/NQPHLL.nqp:1432 (/ho…»
nwc10 FROGGS: no, that doesn't work
read_fhb requires a native array to write to at /home/nc/test/moar.nqp:15 (<ephemeral file>:MAIN:98)
FROGGS ohh
14:35 immortal left
nwc10 I can't work out how to create the relevant array of uint8 14:35
sorry, should have been clearer that that was my probelm
psch nqp::bootarray and nqp::bootintarray don't seem to work, from my tests just now 14:36
which makes this somewhat confusing 14:37
nwc10 from the C code, it looks like I need to have
REPR(result)->ID == MVM_REPR_ID_MVMArray
and
(MVMArrayREPRData *)STABLE(result)->REPR_data)->slot_type == MVM_ARRAY_U8
(or MVM_ARRAY_I8)
but I have no idea how to write NQP code that makes something that the C code likes
arnsholt bootintarray probably has word-sized ints 14:38
In Rakudo I think Buf[int8] should do the trick
14:39 mephinet left, smls left, mephinet joined
nwc10 arnsholt: that seems to be syntactically valid NQP, but it's not working (same error message about 'requires a native array' 14:40
)
psch nwc10: does nqp::readcharsfh fit for you use-case?
14:40 dalek left, smls joined
nwc10 psch: no, sadly not 14:40
arnsholt Yeah, not sure how to do it in NQP 14:41
psch from docs.markdown it does look like you need the perl6-type Buf for readfh :/
FROGGS gimme another minute
psch bbl o/
14:42 dalek joined, ChanServ sets mode: +v dalek
nwc10 but, Rakudo is written in NQP, so it must have a way to make its Buf objects using NQP :-) 14:42
arnsholt Yeah, it's all accessible from NQP
PerlJam my $Buf := buf8.new(); 14:43
timotimo it seems like the memory usage of "say 'test'" went down noticably (now 102 megabytes maxrss) 14:44
i claim TimToady++ is to blame for this
smls FROGGS: I don't think normal scripts should react to RAKUDO_* variables. 14:45
Why should users care that running a program they installed happens to involve something calles "Rakudo"?
And shouldn't authors try to keep their Perl 6 scripts implementation independent?
14:46 psch left
FROGGS it is just that rakudo is the leading Perl 6 implementation and modules authors can take sane environment variables into account to disable colored prompts 14:46
if there are more Perl 6 implementations I make my modules happily aware of more implementation specific things 14:47
smls if it's just for *dis*abling, then okay
FROGGS that's better than 20+ different env vars just to disable colors for a handful modules
yes
I think this one was about disabling
14:48 molaf_ left
smls Ideally, one should also check whether $*OUT is a terminal 14:48
like `ls` prints color codes, but `ls > file` does not 14:49
m: say $*OUT.t 14:50
camelia rakudo-moar 91d899: OUTPUT«Cannot find method 'isatty': no method cache and no .^find_method␤ in method t at src/gen/m-CORE.setting:15808␤ in block <unit> at /tmp/RrRl45JJjr:1␤␤»
smls NYI?
moritz not yet implemented
erm
you weren't asking what 'NYI' meant :-)
p: say $*OUT.t 14:51
camelia rakudo-parrot 91d899: OUTPUT«False␤»
moritz smls: seems NYI; a ticket would be welcome
smls haven't opened a Rakudo ticket before; should I get into the habit?
14:51 adu left
PerlJam smls: I think only masak has made it habitual :) 14:52
smls hrm, the links from rakudo.org/tickets/ lead to bogus "cross site forgery" warning page
timotimo yeah 14:53
you can safely ignore that one if it reads "some malicious site may be trying to do a search on your behalf"
because that's exactly what rakudo.org is trying to do and it's not dangerous to execute a particular search, at least AFAIK 14:54
smls I clicked "new tickets", and the first one it shows is 5 years old
Am I in the right place?
timotimo "new" is just a state a ticket can be in 14:55
moritz smls: you have to click on 'created' to sort by newness
14:58 anaeem1_ joined
nwc10 jnthn: my $buf := NQPArray.new; creates (I think) an array of objects. How do I create an array of unit8? I think I need to end up in the `case MVM_STORAGE_SPEC_BP_INT:` of compose() in MVMArray.c 14:59
FROGGS nqp::list_i would give you an int array
but not uint8
nwc10 io.c is fussy
timotimo that's something that the native shaped arrays stuff is going to change, if my guess is correct 15:00
arnsholt You'll probably have to pull out the relevant stuff from Rakudo's source
FROGGS I am trying to create an uint8 and then Blob[uint8] type using the mop in nqp... but I end up getting: This representation (VMArray) does not support attribute storage
15:00 vendethiel left
nwc10 FROGGS: thanks for continuing to try. I didn't realise that I'd DOSed you :-/ 15:01
arnsholt Make an int8 native type, then create an array type and set it to be of the int8 type
timotimo i kind of think list_i will only give you something that's compatible with the integer registers of the VM
FROGGS nqp-m -e 'my $fh := nqp::open("test.pl", "r"); my $result := nqp::list_i; say(nqp::readfh($fh, $result, 4)); nqp::closefh($fh);' 15:02
read_fhb requires a native array of uint8 or int8
arnsholt You want the array_type trait in src/core/traits.pm from Rakudo, the header of src/core/Buf.pm and src/core/natives.pm
15:02 blackbolt left
arnsholt Then stuff the equivalent types into your code 15:02
FROGGS that is the best you can do without the mop I think
arnsholt: which is what I tried 15:03
arnsholt: gist.github.com/FROGGS/81b81e4282ae9d426381
I cannot add attributes to VMArray reprs
arnsholt I have to decommute now, but I'll try to hack up something that works once I get home. Shouldn't be too hard 15:04
FROGGS so I maybe need a P6opaque too...
timotimo do you need to build a class that is repr('MVMArray') and has the correct bitsize?
FROGGS yes
timotimo does that workh in nqp?
arnsholt Sort of
An int type of the correct bitsize, and a VMArray parametrized to that type 15:05
timotimo i don't know how parameterizing types works in nqp %)
FROGGS timotimo: this line does it: gist.github.com/FROGGS/81b81e4282a...f8-nqp-L15
(in case it would work) 15:06
ohh, lemme try something
jnthn nwc10: nqp::list_i(), but you already found there's a bit more to it than that... :)
The trick is to compose a repr with the appropriate settings. 15:07
timotimo a repr with settings is different from adding an attribute
jnthn github.com/rakudo/rakudo/blob/nom/...ol.nqp#L11 15:08
timotimo: very :)
nqp-m: my $at := nqp::newtype(NQPClassHOW.new, 'VMArray'); nqp::composetype($at, nqp::hash('array', nqp::hash('type', int))); my $arr := nqp::create($at); nqp::bindpos_i($arr, 0, 42); say(nqp::atpos_i($arr, 0)); 15:11
camelia nqp-moarvm: OUTPUT«42␤»
jnthn So if you know how to get an int8 then you feed it to this.
15:12 erkan joined, erkan left, erkan joined
FROGGS sec 15:13
15:17 JimmyZ_ joined
JimmyZ_ timotimo: it is not easy to remove set op from nqp compiler, since the set op is sometimes needed, IIRC 15:18
timotimo: I think the better ways still is in statick optimization 15:19
*way
timotimo JimmyZ_: i think the set op results from an InstructionList allocating a register to store its result, but not telling the "child" InstructionList that it can re-use the already-allocated result register, OSLT
15:20 [Sno] left 15:22 Celelibi left, Celelibi joined 15:25 treehug88 joined, immortal joined, immortal left, immortal joined 15:26 KCL left 15:27 erkan left
nwc10 doesn't know how to get a uint8 15:27
or an int8 either
FROGGS This representation (P6int) does not support attribute storage :o(
jnthn: what's wrong here? gist.github.com/FROGGS/81b81e4282ae9d426381 15:28
jnthn: is assplodes when I uncomment line 19 and 20
jnthn Using NQPClassHOW instead of NQPNativeHOW, I suspect
JimmyZ_ nwc10: get the type? 15:29
FROGGS jnthn: Native types may not have attributes
ohh 15:30
15:30 Juerd left
FROGGS ahh no, I dunno 15:30
colomon one would hope native types have no attributes, wouldn't one? 15:31
FROGGS ohh, I think I found it 15:32
15:33 Juerd joined
FROGGS \o/ 15:34
nwc10: that does it: gist.github.com/FROGGS/81b81e4282ae9d426381 15:35
jnthn++ / colomon++
timotimo / arnsholt: gist.github.com/FROGGS/81b81e4282ae9d426381
nwc10 FROGGS++ # yay 15:36
JimmyZ_ and can be in BEGIN{ .. } block ?
timotimo cool 15:37
15:37 vendethiel joined, Celelibi left
smls m: my $bar = "a b"; .say for <<foo $bar baz>> 15:40
camelia rakudo-moar 91d899: OUTPUT«foo␤a␤b␤baz␤»
smls :(
Why doesn't <<...>> treat interpolated variables as a single token, like grammars do? 15:41
dalek p: 3b45964 | (Timo Paulssen)++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
pre-size lists if the num of initial values is known
15:43
p: 3069179 | (Timo Paulssen)++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
give "$newer" a less confusing name
FROGGS smls: because you interpolated it into that construct
15:43 Celelibi joined
felher r: my $x = "y z"; .say for <<a "$x" c>>; 15:43
15:43 jluis left
camelia rakudo-{parrot,moar} 91d899: OUTPUT«a␤y z␤c␤» 15:43
smls oh, felher++ 15:44
nwc10 oh, next naive question 15:49
seems that my filehandle from nqp::open was expecting the file to be valid UTF-8
how do I do the equivalent of binmode?
15:51 jluis joined
JimmyZ_ timotimo: looks like pre-size set it to $size and then set it to zero? 15:52
timotimo yes
if we don't reset the size to 0, the objects get pushed at the end :)
15:55 rurban joined
JimmyZ_ oh, it's nice to have a comments there 15:55
timotimo can do
nwc10 oh, this might be a PEBKAC
dalek p: 92a5f72 | (Timo Paulssen)++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
explain the setelems n + setelems 0 trick
15:57
timotimo .tell japhb a knowledgable friend tells me that OpenGL 3.3 Core is a good point to start from, as later versions in the 3 series mostly introduce advanced features you're not going to need as "a beginner" and mesa has some trouble with 4.0 15:58
FROGGS nwc10: it should not expect utf8 IIRC 15:59
nwc10 no, that problem was between the keyboard and the chiar
FROGGS exactly :o) 16:00
jnthn It's nice when you're teaching a class and somebody comes at the end for help with their compiler hobby project. :) 16:07
FROGGS :o)
16:07 denis_boyun_ left
jnthn Another day's teacing done... :) 16:08
moritz ... arnsholt?
timotimo :3
jnthn wonders if he'll have Perl 6 energy tonight :)
16:09 JimmyZ_ left
jnthn hotel & 16:10
16:10 dalek left 16:11 dalek joined, ChanServ sets mode: +v dalek 16:20 dwarring left 16:21 vendethiel left 16:22 vendethiel joined
arnsholt moritz: pong? 16:22
16:27 spider-mario joined
tadzik there should totally be a post on Inline::Perl5 on the advent calendar 16:27
volunteers, or can I take it?
japhb jnthn: What language were they writing a compiler for?
No yoleaux, sigh 16:28
timotimo: I see a highlight referring to OpenGL versions. Is there context I am missing here? 16:29
16:29 [Sno] joined
timotimo wasn't it you i showed the opengl api xml files to? 16:29
japhb Oh yes, some time ago. I had forgotten about that. :-( 16:31
16:31 kaleem_ joined 16:32 kaleem left
tony-o timotimo: i got a simple router out there for http-async, i'll work on keep-alive next 16:33
timotimo tony-o: i likes :)
japhb: aaw, i was hoping one day during the advent calendar or something there'd suddenly be an opengl module + accompanying post :)
16:47 ssqq left 16:50 anaeem1_ left 16:51 Celelibi left 16:53 Celelibi joined, anaeem1_ joined, FROGGS left 16:54 anaeem1_ left 16:55 anaeem1_ joined
raydiak \o 16:56
16:58 erkan joined, erkan left, erkan joined 17:00 immortal left
timotimo hay ray 17:09
17:13 kaleem joined 17:16 kaleem_ left 17:20 fhelmberger left
mvuets tadzik: hi (-: did you have a chance to look at my pr? 17:23
17:23 pmurias joined
moritz arnsholt: mentioning you was in response to irclog.perlgeek.de/perl6/2014-12-02#i_9747580 17:24
masak: how's your advent post coming along? 17:26
arnsholt moritz: Yeah, I eventually figured that out. I claim CaffeineUnderflowException =) 17:27
timotimo ICaffeineUnderflow? 17:29
moritz ENOTENOUGHCOFF
japhb timotimo: The only spare time I'd have to write an advent post is *after* the advent is over. :-( 17:30
timotimo aaw
well, that's okay 17:31
you're already doing a pretty awesome job with perl6-bench, so i can hardly ask you to invest more into perl6 than you already are :)
japhb :-) 17:35
17:38 ab5tract joined
masak moritz: will make dinner, then write it. 17:42
good evening, #perl6
ab5tract \o masak 17:43
mvuets masak: hi (-: today on my way to work i watched your talk about GOTO from YAPC::EU. liked it (-: 17:44
masak \o/
masak .oO( goto work considered awesome )
17:46 zakharyas1 left 17:50 pmurias left
moritz blug: perlgeek.de/blog-en/perl-6/2014-com...pdate.html 17:52
arnsholt moritz++ 17:53
And moritz++ for organizing all of this server stuff
timotimo moritz: i'm wondering about your website's color scheme 17:54
smls m: Foo.parse("abcd"); grammar Foo { }
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/eAcR78EVRS␤Illegally post-declared type:␤ Foo used at line 1␤␤»
smls ^^ Why is it illegal?
ab5tract m: grammar Foo { ... }; Foo.parse("abcd
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/d3HWEWqJBe␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/d3HWEWqJBe:1␤------> grammar Foo { ... }; Foo.parse("abcd⏏<EOL>␤ expecting an…»
ab5tract m: grammar Foo { ... }; Foo.parse("abcd"); grammar Foo { };
camelia rakudo-moar 91d899: OUTPUT«No such method 'TOP' for invocant of type 'Foo'␤ in method parse at src/gen/m-CORE.setting:14194␤ in block <unit> at /tmp/7cCrlHZ72e:1␤␤»
ab5tract smls: makes sense? 17:55
smls I see 17:56
Why allow subs to be post-declared though, but not types?
[Coke] you get the same error for classes, btw. 17:57
17:59 dakkar left
ab5tract smls: i imagine it is difficult to do type checking if you allowed it, but i'd be interested to hear a more informed answer from someone in the know 17:59
TimToady because class definitions change syntax
and we're very strict about the order of things that change the current language 18:00
we get away with it on subroutines because the invocation syntax doesn't change
smls ok 18:01
vendethiel o/, #perl6 18:03
[Coke] hugme: high five moritz
aw, man! 18:04
vendethiel yeee! moritz++
geekosaur the few cases where you cn use a type that has not yet been defined, you have to say something like ::T so it knows what you mean
18:04 mvuets left
ab5tract geekosaur: what cases are those? 18:04
geekosaur not recalling off the top of his head :( 18:05
today I am a bundle of not very well indexed random snippets >.>
TimToady feels like he stayed up till the wee hours hacking...
[Coke] .seen ingy 18:06
blah
geekosaur (I think one of them is when you're referring to a parameterized type? so it needs the :: prefix to tell it that what follows is a "variable" of sorts)
TimToady when capturing a type in a siggie, aye
18:07 xinming_ joined
TimToady m: ::Foo.new().x.say; class Foo { method x { say "huh" } } 18:08
camelia rakudo-moar 91d899: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol Foo␤»
TimToady I guess it doesn't really work for that
ingy hi [Coke] 18:09
TimToady m: class Foo {...}; Foo.new().x.say; class Foo { method x { say "huh" } }
camelia rakudo-moar 91d899: OUTPUT«huh␤True␤»
masak moritz: s/payed/paid/
TimToady anyway, prestubbing is more readable than scattering :: all over
18:11 xinming left
geekosaur right, I would not have expected that to work because is it use before declaration or is there some way to "bind" ::Foo at runtime? 18:11
(use before declaration being sort of a special case of the latter since it's resolved at compile time, just later in the compilation unit) 18:12
TimToady runtime is too late, note the message I got 18:13
why ::Foo depends on a compile-time value, I dunno
geekosaur yes, I am assuming that that is an implementation detail that could be changed (at of course a time penalty) *if* the corresponding mechanism existed; but the mechanism itself is dubious
TimToady well, we encourage stubbing instead 18:14
geekosaur yes, stubbing is clearer and eliminates the ambiguity I mentioed
TimToady m: class Foo {...}; Foo Foo
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/0vEBbShwhk␤Two terms in a row␤at /tmp/0vEBbShwhk:1␤------> class Foo {...}; Foo ⏏Foo␤ expecting any of:␤ postfix␤ infix stopper␤ infix or m…»
TimToady note that types and such become terms rather than functions 18:15
geekosaur my point was more that, if the mechanism existed, it would invite the alternative implementation where I somehow bound ::Foo instead of simply using it before definition
ab5tract it could be an idea to just disallow the ::Unstubbed form then?
geekosaur but that introduces an ambiguity
TimToady m: say ::Foo; class Foo { has $.x = 42; }
camelia rakudo-moar 91d899: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol Foo␤» 18:16
moritz well, only allow ::foo in declarative context
TimToady n: say ::Foo; class Foo { has $.x = 42; }
camelia niecza v24-109-g48a8de3: OUTPUT«(Foo)␤»
TimToady niecza handles it
but it's not trying to optimize the heck out of everything :)
n: say ::Foo.new; class Foo { has $.x = 42; } 18:17
camelia niecza v24-109-g48a8de3: OUTPUT«Foo.new(...)␤»
TimToady n: say ::Foo.new.x; class Foo { has $.x = 42; }
camelia niecza v24-109-g48a8de3: OUTPUT«42␤»
TimToady so it's certainly possible to allow it
so maybe it's just a bug; certainly the original intent was that ::Foo defer judgement 18:18
n: ::Foo ::Foo 18:19
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Two terms in a row at /tmp/seaNVlJz1_ line 1:␤------> ::Foo ⏏::Foo␤␤Parse failed␤␤»
ab5tract m: sub b( ::Thing, $num ) { ::Thing.new($num) }; class Thing { method new($num) { say $num } }; b( Thing, 5 );
camelia rakudo-moar 91d899: OUTPUT«5␤»
TimToady m: ::Foo ::Foo
camelia rakudo-moar 91d899: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol Foo␤»
colomon moritz++
geekosaur right, I'm just noting that, *given* that ability, a logical extension is to allow that ::Foo to be bound to something else instead of being a use before declaration 18:20
TimToady the :: seems to turn it into a term in niecza, which is a bit odd, considering that an internal :: doesn't
ab5tract m: sub b( ::Thing, $num ) { ::Thing.new($num) }; b( ::Thing, 5); class Thing { method new($num) { say $num } };
camelia rakudo-moar 91d899: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol Thing␤»
geekosaur making it potentially a variable. but that's ambiguous and potentially quite expensive
TimToady you leave off the :: in use
ab5tract m: sub b( ::Thing, $num ) { ::Thing.new($num) }; b( Thing, 5); class Thing { method new($num) { say $num } };
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/0vxa3qs71P␤Illegally post-declared type:␤ Thing used at line 1␤␤»
TimToady it's only in the binding that :: is allowed
ab5tract i like that tbh 18:21
18:21 pecastro left
TimToady m: sub b( ::Thing, $num ) { Thing.new($num) }; b( Thing, 5); class Thing { method new($num) { say $num } }; 18:21
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/qVWEnSVgRP␤Illegally post-declared type:␤ Thing used at line 1␤␤»
TimToady m: sub b( ::Thing, $num ) { Thing.new($num) }; class Thing { method new($num) { say $num } }; b( Thing, 5 ); 18:22
camelia rakudo-moar 91d899: OUTPUT«5␤»
TimToady m: sub b( ::Thing, $num ) { Thing.new($num) }; class Thing { method new($num) { say $num } }; b( Int, 5 ); 18:23
camelia rakudo-moar 91d899: OUTPUT«Default constructor for 'Int' only takes named arguments␤ in method new at src/gen/m-CORE.setting:931␤ in sub b at /tmp/ozoaKnVuBm:1␤ in block <unit> at /tmp/ozoaKnVuBm:1␤␤»
18:24 gfldex joined
ab5tract that doesn't look right 18:24
flussenc1 wow... the spectest's doubled in size since I last paid attention to it, *and* it still finished faster. 18:26
18:26 flussenc1 is now known as flussence
TimToady esp if you use TEST_JOB=3 or so on a multicore :) 18:27
*JOBS
flussence yeah, it used to be about 17k tests in 7.5 minutes for 4 cores, now it's 34k tests in 6.5.
r-m is running 100 tests *a second* :) 18:28
TimToady well, some of that is startup improvements too
japhb
.oO( 100 tests a second? Why not 100_000? )
18:29
flussence if only we had a 4096-core box... :)
TimToady What's 3 orders of magnitude among friends?
rurban parrot is also soon 20% faster. better resizablepmcarray 18:30
japhb Not much, in the big scheme of things. :-)
rurban: Nice!
TimToady rurban: the NFA changes also speed up rakudo on parrot and jvm, potentially 18:31
rurban And I still have 20% with the new gc, and the calling convention fixes upcoming
new gc: = previous gc
20% each. not speaking about ext_call runloop fixes for methods and the jit yet. 18:35
PerlJam portal.tacc.utexas.edu/home) and get access to a bunch of CPUs (See portal.tacc.utexas.edu/system-monitor) Not quite the same thing, but close ;)
flussence: Someone could request an account on the Texas Advanced Computing Cluster (TACC,
reverse those two lines. :)
18:36 denis_boyun_ joined
flussence
.oO( IRC still has thread-safety problems... )
18:36
pyrimidine PerlJam: if you have science-y questions to try answering, could also use Blue Waters: bluewaters.ncsa.illinois.edu 18:37
And 'science' is fairly broadly applied in some cases there :) 18:38
PerlJam
.oO( How fast can Rakudo go? IS that sciencey enough? :)
pyrimidine might be. though the 'Powers that Be' might think throwing Blue Waters at it may be a tad overkill 18:39
TimToady if anyone has transmitted rakudo on radio, it's going the speed of light
rurban PerlJam: Thanks. I tried, since I still have my texas address.
TimToady come to think of it, my wifi has sent rakudo at the speed of light many times 18:40
18:41 Mso150 joined
TimToady well, doesn't quite get to c until it leaves the atmosphere... 18:46
18:46 virtualsue left
ab5tract TimToady: in that example above, I would have expected some kind of 'mismatched type object' error 18:47
TimToady I love being more precise than necessary, to make up for the times I'm less precise than necessary.
PerlJam plus there's all of those pesky state transitions as it moves through the equipment that could throttle is to somewhat less than c as well 18:48
s/is to/it to/
rurban My TACC account was accepted, without mentioning the Perl Org
TimToady well, copper tends to transmit at about 1/3 c iirc
or maybe it was 1/2 18:49
rurban I'm trying now XSEDE also, they have fields for non-profits
geekosaur mrr, I thought I recalled it being around 80% 18:52
rurban Also accepted www.xsede.org/group/xup/profile/-/...iew/rurban I can now try 10.000 cpu's 18:53
pyrimidine rurban: nice!
japhb TimToady: I thought it was more like 2/3c or .7c, for both electrical signals in copper and light in fiber.
geekosaur "velocity factor"
18:54 kaleem left
geekosaur oh, that's what I'm remembering. about 66% for standard cabling, 80% is for air dielectric antenna cable 18:55
18:57 Isp-sec joined 19:01 mvuets joined
TimToady is probably remembering ancient phone wiring or so 19:02
TimToady being fairly ancient himself
rurban TACC is only using Intel's icc, no gcc :) But 22,656 Xeon CPU's is nice. I"ll just try 64 or so 19:03
19:05 rindolf left 19:07 FROGGS joined
tadzik nine: do you want to do Inline::Perl5 advent post, or can I? 19:11
PerlJam tadzik: if you take Inline::Perl5, you have to give nine another post idea in return ;) 19:15
jnthn evening, #perl6
timotimo hey J 19:16
dalek nda: 7399a55 | (Andrew Egeler)++ | bin/panda.bat:
Make .bat file work with powershell as well as cmd
nda: d3dc5e4 | tadzik++ | bin/panda.bat:
Merge pull request #124 from retupmoca/master

Make .bat file work with powershell as well as cmd
colomon m: sub prefix:<∃>($a) { $a.any; }; my @a = 1..10; my @b = 4, 8; say so ∃@a ∈ @b 19:17
camelia rakudo-moar 91d899: OUTPUT«True␤»
colomon m: sub prefix:<∀>($a) { $a.all; }; my @a = 1..10; my @b = 4, 8; say so ∀@a ∈ @b
camelia rakudo-moar 91d899: OUTPUT«False␤»
TimToady m: sub prefix:<∀>($a) { $a.all; }; my \a = 1..10; my \b = 4, 8; say so ∀a ∈ b 19:19
camelia rakudo-moar 91d899: OUTPUT«False␤»
tadzik mvuets: yeah, I did :)
mvuets: meanwhile, someone submitted #17 which does that using `git --ls-remote`, so without LWP or anything 19:20
mvuets: which seems like a simplier solution (the code is shorter too), but then your PR has a few more improvements that I'd also like pulled in 19:21
mvuets: so I think I'll merge that one first and then we can try to pull out the rest of the goodies from yuors :) 19:22
19:23 immortal joined, immortal left, immortal joined
tadzik mvuets: poke me when you're around 19:23
19:25 prevost joined
mvuets tadzik: i see. yeah, that indeed looks to be more robust 19:25
19:25 erkan left
ugexe personally i think an LWP solution would be better, as it doesnt require having git installed 19:26
mvuets git is a prerequisite for rakudobrew anyways
tadzik yeah 19:27
colomon heck, it's basically a prerequisite for Rakudo itself
tadzik that too
ugexe dont forget about your windows friends :)
mvuets plus my solution is vulnerable to api rate limit 19:28
19:28 lizmat joined
jercos Well most of the complexity of git to my way of viewing is in the merge algorithms... if you never want to merge (e.g., if you're only ever cloneing a git repo to get the current head of a given branch), the code to do that with LWP would be pretty simple. 19:28
tadzik ugexe: well, windows users still need git around for rakudo and friends :)
TimToady what're we gonna do if we discover that git is lying about the extra backdoor code stashed in the bootstrap?
tadzik mvuets: can you open a new PR with the rest of the features you wrote?
mvuets: bonus points if each is in a separate commi t:)
jercos Wouldn't even need smart HTTP transport if you know in advance the name of the branch you want.
19:29 abraxxa left
ugexe you dont need git if you install the .msi 19:29
mvuets me, when looking at p6 globals: i.imgflip.com/etqry.jpg (-: 19:30
timotimo ... typeglobs? 19:31
tadzik ugexe: but then you're not likely to use rakudobrew
mvuets tadzik: each commit - a separate pr?
tadzik (I think)
mvuets: not neceserilly, just in separate commits
that makes it easier to track down possible issues in the future, or pick only some of the features
mvuets tadzik: ah, they are already (-: 19:32
tadzik if the original PR was like that, I'd just cherry-pick all the things but the list-available, and it'll save us work
oh, huh
indeed :)
mvuets i'll just merge upstream into my branch, rip off `available` subcommand and send a new pr
i mean, my version of the command
timotimo: this star in $*foo just reminds me scary p5 typeglobs 19:33
mvuets has been looking into p6 for just few days, bear with him
timotimo oh? 19:34
i thought typeglobs were just stuff you spell in uppercase?
vendethiel taught perl6 to $work's sysadmin (who just started his internship) today
ab5tract mvuets: i always interpreted the * twigil as intentionally dangerous looking :)
TimToady well, all twigils are longer huffman coding for some kind of "weight" 19:35
but * particularly looks like a glob
tadzik mvuets: alright, thanks :)
TimToady and globs kinda mean "whatever, dude" 19:36
PerlJam vendethiel: what did he think of it?
TimToady just find me a 'foo' variable somewhere...
vendethiel PerlJam: "oh my god this is so cool" "oh wow so nice" "oh and that works too?" "you must use that for everything" 19:37
for an hour and a half :)
vendethiel didn't get much done today :PP
PerlJam nice!
TimToady you should tell him about all the bits you don't like to balance it out :)
mvuets vendethiel++
vendethiel: you should write an advent post about it (-; 19:38
19:38 dalek left
vendethiel mvuets: well, I wrote a tutorial about it instead :P 19:38
TimToady: the bits I don't like are bound to change :)
mvuets perl6 crash course for sysadmins
PerlJam more perl6 people should go to pycon and rubyconf and such to give talks on Perl 6 :)
tadzik sounds great :)
19:38 Mso150_p joined
vendethiel (not because I want them to, just because that's been decided by other people) 19:38
19:38 immortal left, dalek joined, ChanServ sets mode: +v dalek
vendethiel PerlJam: I don't think those confs are cross-languages, though? 19:38
mvuets vendethiel: oh, may i have a look at the tutorial, please?
vendethiel mvuets: learnxinyminutes.com/docs/perl6 19:39
19:39 Mso150 left
PerlJam vendethiel: if your comparing languages, you have to mention both of them ;) 19:39
19:39 erkan joined, erkan left, erkan joined
vendethiel PerlJam: not sure what you mean? 19:39
mvuets vendethiel: ooooh, that's you! moar kudos to vendethiel++ 19:40
PerlJam the talks could be short "tutorials" of the style "Here's how to do <insert awesome feature of Perl 6> in <insert other language>"
TimToady just put up a link to rosettacode :) 19:41
vendethiel PerlJam: well, the ruby conf I've been to only talked about ruby stuff. no cross-language comparison or whatever. but I think I've seen this kind of stuff
.oO( they'll throw a ETOOCRAZY )
19:42 dalek left
jnthn I'll likely continue have few tuits through this week and the weekend, but next week it looks like I'll be able to have one or two entire days for Perl 6 things. At darn last. \o/ 19:42
EBS606740157
TimToady yay
jnthn ...well bother. :)
19:42 dalek joined, ChanServ sets mode: +v dalek
jnthn didn't want to paste anything, but at least it was harmless :) 19:43
PerlJam TimToady: it would have to be a curated set of links as showing rosettacode "in the raw" would be somewhat like showing CPAN (lots of warts)
TimToady jnthn: currently I'm copying the states down into the same array, but I'm wondering whether I should bother to copy to a new list so the old one can be GC'd 19:44
jnthn TimToady: Ah, 'cus the new one ends up with a lot less of them? 19:45
TimToady well, 35-40% less on average, but with a certain variance
jnthn Do you pop them off the end and insert them lower down, or?
mvuets tadzik: i am thinking... if it's called 'list-available' then 'list' should be called 'list-builds'; or if leave it 'list', then 'list-available' should be called just 'available'... maybe? (i prefer the second option) q-: 19:46
TimToady no, just copy from one index to a smaller index
jnthn Provided elems reports somehting smaller then for pre-comp you'll be in decent shape.
dalek rl6-roast-data: 5d3da53 | coke++ | / (5 files):
today (automated commit)
19:46 prevost left
TimToady I do setelems at the end 19:46
jnthn Aha
Yeah
TimToady but I doubt that reclaims anything?
jnthn setelems doesn't reclaim, no
Most use cases don't want that.
Following the "if we needed the memory once we'll need it again" principle 19:47
TimToady for something that's just going to serialize, I don't care, but for nfas going to be used this process, I care more
I do know how much it'll change, so maybe I'll just copy if it's over a threshold 19:48
jnthn Right
that's what I menat about pre-comp
You're already clear there, but for in-process...it'd keep hold of the memory
I'd have hoped that we get a meg or two off the process memory size thanks for your improvements. 19:49
TimToady well, for precomp it already should help
[Coke] TimToady++ 19:50
TimToady but I was mostly hoping for more speed :)
and getting closer to DFAability
jnthn *nod*
I'm doing a build now to see how it is
TimToady as I mentioned earlier, Stage parse is kind of a wash, since we're running faster NFAs, but more time analyzing the newly parsed ones 19:51
jnthn Not much of STD is grammars/regexes, though? 19:52
uh
Not much of *CORE.setting*
TimToady oh, right
jnthn Gee, that nap after work apparently didn't work...
dalek ake: 1908c5e | (Arne Skjærholt)++ | src/Snake/World.nqp:
Simplify some cargo-culted code from NQP.

We're not bootstrapping, so we can just reference the ModuleLoader directly.
ake: 21ba500 | (Arne Skjærholt)++ | src/ (2 files):
Remove the need for a load task getting the ModuleLoader.

Adding "use Snake::ModuleLoader" to snake.nqp makes this superfluous.
TimToady ahd a short night
jnthn too in terms of sleep, though not 'cus he went to bed late... :S
I *think* stage parse may be a little faster, but I tend to know the numbers of my desktop better than my laptop... 19:54
TimToady well, i got a stage parse of 26 something for the first time
so yeah, I think it's a hair faster 19:55
jnthn Grammar.moarvm went from 5,334,400 down to 3,214,066
TimToady heh
that seems about right
should definitely affect startup then
jnthn Wow
Yeah 19:56
Memory use starting REPL: 33,920KB -> 22,152KB
Memory after "say 42": 101,908 -> 90,240KB
So, 11MB off
FROGGS 33% off sounds very nice :o)
jnthn Really. 19:57
And if you undo the patch that disabled lazy deserialization in Moar, you get them down to 11,456KB and 68,696KB respectively. 19:58
An NQP REPL sits at 7,224KB and after say(42) is at 12,120KB. 19:59
TimToady tiddly pom
20:00 Celelibi left
jnthn Disable spesh and you are only at 8,852KB after the say(42). So specializations... 20:00
TimToady still a ways from fitting it onto a PDP-11
jnthn And 54,500KB for Rakudo. I think I might want to look at why spesh produces 14MB worth of specialized bytecode and JITted output at some point :) 20:01
FROGGS these stats look kinde sweet: testers.perl6.org/dist/Acme::DSON
20:01 Celelibi joined
moritz FROGGS: very nice, yes 20:02
FROGGS: why are there so many dots in the version numbers after the 'g'?
TimToady the green revolution
FROGGS moritz: like is really has a use or something :o)
moritz: because it is how Version objects stringify 20:03
20:03 Celelibi left
moritz eeks 20:03
FROGGS m: say $*PERL.compiler.version
camelia rakudo-moar 91d899: OUTPUT«v2014.11.50.g.91.d.8995␤»
FROGGS yepp
moritz: I mean, I can strip these dots for the webpage, but had no time to do that yet 20:04
dalek p/6pe: 22143f6 | jonathan++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
Map nqp:: ops for parametricity on MoarVM backend.
p/6pe: e9b1b9c | jonathan++ | t/nqp/87-parametric-6model.t:
Some initial tests for 6model parametric ops.
moritz FROGGS: no, it wants to be stripped inside rakudo
20:05 Celelibi joined
FROGGS yeah, that should be possible too... 20:05
20:06 darutoko left 20:08 dalek left, dalek joined, ChanServ sets mode: +v dalek
mvuets tadzik: also found a bug in 'list-available' (-: 20:11
20:17 Juerd left 20:18 telex left 20:19 Juerd joined 20:20 telex joined
TimToady $*DISTRO was supposd to be something like 'ubuntu', and $*KERNEL was supposed to be 'linux' 20:24
we seem to be re-inventing $*OS :/
nwc10 I see that Rakudo's Configure.pm calls `nqp-m --show-config` to get the MoarVM config, which it uses to expand Makefile.in
er Configure.pl 20:25
FROGGS I still have that old spreadsheet - ethercalc.org/wrwsbhvuim
nwc10 what's the right way to get MoarVM config information in *NQP*'s Configure.pl ?
FROGGS since we have a stage0, we could probably call nqp::backendcfg or what it is called 20:26
jnthn We also could consider having a flag on moar that dumps the info. 20:27
FROGGS nqp: say(nqp::backendconfig()<cc>)
camelia nqp-parrot: OUTPUT«cc␤»
..nqp-jvm: OUTPUT«(signal ABRT)»
..nqp-moarvm: OUTPUT«gcc␤»
nwc10 FROGGS: yes, that works 20:28
../MoarVM/moar --libpath=src/vm/moar/stage0 src/vm/moar/stage0/nqp.moarvm -e 'for nqp::backendconfig() { say($_) }'
[output]
jnthn: for now, we can survive without the flag 20:29
jnthn OK, cool :)
I'm always happy to have less things :)
FROGGS me too :o)
nwc10 although I might be going to bed before I hack the next bit
me three
FROGGS well, except for food and kids... you can never have enough food and kids at home :o) 20:30
20:32 dalek left
tony-o stock up on some kids 20:32
nine Good evening, everyone!
nwc10 Rutan said that the goal of private space tourism is to reduce the cost of space travel and exploration. "If we go through a time period where the focus is on flying the consumer, these 'payloads' who pay to fly and can be reproduced with unskilled labor...with tools around the house," he joked, "there will be a breakthrough to enormous volume." 20:34
jnthn o/ nine 20:35
masak is "listop" defined anywhere in the synopses?
TimToady well, grep finds 29 mentions 20:36
20:36 dalek joined, ChanServ sets mode: +v dalek
TimToady but listop is actually a P5ism 20:37
mvuets tadzik: ok, my pr for rakudobrew should be good to go now
masak TimToady: yes, I suspected as much.
20:38 anaeem1_ left
jnthn masak: Turns out Poznan also has a street called Listopadowa :P 20:39
TimToady demonstrating that the Useless Facts collection is, in fact, highly contextual 20:40
mvuets jnthn: what country is that? "listopadowa" makes sense to me (-:
jnthn mvuets: Poland. :)
20:41 Juerd left, Juerd joined
mvuets jnthn: ah! that would mean something like "leaf fall", or "november" if it was a ukrainian month name (-; 20:42
FROGGS can't get enough of www.youtube.com/watch?v=YfXPhWb38u8
dalek p/6pe: 2124b66 | jonathan++ | t/nqp/87-parametric-6model.t:
Basic tests for parameterization interning.
20:43
jnthn Well, listops in Perl 6 might cause precedence to fall, at least... :) 20:44
TimToady they do in Perl 5 too
but we've got more precedence droppers in P6 20:45
all them statement prefixes, for starters
and : on a method call 20:46
I think ours tend to read rather better than Haskell's $ 20:48
PerlJam TimToady: amen.
itz I'm not a Web Designer and neither do I play one on TV but is this better?
pl6anet.org/test/ 20:49
jnthn itz: Yes.
itz++
TimToady anything with Camelia is automatically better :)
FROGGS itz: yes, way better :o) 20:50
ab5tract itz++ 20:51
mvuets itz++ # sexy! 20:52
masak advent day 3 blog post draf, comments welcome: gist.github.com/masak/bd47a4022aa90a58e55a
itz I wonder if there is an xsnow.css :)
masak draft* 20:53
jnthn Going to find a pre-sleep beer... &
TimToady you show disrespect to teh elder gods by calling them mere "beings"
masak edits 20:54
there, updated: gist.github.com/masak/bd47a4022aa90a58e55a 20:55
TimToady sub all-positive(@list --> Bool) covers a world of hurt 20:56
or someday, --> Bool(), and it'll deduce the 'so' for you
admittedly 'so' is shorter :) 20:57
masak ;)
the principle still needs to be learned.
TimToady maybe we should rename Bool to So
masak no, please don't. :)
TimToady so, I won't. :) 20:58
but return types will also tend to serve as containment, is my point 20:59
so maybe it's worth mentioning
m: sub foo (--> Bool) { 1 | 42 }; foo()
camelia rakudo-moar 91d899: OUTPUT«Type check failed for return value; expected 'Bool' but got 'Junction'␤ in any return_error at src/vm/moar/Perl6/Ops.nqp:649␤ in sub foo at /tmp/OKHPfWKeXk:1␤ in block <unit> at /tmp/OKHPfWKeXk:1␤␤»
TimToady like that
masak I dunno... I would mention it if we actually had the functionality...
TimToady ^^^
we have the containment, it's just resulting in a run-time error 21:00
masak gives in
TimToady the junction will never propagate out to the elder thingies
21:01 anaeem1 joined
TimToady and in general, we're trying to encourage declarative solutions over procedural 21:01
the compiler could easily turn this into "That will never work!"
in fact, that might be mid-hanging fruit for someone 21:02
we know the return types of operators and functions lexically 21:03
21:03 Mso150_p left
TimToady assuming they're declared appropriately 21:03
21:03 Mso150_p joined
TimToady the compiler can, in fact, compare return types to see that --> Bool doesn't need to be enforced if you also use 'so' 21:04
no need for runtime specialization there
PerlJam masak++ good post
masak: though, you mentioned "elder beings" twice, but only changed the first to say "elder non-beings" 21:05
masak added the point about return type declarations: gist.github.com/masak/bd47a4022aa90a58e55a
PerlJam: oh, good catch.
21:05 anaeem1 left
masak fixed. 21:05
dalek kudo/newio: 03d1599 | TimToady++ | tools/build/NQP_REVISION:
bump nqp
21:06
kudo/newio: 8f804a9 | (Elizabeth Mattijsen)++ | tools/build/NQP_REVISION:
Merge branch 'nom' into newio
TimToady what the...oh... :) 21:07
masak merges. they're tricky. :)
21:08 kaare_ left
lizmat I haven't backlogged yet, but the parse stage of the settings went for me from ~30 seconds to ~21 seconds 21:08
so TimToady++ 21:09
21:09 kurahaupo joined
TimToady shouldn't have that big an effect 21:09
lizmat well, it did for me :-) 21:10
lizmat going to check again
smls masak: After "collapse back into the normal, sane, non-junctive world", I would add a colon, or even an extra half-sentence like ", which we can do using one of these ways:"
Otherwise, newbies might not get that that is what the following code snipped is showing. 21:11
TimToady if "that that" is good enough for Lincoln, it's good enough for smls++
lizmat TimToady: you're right, 2nd time it's 28 seconds
huh?
Stage start : 0.000 21:12
Stage parse : 21.764
so I didn't imagine it...
PerlJam lizmat: maybe you imagined the ~30 seconds? :)
moritz also points out that collapsing a junction due to boolification is taken from the quantum world, where collapsing a wave function into an eigenstate is triggered by a measurement
smls masak: s/the most common use of junctions/the most common uses of junctions/
lizmat alas: 21:13
Stage start : 0.000
Stage parse : 28.726
smls or, s/don't/doesn't/ immediately after
moritz rebuilding nqp segfaults on latest moar :(
lizmat new theory: my notebook came out of the cold back of the car the first time
TimToady moritz: that happened to me last night
git said it gave me the newest moar, but it didn't 21:14
21:14 anaeem1_ joined
lizmat I guess at room temp it's throttling CPU or not turboing it anymore 21:14
still...
moritz TimToady: ... and for a moment I thought you meant that the wave function collapse happened to you
TimToady had to blow away nqp/install to force clone
FROGGS moritz: I thought the same *g*
moritz TimToady: indeed 21:15
TimToady git describe even said I had the new moar, but git log didn't show the patch
TimToady has no idea what went wrong
FROGGS maybe this sha1 already exists?
TimToady that seems, unlikely
FROGGS though not the rest of the revision can axist
exist*
TimToady both my nqp and my nqp/MoarVM were on master branch, and the bumps look correct 21:16
mvuets TimToady, lizmat: it's conspiracy
TimToady lizmat: I get wide variations based on CPU temp
lizmat yeah, I guess I rarely let my notebook get that cold :-) 21:17
moritz wonders if --gen-moar=master merges correctly from origin/master
masak smls: thank you, fixing.
TimToady I was just using the tagged version, not =master
(on my other machine)
but the bumps shoulda made those the same 21:18
but the problem seems like it's in git, not in our use of it
smls masak: possibly s/whether you want to or not/whether you want it to or not/
lizmat m: sub a(Int $a = 42) {}; sub a(Str $a = "foo") {}; # shouldn't this be a compile time error?
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/sePrNvgvv6␤Redeclaration of routine a␤at /tmp/sePrNvgvv6:1␤------> nt $a = 42) {}; sub a(Str $a = "foo") {}⏏; # shouldn't this be a compile time err␤ expecting any of…»
TimToady or how would 'git describe' get out of sync with 'git log'
lizmat m: multi a(Int $a = 42) {}; multi a(Str $a = "foo") {}; # shouldn't this be a compile time error?
camelia ( no output )
lizmat m: multi a(Int $a = 42) {}; multi a(Str $a = "foo") {}; a() # rather than a runtime error ? 21:19
camelia rakudo-moar 91d899: OUTPUT«Ambiguous call to 'a'; these signatures all match:␤:(Int $a = { ... })␤:(Str $a = { ... })␤ in sub a at /tmp/8jHgisS73E:1␤ in block <unit> at /tmp/8jHgisS73E:1␤␤»
21:19 Juerd left
TimToady lizmat: well volunteer'd :) 21:19
moritz lizmat: could be, but doesn't have to be 21:20
masak smls: fixed.
moritz: collapsing quantum analogy added.
TimToady oh wait, it's not an error
masak (I'm now in the wordpress draft, by the way, so your changes won't show up in the gist)
TimToady you have defaults, which make it merely ambiguous
lizmat but, you can never call that sub without parameters 21:21
it will always fail
or am I missing something ?
21:21 DarthGandalf left
TimToady no, you're correct 21:22
21:22 Juerd joined
TimToady and the candidate lists are generated at compile time, so it could in theory know that the dispatch will be formally ambiguous 21:22
but that's a little harder than telling that no candidates match
tadzik mvuets: looks good, thanks!
lizmat ok, so well volunteered then :-) 21:23
mvuets tadzik: cool, thanks! jj just discovered and fixed a warning in my fix of his thing 21:24
tadzik: put he sent me the pl 21:25
tadzik: maybe just fix it right in your repo to avoid these multiple pull requests mess? github.com/JJ/rakudobrew/commit/cc...bced426148 21:26
tadzik /o\
so many PRs :)
in a moment, refactoring stuff now
21:29 Celelibi left 21:31 Celelibi joined
masak "Scheduled for 21:31
12/3/2014 0:01"
post scheduled on Wordpress. 21:32
moritz \o/
tadzik masak++ 21:33
masak almost feel like it took longer to port the post from Markdown to Wordpress-subverted HTML than it took to write it in the first place :)
bartolin maybe a stupid question: if I have an array @a=1,2,3 -- how can I create a parcel which has the same elements as @a? 21:34
masak ISTR I had a script to convert it... don't think I saved it, but it should be easy to rewrite.
m: my @a = 1, 2, 3; say @a.Parcel.WHAT
camelia rakudo-moar 91d899: OUTPUT«(Parcel)␤»
masak m: my @a = 1, 2, 3; say @a.Parcel.perl
camelia rakudo-moar 91d899: OUTPUT«(ListIter.new(),)␤»
masak m: my @a = 1, 2, 3; say @a.Parcel.elems
camelia rakudo-moar 91d899: OUTPUT«1␤»
masak :/
m: my @a = 1, 2, 3; say @a.list.Parcel.elems 21:35
camelia rakudo-moar 91d899: OUTPUT«1␤»
masak :/ :/
moritz m: my @a = 1, 2, 3; say @a.Parcel.perl
camelia rakudo-moar 91d899: OUTPUT«(ListIter.new(),)␤»
bartolin . o O (maybe a not-so-stupid-question) ;-)
masak confesses to not having a good intuition for Perl 6 coercers
moritz ah, I see you tried it
21:35 lizmat left
bartolin m: my @a = 1, 2, 3; my $b = Parcel.new( @a.values ); 21:37
camelia ( no output )
bartolin m: my @a = 1, 2, 3; my $b = Parcel.new( @a.values ); say $b.perl;
camelia rakudo-moar 91d899: OUTPUT«$((1, 2, 3).list,)␤»
moritz m: my @a = 1..3; say Parcel(@a).perl
camelia rakudo-moar 91d899: OUTPUT«(ListIter.new(),)␤»
moritz m: my @a = 1..3; say Parcel(@a.eager).perl
camelia rakudo-moar 91d899: OUTPUT«(1, 2, 3)␤»
moritz m: @a = 1, 2, 3; say @a.eager.Parcel.perl 21:38
camelia rakudo-moar 91d899: OUTPUT«===SORRY!=== Error while compiling /tmp/PzNpgyv05t␤Variable '@a' is not declared␤at /tmp/PzNpgyv05t:1␤------> @a⏏ = 1, 2, 3; say @a.eager.Parcel.perl␤ expecting any of:␤ postfix␤»
moritz m: my @a = 1, 2, 3; say @a.eager.Parcel.perl
camelia rakudo-moar 91d899: OUTPUT«(1, 2, 3)␤»
moritz bartolin: ^^ that seems to work
bartolin thanks a lot! 21:39
21:39 Mso150_p left 21:40 Mso150_p joined
masak is unsatisfied by that 21:41
moritz too
array assignment is already eager
why should the .eager be necessary?
masak submits rakudobug 21:42
mvuets i leave. take care, #perl6
moritz \o mvuets
masak fare thee well, mvuets
21:44 mvuets left
moritz we had about 2k page views in total over the last two days 21:44
21:44 DarthGandalf joined
moritz on p6advent, that is 21:44
smls re topic of masak's post: Maybe routines should have a default return type of Any?
21:45 sqirrel joined
smls So unless you go and add --> Mu to your signature, you won't accidentally return a junction. 21:45
Or would that have too much of a performance impact? 21:46
masak smls: I don't think that fix would be a net good.
smls: and it's not so much about routine boundaries -- that's just an example. 21:47
smls: the main thing is to not let junctional values run away.
smls Well, routine boundaries is what they need to pass to run away to code that a different person than the one who creates the junction, wrote... 21:48
22:00 sqirrel left
masak only if your model is one-routine-one-author. 22:01
22:04 kaare_ joined 22:10 kaare_ left 22:13 FROGGS left 22:16 spider-mario left
masak 'night, #perl6 22:17
ab5tract does someone have a moment to explain the practical differences between 'method new' and 'submethod BUILD' ?
22:17 KCL_ joined
timotimo new is what your users call 22:17
ab5tract ciao masak!
timotimo BUILD will be called on all subclasses by BUILDALL
BUILD is not derivable, because it's a submethod
the arguments you pass to self.bless will be given to BUILD directly 22:18
ab5tract so BUILDALL is called implicitly by the parent class?
timotimo hm. who calls buildall? i think bless does.
ab5tract ok
timotimo easy to test :)
22:19 ron1230 joined
timotimo what random class to derive from, i wonder 22:19
ab5tract timotimo: working through my advent post
so Setty provides the new method to classes which use the role
ron1230 I met Jonathan Swartz author of Mason. He isn't that big physically. It wouldn't take a very big person to push him around, rough him up or .... 22:20
ab5tract and Set uses submethod BUILD to bind its private %!elems variable using nqp::bindattr, which I assume is what makes the Set mutable
22:20 ron1230 left
ab5tract sorry, immutable 22:20
and i'm showing both code snippets and want to make sure i really understand the distinction between the two 22:21
22:21 Mso150_p left
ab5tract ah! in Setty.new : self.bless(:elems(%e)); 22:21
sweet :) 22:22
22:25 KCL_ left 22:27 vendethiel left 22:30 vendethiel joined
timotimo i couldn't come up with an example class to derive from in order to cause an exception + backtrace from a BUILD submethod ... 22:30
22:31 virtualsue joined 22:34 ptc_p6 joined
ab5tract will any class with a submodule BUILD do? 22:37
m: class A does Setty { submethod BUILD { die "except" } }; A.new 22:40
camelia rakudo-moar 91d899: OUTPUT«except␤ in submethod BUILD at /tmp/LnOLhhTqHD:1␤ in method BUILDALL at src/gen/m-CORE.setting:961␤ in method bless at src/gen/m-CORE.setting:944␤ in method new at src/gen/m-CORE.setting:18258␤ in block <unit> at /tmp/LnOLhhTqHD:1␤␤»
22:46 ptc_p6 left 22:47 ash___ joined 22:49 Alina-malina left, Alina-malina joined
ash___ does anyone know if/where there is a perl6/nqp grammar for emacs or vim? I am working on a Textmate/Atom one and what to be consistent 22:51
22:51 vendethiel left
ash___ and by grammar, I mean for syntax highlighting 22:52
PerlJam ash___: github.com/vim-perl/vim-perl
22:52 Isp-sec left, bjz left
colomon Textmate! 22:52
22:52 rurban left
Ulti yeah the vim one isn't perfect but is quite good 22:53
22:53 kurahaupo left, vendethiel joined, rurban joined 22:54 rurban1 joined
ab5tract timotimo: the way it is used to abstract Setty.new and Set / SetHash is pretty cool 22:54
ash___ github also uses the textmate highlighting in their site now, which why some files don’t look right now
ab5tract is BUILD technically a phaser? it isn't listed as such in S04 22:55
22:55 BenGoldberg joined, rurban1 left 22:57 Celelibi left, ggherdov left 22:58 rurban left 23:00 Celelibi joined
TimToady it's not syntactically a phaser 23:00
it is called automatically, which is why it's in CAPS
23:05 ohcamacj-2 left 23:07 cognominal left, ggherdov joined, ohcamacj-2 joined 23:08 pyrimidi_ joined 23:09 hugme left
ab5tract gotcha, thanks for clarifying. 23:09
23:10 pyrimidine left, hugme joined, ChanServ sets mode: +v hugme 23:13 smls left 23:14 denis_boyun_ left 23:15 cognominal joined 23:16 vendethiel left 23:18 treehug88 left 23:25 bloonix joined 23:28 vendethiel joined 23:30 gfldex left
ab5tract so when subclassing and also defining a .new, it's probably a good practice to call self.bless 23:30
dalek p: d7849cb | TimToady++ | src/QRegex/NFA.nqp:
plug more null state holes

As a rule, if you add an edge to -1 to generate a new state, you should always *do* something with that new state, or it generates null epsilons.
23:31
TimToady bless will make sure ancestors do their part
^^^ fixes the crash with t/spec/integration/99problems-41-to-50.t 23:32
All tests successful.
23:32 virtualsue left, lizmat joined
ab5tract yeah, i'm liking P6's BUILD semantics a lot. this blog post is getting a bit thick in the middle :) 23:33
TimToady oh, I'd better bup
*m
23:33 ggoebel111111115 joined
dalek kudo/nom: dd27056 | TimToady++ | tools/build/NQP_REVISION:
bump nqp
23:34
23:34 smls joined 23:35 ggoebel111111114 left, denis_boyun_ joined
lizmat
.oO( wish we could see why nqp was bumped in the rakudo git log )
23:36
TimToady well, but it's in the nqp git log, which is why we had to bump it :) 23:37
ab5tract and do i assume correctly that Mu's BUILD is always called, even if a .new is defined but doesn't call self.bless?
TimToady I don't think so 23:38
not unless you defer to the built-in new from your new
when nextsame or so
*with
but if the reason for your own new is to change the argument processing, builtin new won't like it 23:39
so better to call .bless
only one new needs to call .bless 23:40
ab5tract in the class hierarchy?
TimToady yes, for a given lineage 23:41
BUILDALL does all the hard work
and makes sure parents are ready before children
ab5tract hmmm.. but any subclass .new overrides the parent .new, so i'm confused by "only one new needs to call .bless" 23:43
TimToady I meant dynamically, not statically 23:45
ab5tract unless i take your meaning as, you only need self.bless called once, because BUILDALL does what it says :)
TimToady every new wants to have a bless, but you only need to run the most derived .bless
TimToady did not realize he said something terribly ambiguous, which is unusual for him... 23:46
means I need a nap, in all likelihood...
ab5tract ok, so good practice is to always call bless? sorry to be hammering the point, but i want to give good advice
TimToady yes, in general, though of course there are always exceptions, like if you just want to write a logging new around the built-in 23:48
in that case use callsame or nextsame instead
note that BUILDALL is a virtual call, so even if a parent calls .bless, all the correct BUILDs are run 23:49
23:50 vendethiel left
TimToady bless always needs to be called by someone, let's put it that way 23:50
and it's the most derived new's responsibility to either call .bless or call something that will call .bless 23:51
(note that this is all an oversimplification when it comes to native types with other representations than P6Opaque) 23:52
ab5tract i see. yeah, i'm looking for the general rule. the edge cases can have their own blog post :)
23:53 vendethiel joined
TimToady is tired of generalities, and specifically wants a nap :) 23:54
&
ab5tract enjoy TimToady :) 23:55
m: class D { submethod BUILD { say "D.BUILD" } }; class E is D { method new { say "E.new"; self.bless } }; class H is E { method new { say "H.new" } }; H.new
camelia rakudo-moar 91d899: OUTPUT«H.new␤»
ab5tract still lost in the contrast between that code snippet and "so even if a parent calls .bless, all the correct BUILDs are run", but sleep is appealing to me as well 23:56
TimToady m: class D { submethod BUILD { say "D.BUILD" } }; class E is D { method new { say "E.new"; self.bless } }; class H is E { method new { say "H.new"; nextsame } }; H.new
camelia rakudo-moar 91d899: OUTPUT«H.new␤E.new␤D.BUILD␤»
TimToady m: class D { submethod BUILD { say "D.BUILD" } }; class E is D { method new { say "E.new"; self.bless } }; class H is E { method new { say "H.new"; self.bless } }; H.new 23:57
camelia rakudo-moar 91d899: OUTPUT«H.new␤D.BUILD␤»
TimToady that's all correct
ab5tract it's crystal now
thanks :D
TimToady thunk & :D
23:58 rmgk_ joined, rmgk left, rmgk_ is now known as rmgk
BenGoldberg p56: s/(.)(.*)(.)/First [$1], Second [$2], Third[$3]/; # Why does the rhs of s/// dissapear with p56? 23:58
camelia p5-to-p6 : OUTPUT«s:P5!(.)(.*)(.)!!␤»
23:59 woolfy joined