»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 vendethiel joined
skids sortiz: I would chalk that up to pre-GLRisms. 00:01
00:05 kalkin- joined
kalkin- hi 00:05
is there a way to create an executable in perl6?
i heard it was possible to pack the moarvm and the perl6 bytecode together in one executable file, but i can not find a source for that anymore 00:06
sortiz skids, In that case I will try to make a PR with a case. 00:09
skids sortiz++ 00:10
00:17 Ben_Goldberg joined, BenGoldberg left 00:21 abaugher left 00:23 abaugher joined 00:24 adu joined 00:30 abaugher_ joined, araujo__ joined 00:31 abaugher left 00:32 araujo_ left 00:33 yurivish_ joined
gfldex the offending commit for doc is github.com/perl6/doc/commit/a606c2...b548593411 00:34
however, the entire file look fine. It seams to be a problem with the pod-parser. 00:35
Ulti kalkin- I dont think there is anything that does it for you atm its "possible" but not implemented AFAIK, the JVM version of Rakudo can produce a JAR file though which might be portable
kalkin- Ulti: Ic, Thanks. 00:39
Ulti kalkin-: if you have the JVM backend you need a --target=jar 00:41
00:42 firstdayonthejob left 00:43 adu left 00:45 vendethiel left
orbus what's the status on the jvm backend though? seems like it was failing some tests last time I tried? 00:47
not sure if I tried on 2015.12 though 00:48
00:50 Actualeyes joined
orbus is building now to see 00:51
or maybe it was just that it was a lot slower 00:54
00:54 vendethiel joined
orbus will know soon 00:54
00:56 spider-mario left 01:02 yurivish_ left 01:04 Ben_Goldberg is now known as BenGoldberg
Ulti *shrug* 01:05
01:05 espadrine left
Ulti I havent used it in a long time since it was slow when moarvm was getting faster 01:05
01:06 yeahnoob joined
leont AFAIK it's very slow to start, but not slow to run 01:08
It is way less complete than rakudo-on-moar though 01:09
skids pmurias has been making quite a lot of commits to catch up nqp-js's features.
but I don't see much work going into the java backend. 01:10
01:31 jameslen_ left 01:37 jameslenz joined 01:38 vendethiel left 01:43 ribasushi left 01:45 raiph left 01:49 ribasushi joined 01:53 AlexDaniel left, kaare_ joined 01:57 vendethiel joined 02:00 avgn5 joined 02:02 avgn5 left 02:05 laz78 left, Fleurety left 02:11 Fleurety joined, xpen joined 02:16 xpen left, xpen joined 02:17 gtodd left 02:18 Fleurety left, laz78 joined
ZoffixWin *sigh* why do I keep ending up reading Reddit comments... They have no value and only piss me off -_- 02:20
02:20 xpen_ joined 02:22 Fleurety joined, Fleurety left
diakopter ZoffixWin: I think you can remove "Reddit" from that sentence, probably "comments" also 02:23
02:24 xpen left
ZoffixWin Yeah, that's a good point. 02:25
TEttinger youtube comments however are an invaluable resource for planning, y'know, doomsday machines 02:30
02:31 alpha123 left
TEttinger "let's leave the planet to the raccoons. they've practically got opposable thumbs already, maybe they won't use them to kill each othr" 02:31
TimToady is not reassured 02:32
Hotkeys o/ all 02:33
TimToady is keeping down the ginger ale, which is rather more reassuring...
02:36 laz78 left
ZoffixWin YouTube comments are usually so stupid they provide a good source of entertainment. 02:36
02:39 Fleurety joined
colomon ginger ale++ 02:40
02:41 Fleurety left
TimToady Protip: the community grill probably has meat juices on the control knobs. 02:41
diakopter also, propane 02:42
TimToady great way to pick up a case of salmonella
TEttinger oh geez... 02:44
02:44 Fleurety joined
TimToady especially on an island with a more than adequate supply of free-range chickens 02:44
TEttinger get that salmon out soon, TimToady!
kauai or what?
TimToady got it in one
02:45 Fleurety left
TEttinger my brother went to kauai not long ago. sent lots of chicken pictures 02:45
02:45 alpha123 joined, bitmap left
TEttinger only hawaiian island with no introduced mongooses (mongeese?) 02:46
so chickens can have lots of adorable baby chickens
02:46 kid51 left
TEttinger apparently they filmed part of the first Jurassic Park movie in kauai when they needed that "untamed wilderness" look and still be near civilization 02:47
02:47 kaare_ left
TimToady yes, especially the waterfall at the beginning is on the south side of kauai 02:47
TEttinger near the botanical garden I think 02:48
02:48 Fleurety joined
TimToady there's two, but yeah 02:48
there's one on the north side too
grandkids are a little too young for those though
TEttinger there's the waterfall that IIRC the road stops at, I can't remember the circumstances but there's that coastal road that goes mostly around the island except... is it waimea canyon that prevents it from continuing> 02:49
?
TimToady no, it's Na Pali
cliffs on the northwest side
TEttinger ah ok
it's hard to have a nicer place to be sick if you have to be sick though 02:50
east coast is having snowmageddon
ZoffixWin m: (1..*).grep(/2233/).grep(*.is-prime).pick: 5
TimToady well, last time I was on Kauai I came down with stomach cancer, so salmonella is an improvement
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
TEttinger oh wow. did they catch it early? 02:51
ZoffixWin m: (1..*).grep(/2233/).grep(*.is-prime)[0..5]
TimToady well, early enough that removing half my stomach fixed it
camelia ( no output )
ZoffixWin Hm. So .grep can't produce a lazy list or am I doin' it wrong?
TEttinger "and the lap-band was free"
TimToady not a recommended way to lose weight :)
02:51 laz78 joined
TEttinger indeed 02:52
TimToady ZoffixWin: you forgot to say it 02:53
TEttinger my dad survived cancer, skin cancer on the bottom of his foot, of all places. never got any sunburn there either. thankfully his dermatologist knew that it was possible to get skin cancer there
ZoffixWin m: (1..*).grep(/2233/).grep(*.is-prime)[0..5].put
camelia rakudo-moar d67cb0: OUTPUT«32233 62233 92233 102233 132233 182233␤»
ZoffixWin :D
Amazing.
ZoffixWin gonna use this to Wow people at the next Perl 6 talk 02:54
TEttinger it's kinda crazy that the best cure for cancer these days is "see doctor often, hope doctor finds it early, remove offending body part"
02:54 kalkin-_ joined
TEttinger how much money has been spent on finding a cure and we're just inches down the road it seems 02:55
leont That's not quite true
TEttinger there are those new treatments like the proton beam thing for brain tumors 02:56
leont but sleep &
diakopter m: (1..*).grep(/4$/)>>.grep(*.is-prime)[0].put
camelia rakudo-moar d67cb0: OUTPUT«(timeout)» 02:57
TimToady hypers are not lazy, even if there were such a beast
02:58 kalkin- left
ZoffixWin m: say (^10 .hyper).WHAT 02:58
camelia rakudo-moar d67cb0: OUTPUT«(HyperSeq)␤»
TEttinger m: (1..*).grep(/1$/).grep(*.is-prime)[99].put
camelia rakudo-moar d67cb0: OUTPUT«2801␤»
02:58 edehont joined
ZoffixWin m: (1..*).grep(/1$/).hyper.grep(*.is-prime)[99].put 02:58
camelia rakudo-moar d67cb0: OUTPUT«(timeout)» 02:59
02:59 edehont left
diakopter I'm curious to see a slang that makes all number literals act as if they're hex... Acme::HexIWinTailsYouLose 02:59
geekosaur you've been hexed! 03:01
03:01 leont left
sevvie it is a hexy idea. 03:01
ZoffixWin Doesn't sound hard at all :) 03:02
Probably can take Slang::Roman as base
03:02 Herby_ joined
Herby_ Good evening, everyone! 03:02
o/
ZoffixWin \o
m: (1..*).grep(/1337/).grep(*.is-prime)[0].put 03:04
camelia rakudo-moar d67cb0: OUTPUT«31337␤»
ZoffixWin ROFL
I never realized that number was prime :D
m: (1..*).grep(/1337/).grep(*.is-prime)[0..5].put
jdv79 ditto
camelia rakudo-moar d67cb0: OUTPUT«31337 111337 113371 133709 133711 133717␤»
Herby_ you could say its pretty... leet. 03:05
ZoffixWin :)
m: (1..*).grep(*.is-prime).grep({.base(16) ~~ /DEADBEEF/}).[0].put 03:09
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
ZoffixWin All hope is not lost! :D 03:10
ZoffixWin runs it locally
oh 03:11
m: (1..*).grep(*.is-prime).grep({.base(16) ~~ /DEADBEEF/})[0].put
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
sevvie aww.
ZoffixWin m: ^10 .[0].say 03:12
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SNeaXtgma7␤Malformed postfix call (only alphabetic methods may be detached)␤at /tmp/SNeaXtgma7:1␤------> 3^10 .7⏏5[0].say␤»
ZoffixWin m: (1..10).[0].say
camelia rakudo-moar d67cb0: OUTPUT«1␤»
ZoffixWin weird that that works
03:12 vendethiel left
diakopter m: (1..*).grep({.base(16) ~~ /DEADBEEF/})[0].put 03:13
that's clearly the bottleneck
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
ZoffixWin m: say 16::('AA')
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fDZmV6Bopv␤Confused␤at /tmp/fDZmV6Bopv:1␤------> 3say 16:7⏏5:('AA')␤ expecting any of:␤ colon pair␤»
ZoffixWin I can never remember the way to convert a hex into dec 03:14
diakopter :16(
ZoffixWin m: say :16('AA')
camelia rakudo-moar d67cb0: OUTPUT«170␤»
ZoffixWin Thanks.
m: say :16('DEADBEEF')
camelia rakudo-moar d67cb0: OUTPUT«3735928559␤»
ZoffixWin weird that your example above timed out
diakopter m: say :16('DEADBEEEEEEEEEEEEEEEEEEEEEEF')
camelia rakudo-moar d67cb0: OUTPUT«4516460495130180453338428073766639␤»
diakopter m: say :16('DEADBEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEF') 03:15
camelia rakudo-moar d67cb0: OUTPUT«393439198051279736664876386351182450865125420077347962657012085426995785455␤»
03:15 vendethiel joined
diakopter m: (1..*).grep({.base(16) ~~ /DEADBE*F/})[0].put 03:15
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
sevvie such a beautiful language. 03:16
ZoffixWin m: my $x; $x = .base: 16 for 1..1000; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.0080499␤»
ZoffixWin m: my $x; $x = .base: 16 for 1..3735928559; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
ZoffixWin m: say 3735928559 * 0.0080499 / 1000 03:17
camelia rakudo-moar d67cb0: OUTPUT«30073.8513070941␤»
ZoffixWin m: say 3735928559 * 0.0080499 / 1000 / 60
camelia rakudo-moar d67cb0: OUTPUT«501.230855118235␤»
ZoffixWin yikes
m: say 3735928559 * 0.0080499 / 1000 / 60 / 60
camelia rakudo-moar d67cb0: OUTPUT«8.353847585303917␤»
ZoffixWin So it'll take about 8 hours :S
m: my $x; $x = .base: 16 for (1..4000).race; say now - INIT now 03:19
camelia rakudo-moar d67cb0: OUTPUT«0.1382821␤»
ZoffixWin :S
m: my $x; $x = .base: 16 for (1..1000).race; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.12550475␤»
ZoffixWin using 4 threads instead of 1 is ~160% slower/
03:20 laz78 left
ZoffixWin m: my $x; $x = .base: 16 for (1..1000).hyper; say now - INIT now 03:20
camelia rakudo-moar d67cb0: OUTPUT«0.0755752␤»
ZoffixWin :S
m: my $x; $x = .base: 16 for (1..4000).hyper; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.1492982␤»
03:21 laz78 joined
ZoffixWin This is interesting: 03:23
m: my $x; .base: 16 for (1..40000); say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.21781926␤»
ZoffixWin m: my $x; .base: 16 for (1..40000).hyper; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.028326␤»
ZoffixWin And now: 03:24
m: my $x; .base: 16 for (1..40000).hyper: :2batch; say now - INIT now
TimToady 101.2℉, surely I can do better than that...
camelia rakudo-moar d67cb0: OUTPUT«(signal XCPU)»
TimToady just have to run a few more CPUs... 03:26
ZoffixWin m: my $x; .base: 16 for (1..400).hyper; say now - INIT now 03:27
camelia rakudo-moar d67cb0: OUTPUT«0.01025795␤»
ZoffixWin does the code without .hyper use more than one thread? 03:28
ah 03:29
m: my $x; .base: 16 for (1..40000).hyper: :20000batch; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«0.4602917␤»
ZoffixWin has no idea wtf "degree of parallelism" in the docs for hyper means 03:30
03:33 bitmap joined
ZoffixWin I mean, I can surmise it means how many cores to use, but I'm not 100% sure, which is not very friendly for docs aimed for programmer beginners 03:34
Herby_ *raises hand*
TimToady I suspect it's worker threads, which might or might map to cores, depending 03:35
ZoffixWin I wouldn't mind editing the doc with clarification, if anyone has a certain answer :D
03:36 laz78 left 03:37 DoverMo joined
skids ZoffixWin: jnthn.net/papers/2015-yapcasia-concurrency.pdf 03:39
03:39 laz78 joined
skids page 37 03:39
03:40 adu joined
skids I imagine the definition of "parallel worker" is implementation-dependent 03:42
03:42 noganex_ joined 03:45 noganex left, jme` joined
llfourn how do adverbs work? can you define your own? 03:46
skids on the callee side they are just named parameters 03:49
03:49 vendethiel left
skids Are you talking about adverbs on ops? 03:49
03:50 jernster joined
llfourn m: my %h = ( a => "b"); say %h<a>:exists; say %h{'a',:exists}; 03:50
camelia rakudo-moar d67cb0: OUTPUT«True␤(b (Any))␤»
03:50 jme` left
llfourn skids: not really just in general, what is an adverb on an 'op'? 03:51
also what did I do wrong there...
dalek c: 5ecee77 | (Zoffix Znet)++ | doc/Type/Iterable.pod:
expound degree of parallelism
03:52
llfourn also I thought exists returned True...
ZoffixWin it did
llfourn ah yeah you're right. 03:53
is the above behaviour just a special feature of postcircumfix? :foo turns into a positional? 03:54
so you have adverbs to get around that...
skids m: perl6 -e 'multi sub infix:<°> ($a, $b, :$say) { $say.say; $a + $b }; say (42 ° 1 :say("the answer is"))'
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/2v_ga1TDil␤Two terms in a row␤at /tmp/2v_ga1TDil:1␤------> 3perl6 -e7⏏5 'multi sub infix:<°> ($a, $b, :$say) { ␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
skids m: multi sub infix:<°> ($a, $b, :$say) { $say.say; $a + $b }; say (42 ° 1 :say("the answer is"))
camelia rakudo-moar d67cb0: OUTPUT«the answer is␤43␤»
skids That's an adverb on an op. 03:55
llfourn skids: ok thanks.
Herby_ is there a json reader that comes with Task::Star?
I can't seem to find info on what is included
ZoffixWin Herby_, it's just a module: modules.perl6.org/repo/Task::Star
Herby_, IIRC JSON module included with it isn't one I like to use. I prefer JSON::Fast 03:56
skids llfourn: It is defined basically the same for postfix:<{ }>, but then there is some crazy code for optimizing combinations of adverbs so it may be trickier there.
erm, postcircumfix:<{ }> 03:57
Herby_ ZoffixWin, thanks I'll give it a whirl
ZoffixWin m: my %h = ( a => "b"); say %h<a>:exists; say %h{'a'} :exists;
camelia rakudo-moar d67cb0: OUTPUT«True␤True␤»
03:57 vendethiel joined
llfourn skids: but the general idea is that passing { :foo } is not the same as somesub(:foo) so you have adverb syntax to be able to pass named in these cases? 03:58
ZoffixWin llfourn, I don't really see how you infer that :foo would be *inside* the curlies in that case
skids llfourn: Yes, the subscript operations do not take named params inside the subscripts, and that is a rule on the syntax level. 03:59
ZoffixWin m: multi sub postcircumfix:<{ }> ($a, $b, :$mumbo) { "mumbo{$a, $b}".say; 'jumbo' }; my %h = :foo<bar>; say %h<foo>:mumbo
llfourn ok gotcha thanks!
camelia rakudo-moar d67cb0: OUTPUT«mumbofoo bar foo␤jumbo␤»
ZoffixWin m: multi sub postcircumfix:<{ }> ($a, $b, :$mumbo) { "mumbo\{$a, $b\}".say; 'jumbo' }; my %h = :foo<bar>; say %h<foo>:mumbo 04:00
camelia rakudo-moar d67cb0: OUTPUT«mumbo{foo bar, foo}␤jumbo␤»
04:00 laz78 left
ZoffixWin m: multi sub postcircumfix:<{ }> ($a, $b, :$mumbo) { "mumbo{$a.WHAT}".say; 'jumbo' }; my %h = :foo<bar>; say %h<foo>:mumbo 04:00
camelia rakudo-moar d67cb0: OUTPUT«Use of uninitialized value of type Hash in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub postcircumfix:<{ }> at /tmp/dC67Cop43g line 1␤mumbo␤jumbo␤»
04:00 adu left
ZoffixWin ah 04:00
ZoffixWin was confused for a sec there
skids m: multi sub infix:<+> (Int $a, Int $b, :$say!) { $say.say; $a + $b }; say (42 + 1 :say("the answer is")) # wonder what keeps this one from working 04:01
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'say' passed␤ in block <unit> at /tmp/oTWdNZtAYX line 1␤␤»
04:02 Herby_ left
ZoffixWin m: multi sub postcircumfix:<{ }> ($a, $b, :$really-there) { $a{$b}:exists ?? "Yes, <$b> is REALLY there" !! 'Nah, I was just screwing with you' }; my %h = :foo<bar>; say %h<foo>:really-there; say %h<bar>:really-there 04:02
camelia rakudo-moar d67cb0: OUTPUT«Yes, <foo> is REALLY there␤Nah, I was just screwing with you␤»
ZoffixWin :D This is pretty neat
skids, :say is being passed to &say
m: multi sub infix:<+> (Int $a, Int $b, :$say!) { $say.say; $a + $b }; say ((42 + 1 :say("the answer is"))) # wonder what keeps this one from working 04:03
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'say' passed␤ in block <unit> at /tmp/bnaLXVZS0n line 1␤␤»
ZoffixWin :(
m: multi sub infix:<+> (Int $a, Int $b, :$say!) { $say.say; $a + $b }; say (+(42 + 1 :say("the answer is"))) # wonder what keeps this one from working
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'say' passed␤ in block <unit> at /tmp/ajdiYegGa7 line 1␤␤»
ZoffixWin m: multi sub infix:<+> (Int $a, Int $b, :$say!) { $say.say; $a + $b }; my $x = 42 + 1 :say("the answer is"); say $x # wonder what keeps this one from working
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'say' passed␤ in block <unit> at /tmp/0wP6Bh_qhV line 1␤␤»
ZoffixWin never mind :)
llfourn shouldn't it need a ',' to pass it to say
04:03 travis-ci joined
travis-ci Doc build failed. Zoffix Znet 'expound degree of parallelism' 04:03
travis-ci.org/perl6/doc/builds/104547697 github.com/perl6/doc/compare/ed6cb...cee7729033
04:03 travis-ci left
llfourn lol your explanation broke the build >.< 04:04
ZoffixWin m: sub foo { say "$^a $:bar $:ber" }; foo "don't" :bar<think> :ber<so> 04:05
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/___Dzw3A3S␤You can't adverb "don't"␤at /tmp/___Dzw3A3S:1␤------> 3 $:bar $:ber" }; foo "don't" :bar<think>7⏏5 :ber<so>␤»
ZoffixWin m: sub foo { say "$^a $:bar $:ber" }; foo "don't", :bar<think> :ber<so>
camelia rakudo-moar d67cb0: OUTPUT«Required named parameter 'ber' not passed␤ in sub foo at /tmp/QX1StJe8jI line 1␤ in block <unit> at /tmp/QX1StJe8jI line 1␤␤»
ZoffixWin orly :S 04:06
llfourn ZoffixWin: $:bar is autoviv named?
ZoffixWin m: sub foo { say "$:foo $:bar $:ber" }; foo :foo<"don't"> :bar<think> :ber<so>
camelia rakudo-moar d67cb0: OUTPUT«"don't" think so␤»
ZoffixWin The comma-less thing strikes me again! I wish it weren't so addictive to use
llfourn, it's named parameter counterpart of $^a: docs.perl6.org/language/variables#The_%3A_Twigil 04:07
llfourn cool thanks. 04:08
skids (another useful feature I totally didn't know about until people started actually using it this last month) 04:09
Arguably better than $^ with it's treacherous sort-order.
ZoffixWin I think I figured it out 04:10
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$say!) { $say.say; $a + $b }; say (42 + 1 :say("the answer is")) # wonder what keeps this one from working
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'say' passed␤ in block <unit> at /tmp/_8FZ7_OjhC line 1␤␤»
ZoffixWin or not -_-
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow"}; say 42 + 1; 04:11
camelia rakudo-moar d67cb0: OUTPUT«meow␤True␤»
skids You'd tink the req'd name would push it up in the candidates list.
ZoffixWin m: multi sub infix:<+> (Int:D $a, Int:D $b, :$say!) { $say.say; $a + $b }; say ((42 + 1) :say("the answer is")) # wonder what keeps this one from working
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eWTI_xLAIv␤You can't adverb (42 + 1)␤at /tmp/eWTI_xLAIv:1␤------> 3b }; say ((42 + 1) :say("the answer is")7⏏5) # wonder what keeps this one from work␤»
ZoffixWin Yeah, weird.
ZoffixWin rakudobugs this just in case
04:12 BenGoldberg left
llfourn ZoffixWin++ 04:13
ZoffixWin Actually, it's not a multi-resolution issue.
Observe here:
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow"}; say say 42 + 1, :foo<42>;
camelia rakudo-moar d67cb0: OUTPUT«meow␤Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/q7Yr2rG0gN line 1␤␤»
ZoffixWin "meow" is still printed
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow <$foo>"}; say say 42 + 1, :foo<42>;
camelia rakudo-moar d67cb0: OUTPUT«Use of uninitialized value $foo of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub infix:<+> at /tmp/OT3Cjm5qF9 line 1␤meow <>␤Unexpected named parameter 'foo' passed␤ in block <un…»
ZoffixWin m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow <$foo>"}; say 42 + 1 :foo<42>;
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/0eAa6uTt5N line 1␤␤»
ZoffixWin huh
llfourn (??)
geekosaur hm, is () syntax in the parser or is it a circumfix operator?
llfourn in the parser I think 04:14
which isn't to say there isn't an operator too
geekosaur and you know what, tat error should say what the parameter was passed *to*
llfourn m: say &circumfix:<( )>
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Dp_gpIzwKe␤Undeclared routine:␤ circumfix:<( )> used at line 1. Did you mean 'circumfix:<{ }>', 'circumfix:<:{ }>', 'circumfix:<[ ]>'?␤␤»
llfourn or not
ZoffixWin m: ::('&circumfix:<( )>').candidates.say 04:15
camelia rakudo-moar d67cb0: OUTPUT«No such symbol '&circumfix:<( )>'␤ in block <unit> at /tmp/5ty8PWRBzf line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3041␤ in block <unit> at /tmp/5ty8PWRBzf line 1␤␤»
ZoffixWin m: ::('&postcircumfix:<{ }>').candidates.say
camelia rakudo-moar d67cb0: OUTPUT«(sub postcircumfix:<{ }> (\SELF, \key) { #`(Sub|66424424) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu \ASSIGN) { #`(Sub|66420016) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu :$BIND! is raw) { #`(Sub|66423208) ... } sub postcircumfix:<{ }> (\SELF, \ke…»
skids m: sub foo (|c) { |c.perl.say }; foo(:a) :b; # () does nameds both inside and out
camelia rakudo-moar d67cb0: OUTPUT«\(:a, :b)␤»
llfourn ( you don't need the ::() fyi ) 04:16
ZoffixWin m: &postcircumfix:<{ }>.candidates.say
camelia rakudo-moar d67cb0: OUTPUT«(sub postcircumfix:<{ }> (\SELF, \key) { #`(Sub|57048600) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu \ASSIGN) { #`(Sub|57044192) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu :$BIND! is raw) { #`(Sub|57047384) ... } sub postcircumfix:<{ }> (\SELF, \ke…»
ZoffixWin cool
04:18 vendethiel left
ZoffixWin RT for the weird named arg thing: rt.perl.org/Ticket/Display.html?id=127359 04:20
llfourn skids: hmmm not sure if like 04:21
skids ZoffixWin++ 04:23
TimToady well, 102.1℉ is a bit more impressive 04:32
maybe it 04:33
maybe it's just norovirus
ZoffixWin get better :) 04:35
04:40 laz78 joined, laz78 left 04:47 laz78 joined
DoverMo i wanna suck whale barnacles 04:50
ZoffixWin Man.. I broke camelia again 04:51
m: say 42
camelia rakudo-moar d67cb0: OUTPUT«42␤»
ZoffixWin oh
I just found a way to make her not talk
m: sub postfix:<"\1"> {say $^a}; say 1
DoverMo woops... wrong chat
ZoffixWin DoverMo, there's no right chat for that :) 04:52
llfourn m: role Temperature { }; sub postfix:<℉>(Real:D $t) { $t does Temperature }; say 102.1℉ # :D
camelia rakudo-moar d67cb0: OUTPUT«102.1␤»
DoverMo lol
that was a legit accident 04:54
ZoffixWin m: role Temperature { method gist { ((self - 32) * 5/9) ~ 'C' } }; sub postfix:<℉>(Real:D $t) { $t does Temperature }; say 102.1℉ 04:55
camelia rakudo-moar d67cb0: OUTPUT«38.944444C␤»
04:55 vendethiel joined
llfourn perhaps ℉ should just do the conversion. Role is a tad too clever. 04:56
.u ℉ 04:57
yoleaux U+2109 DEGREE FAHRENHEIT [So] (℉)
geekosaur I think I'd only use a role there if mixing the role in let me make multiple kinds of temperature conversions, instead of hardcoding one like there 04:58
llfourn geekosaur: right.
skids Why convert to C instead of K? :-)
04:58 revhippie left
llfourn skids: right! 04:59
skids thinks the last Farenheit holdout countries should start using K and then tell everyone else they are behind the times.
ZoffixWin m: role Temperature { method gist { ((self - 32) * 5/9).fmt: '%.1f℃' }; }; multi infix:<+> (Temperature $t, Str $what) { when $what ~~ 'water boiling' { (212+$t) does Temperature };}; sub postfix:<℉>(Real:D $t) { $t does Temperature }; say 102.1℉ + 'water boiling'; 05:00
camelia rakudo-moar d67cb0: OUTPUT«156.7℃␤»
ZoffixWin weird 05:01
05:01 maslan left
diakopter gist assumes F 05:01
ZoffixWin And I'm giving it F 05:02
DoverMo Can you make it so I can roll random temperatures?
ZoffixWin 100C => 212F; 101.2F => 38.4C; but (212+101.2)F != (100+38.4)C 05:03
weird
Ahh 05:06
I made the assumption that 0-100C == 0-212F
Indicative it's time for me to sleep... 12:06AM and I gotta get up at 6 >_<
DoverMo 0C is like... 30 F ? 05:09
32F?
skids 32 yes 05:10
ZoffixWin Actually, no, I still don't get it. 05:11
Why 212F => 100C; 101.2F => 38.4C; but (212+101.2)F != (100+38.4)C
Hotkeys because fahrenheit is bad 05:13
that's wh
skids You'd need a gradient type like Date has Interval, no?
05:13 laz78 left
ZoffixWin ah, seems to be so... 0F is just -17C 05:14
Hotkeys it's like how 2² = 4 and 3² = 9 but 2² + 3² != 4 + 9
ZoffixWin nuclear-imaging.info/site_content/w...elcius.png
geekosaur yes, you;re effectively scaling the 32 degree offset
ZoffixWin k
Hotkeys, yes, they are 05:15
m: say so (2² + 3² == 4 + 9)
camelia rakudo-moar d67cb0: OUTPUT«True␤»
Hotkeys er
wait
sorry
ZoffixWin :D
Hotkeys it's like how 2² = 4 and 3² = 9 but (2 + 3)² != 4 + 9 05:16
:p
DoverMo i like it better if 0C = 30f
ZoffixWin right
I like it better if F is not used :P
Hotkeys So does most of the world
05:16 jernster left
Hotkeys should just internally store them as kelvin 05:17
DoverMo if it's 32F, then it's already cold asF
Hotkeys and then convert when the user wants
geekosaur pretty much, yes 05:18
ZoffixWin This actually should be a fun module to make.
.u Kelvin
yoleaux U+212A KELVIN SIGN [Lu] (􏿽xE2􏿽x84􏿽xAA)
Hotkeys lol 05:19
ZoffixWin The unicode chars are all there for the ops
ZoffixWin adds it to the TODO list
Hotkeys But why
geekosaur .u Reaumur
yoleaux No characters found
geekosaur nope :p
Hotkeys .u Rankine
yoleaux No characters found
ZoffixWin Hotkeys, why what?
Hotkeys, it'd be pretty useful for science work. Just write your temp in units you got
Hotkeys Isn't the kelvin sign just K anyway
is what I was whying 05:20
ZoffixWin Ah
􏿽xE2􏿽x84􏿽xAAKk
Hotkeys make sure to include rankine
the kelvin of fahrenheit
ZoffixWin Looks larger than regular ks
on this funt
I'll try to remember that :D
geekosaur in my font they look identical except the bottom leg is slightly longer
Hotkeys [°R] = [°F] + 459.67 05:21
:p
ZoffixWin heh
Hotkeys [°R] = [K] × 9⁄5
that fraction doesn't look nice on my font
9/5
ZoffixWin This is what the K looks on my monitor like: i.imgur.com/4io6TrP.png 05:22
Hotkeys such resolution 05:23
ZoffixWin 1440p
geekosaur oh, heh, not identical after all. the bottom leg comes out of the top leg for K, both come out of the stem at the same place for 􏿽xE2􏿽x84􏿽xAA
ZoffixWin And no, "The Moaning of..." not pr0n loaded in my VLC :) i.imgur.com/S1jEkML.jpg 05:24
Hotkeys lol
05:24 regreg joined 05:26 laz78 joined
diakopter heh 05:34
05:35 araujo__ left 05:36 Fleurety left 05:41 vendethiel left 05:47 Cabanossi left 05:50 Cabanossi joined, Zero_Dogg left, vendethiel joined, Zero_Dogg joined, Zero_Dogg left, Zero_Dogg joined 05:57 skids left 06:03 _Gustaf_ joined
_Gustaf_ Mornin 06:04
06:10 sevvie left 06:11 vendethiel left 06:12 laz78 left 06:15 vendethiel joined 06:19 khw left, sjoshi joined 06:37 vendethiel left 06:38 geraud left 06:45 DoverMoo joined 06:46 DoverMoo left 06:48 DoverMo left 06:49 vendethiel joined, FROGGS_ left 06:58 CIAvash joined 07:00 _mg_ joined 07:01 alpha123 left 07:12 vendethiel left 07:16 Relsak left 07:20 vendethiel joined 07:24 regreg left 07:29 domidumont joined 07:32 FROGGS joined 07:34 domidumont left 07:36 domidumont joined, firstdayonthejob joined 07:40 Fleurety joined, yeahnoob left 07:43 vendethiel left 07:56 johan_ is now known as johan 07:59 vendethiel joined
moritz \o 08:00
08:01 yeahnoob joined 08:06 ChoHag left 08:07 ChoHag joined, zakharyas joined 08:09 darutoko joined 08:11 salva joined 08:22 jdrab joined 08:26 bioexpress joined 08:28 ely-se joined
bioexpress Hello! What could be the reason, that I get the message "Use of uninitialized value $pod of type Any in string context Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub pod2markdown at /home/mm/.rakudobrew/moar-2015.12/install/share/perl6/site/sources/8105D070BA923D95822D6E3F57B1B70CBD35800B line 198" when I run "mi6 build" ? 08:29
ely-se m: class User { has $.name; has $.email-address; }; say User.new(|('rightfold;rightfold@gmail.com' ~~ /^$<name>=[.*?]';'$<email-address>=[.*]$/).hash) 08:33
camelia rakudo-moar d67cb0: OUTPUT«User.new(name => Match.new(ast => Any, list => (), hash => Map.new(()), orig => "rightfold;rightfold\@gmail.com", to => 9, from => 0), email-address => Match.new(ast => Any, list => (), hash => Map.new(()), orig => "rightfold;rightfold\@gmail.com", to => 2…»
ely-se :(
konobi bioexpress: `mi6 new Foo::Bar; cd Foo-Bar; mi6 build` ? 08:34
bioexpress Yes, I did `mi6 new Foo::Bar; cd Foo-Bar;` before.
konobi uptodate mi6? 08:36
bioexpress Could it be an pod-error?
08:38 Guest19075 left, eone joined
bioexpress Does `panda update` update all modules? 08:39
08:40 firstdayonthejob left
bioexpress I think I've found the reason: ascii-drawings in the pod. 08:43
08:45 vendethiel left
moritz bioexpress: I think "panda udpate" updates meta data (that is, list of modules and their dependencies) 08:51
08:53 travis-ci joined
travis-ci Doc build failed. sylvarant 'Merge pull request #8 from perl6/master 08:53
travis-ci.org/sylvarant/doc/builds/104575831 github.com/sylvarant/doc/compare/f...064cdee8fb
08:53 travis-ci left 08:59 dakkar_ joined 09:00 abraxxa joined 09:02 maslan joined
bioexpress I was not the ascii-drawing, that caused the error but `=item`s followed by no name in the same line. 09:05
moritz: how could I update a module? 09:14
09:15 eone left
moritz bioexpress: by installing it again 09:19
09:20 cibs joined
DrForr Grr, got to stop switching between Perls 5 and 6... 09:22
moritz DrForr: if you don't stop, you'll get used to it 09:24
took me only a few years :-) 09:25
[Tux] m: (open "xx.txt",:w).say("A+B+C+D+");.say for (open "xx.txt",:r,nl-in=>"+").lines 09:26
camelia rakudo-moar d67cb0: OUTPUT«open is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub open at src/RESTRICTED.setting line 9␤ in block <unit> at /tmp/02qf8sctW_ line 1␤␤»
[Tux] OK, try that on a local machine. It works as expected.
I expect the same output for «perl6 -e'$*IN.nl-in="+";.say for lines()' xx.txt 09:27
but that returns "A+B+C+D+"
09:28 RabidGravy joined
DrForr By the by, I was writing some code at hone and found myself distracted by not having a convenient $fh.get-line equivalent. Was I just not looking hard enough? 09:28
*home
bioexpress When I try to install it again I get an error message "App::Mi6:ver<*>:auth<>:api<> already installed...". Does this mean, the module is up to date.
moritz [Tux]: lines() doesn't work on $*IN
[Tux] $*ARGV then? 09:29
moritz [Tux]: it defaults to $*ARGFILES
bioexpress: you might need to 'panda --force install <themodule>'
09:29 MARTIMM joined
moritz bioexpress: it's because the modules don't have versions yet, but the compiler does honor module versions 09:29
[Tux] moritz++ (test-script fixed) 09:30
09:31 vendethiel joined 09:33 rindolf joined
bioexpress Thx! 09:33
09:33 bioexpress left
timotimo o/ 09:37
sortiz \o
[Tux] csv-ip5xs 17.883 09:39
test 22.580
test-t 12.325
csv-parser 49.920
09:41 espadrine joined, araujo joined
stmuk anyone know if the main days for the GPW are Mar 8 and 9? 09:41
09:42 araujo left, araujo joined
moritz stmuk: Mar 9 to 11, Hackathon on Mar 12th 09:43
act.yapc.eu/gpw2016/
09:43 g4 joined, g4 left, g4 joined
stmuk 3 days of talks? 09:44
thats like a YAPC!
09:44 araujo left
stmuk I know German is a more verbose language than some of its forks :) 09:44
tadzik :P
09:45 araujo joined
moritz stmuk: though not as many tracks (1 on the first day, and either one or two days two and three, depending on how many submissions we get) 09:46
speaking of: tadzik, stmuk: please submit talks! Preferably Perl 6 talks!
09:46 araujo left 09:47 araujo joined
stmuk moritz: OK I shall consider and get back to you shortly 09:47
ely-se
.oO(a2p6)
09:48
09:48 brrt joined, araujo left 09:50 zakharyas left
sortiz Was expecting that an "is repr(...)" was applied a little early :( 09:53
09:54 vendethiel left
sortiz m: use NativeCall; class Foo is repr('CStruct') { has Pointer[Foo] $!f }; # Is this fixable? 09:54
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IKgLJ3LoS1␤An exception occurred while parameterizing Pointer␤at /tmp/IKgLJ3LoS1:1␤Exception details:␤ Cannot call infix:<===>(Foo, Str); none of these signatures match:␤ ($?)␤ ($a, $b)…»
arnsholt Possibly. But is your struct struct foo { foo *f } or struct foo { foo **f }? 10:01
RabidGravy what I though would work (that is predeclaring Foo) doesn't work 10:03
sortiz arnsholt, **f 10:04
arnsholt sortiz: Right, so you actually do want the Pointer[Foo]. Have you tried making it a CArray[Foo]?
jnthn m: use NativeCall; class Foo is repr('CStruct') is Any { has Pointer[Foo] $!f }; # workaround 10:05
arnsholt It gives you more annoying code, I know, but it looks like the error comes from the parametrisation code
camelia ( no output )
arnsholt Huh
sortiz jnthn, Thanks! 10:06
10:07 xpen_ left
sortiz arnsholt, Yes, seems that the REPR of Foo isn't settled on time 10:08
10:10 xpen joined, araujo joined 10:11 araujo left
arnsholt sortiz: Don't think it's the REPR. Given that adding the explicit is Any works, looks more like it's the supertype 10:12
moritz the problem is using a constraint type before the type is composed, no? 10:13
arnsholt jnthn: Presumably the implicit inheritance from Any is added only on the closing brace if no inheritance is specified?
10:13 araujo joined
arnsholt Yeah, I figured it was that 10:13
But I don't think composition ever happens before the closing brace, I'm guessing it's something else
DrForr jnthn or moritz - The IO object doesn't seem to support extracting a single line from a file, just the .lines method which fills an array.
moritz DrForr: .get 10:14
DrForr Ah, thanks.
jnthn Also, .lines is lazy.
DrForr Any reason that wasn't named '.line'?
And yes, lazy, I was reading the description.
moritz DrForr: yes. It's not always strictly a line, depending on the .in-nl setting
DrForr True, but neither is .lines in that case :) 10:15
moritz we didn't find something better for lines()
DrForr Ot wasm
It wasn't mentioned in the I/O page so I went off, grumbled and wrote a loop. 10:16
I'll do a PR tonight with better docs.
sortiz jnthn, Your workaround solved all my problems, mine was ugly: Pointer[Pointer] followed by nativecast :)
timotimo on the 13th of march, voting happens in my area 10:19
moritz timotimo: you can vote by snail mail 10:21
timotimo aye, i'm likely to do that
sortiz For the curious that was the real case: github.com/salortiz/p6-LMDB/blob/m...B.pm6#L113 10:22
10:26 adu joined 10:27 adu left
RabidGravy timotimo, was it you who *ages* ago was making an EventSource server thingy? 10:29
10:30 ely-se left, cpage_ left 10:31 ely-se joined
timotimo yeah 10:31
but since EventSource is so trivial, it isn't actually much code :)
just had to figure out where exactly it goes in HTTP::Server::Async
10:32 zakharyas joined 10:33 MARTIMM left, cpage_ joined 10:37 virtualsue joined
RabidGravy I made a really noddy implementation for CouchDB change feed (client) last night and am deeply dis-satisfied with it 10:39
so, switching now to longpoll pending making a proper EventSource client 10:40
timotimo my EventSource code doesn't handle resuming or IDs or whatever 10:42
so it's really just a fancy print statement :)
10:47 sno left 10:52 g4 left, g4 joined 10:56 vendethiel joined 11:01 Yabba joined 11:02 Yabba is now known as Guest61844 11:06 sno joined, Guest61844 left 11:07 brrt left
dalek c: 7dc2201 | (Wenzel P. P. Peppmeyer)++ | doc/Language/regexes.pod:
fix runaway C<>
11:16
hahainternet so, another abstract question that i should probably google 11:17
can i specify multiple return values / types / containers? ie can i statically specify "Returns a tuple of Records and RecCount" or whatever?
11:19 vendethiel left
gfldex m: sub foo(--> Array of Int){}; 11:20
camelia ( no output )
11:20 gregf_ left
hahainternet gfldex: it's the two different types inside the same list or similar that i'm interested in specifying, fwiw :) 11:20
gfldex hahainternet: note that this is just a type check. It wont check any containers inside the array
hahainternet oh really? I thought you could do something like Array[Int] to specify, i'm not too up on static typing in p6 11:21
gfldex there is no static typing in Perl 6
hahainternet that is a purely semantic argument
11:22 gregf_ joined
gfldex static typing happens at compile time, dynamic typing happens at runtime 11:22
i can't see where you see semantics in that
moritz Perl 6 does typing at compile time 11:23
m: sub f(Int) { }; f 'sadf'
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EFl8fD4vuq␤Calling f(Str) will never work with declared signature (Int)␤at /tmp/EFl8fD4vuq:1␤------> 3sub f(Int) { }; 7⏏5f 'sadf'␤»
moritz this is compile time, for example
hahainternet 'static typing' typically refers to the ability to restrict the type of a container specifically too
not the 'time' at which the restriction is applied
moritz also, role composition and the associated checks happen at compile time
hahainternet even if what moritz showed only worked at runtime, that's still much closer to static typing than dynamic
11:24 vendethiel joined
lizmat $ perl6 -c -e 'sub f(Int) { }; f "sadf"' 11:24
Syntax OK
technically, that's not at compile time, but it is before INIT time :-)
11:25 kaare_ joined
hahainternet hello and welcome to #semantic-central :D 11:25
anyhow if you can specify tuple types please let me know, i have nothing that requires it
i'm just going through various fp resources
lizmat moritz: which leads me to wonder whether the optimizing step should be part of -c
hahainternet as i'm confident Perl6 thoroughly outpaces Python/Ruby
moritz lizmat: should, maybe 11:26
gfldex having the constant folder fold constants with -c sounds nice 11:27
11:29 travis-ci joined
travis-ci Doc build failed. Wenzel P. P. Peppmeyer 'fix runaway C<>' 11:29
travis-ci.org/perl6/doc/builds/104605479 github.com/perl6/doc/compare/5ecee...c2201e5af2
11:29 travis-ci left
gfldex m: subset Either of Any where * ~~ Int|Str; sub f(--> Either){ rand < 0.5 ?? 1 !! "str" }; f().say for 1..10; 11:31
camelia rakudo-moar d67cb0: OUTPUT«1␤str␤str␤1␤1␤1␤1␤1␤str␤str␤»
gfldex hahainternet: ^^^
travis is no unhappy for a different reason btw 11:32
moritz I'll be offline a few minutes for VM migration 11:33
11:34 ilbot3 left, moritz left
ZoffixWin didn't realize moritz was a robot 11:34
llfourn it's not it's a VM 11:36
11:37 joydo joined
tadzik Virtual Man? 11:38
timotimo that's just, like, you, virtual, man.
your*
lizmat hmmmm.. I wonder whether moritz is migrating irclog.perlgeek.de as well 11:39
as it seems to be down
11:39 xpen left
lizmat PSA: I'm currently working on the P6W, which I will publish after I get back from the AmsterdamX meeting today (about 12 hours from now) 11:40
please let me know of any items you would want to make sure they will be mentioned
11:41 ilbot3 joined
timotimo TYVM, lizmat 11:41
hahainternet oh, so perl6 doesn't have 'tuples' lol
just lists and the like
lizmat so far, I have covered all blog posts and ecosystem updates, FOSDEM, IRC channel additions 11:42
timotimo yeah, but lists are already read-only (unless you bind scalars in)
hahainternet timotimo: it's more the ability to specify that element 0 is type X and 1 is type Y i was interested in
11:43 moritz joined
timotimo oh 11:44
fair enough
lizmat moritz++ # irclog.perlgeek.de is back
hahainternet i believe you can restrict the containers, but i'm not aware of the underlying mechanisms, so all i know of is the usual Array of Whatever type stuff
moritz ... and started automatically through a systemd service file
gfldex m: subset Either of List where *[0] ~~ Int; sub f(--> Either){ 1,"str" }; f().say for 1..10;
camelia rakudo-moar d67cb0: OUTPUT«Type check failed for return value; expected Either but got List␤ in sub f at /tmp/GMW293UpdF line 1␤ in block <unit> at /tmp/GMW293UpdF line 1␤␤»
moritz as opposed to manual start after the last reboot :/
hahainternet gfldex: there's also the problem of that being checked at runtime, but i'm not trying to complain :) 11:45
gfldex m: subset Either of List where { $^a[0] ~~ Int && $^a[1] ~~ Str }; sub f(--> Either){ 1,"str" }; f().say for 1..10; 11:46
camelia rakudo-moar d67cb0: OUTPUT«(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤(1 str)␤»
gfldex m: subset Either of List where { $^a[0] ~~ Int && $^a[1] ~~ Str }; sub f(--> Either){ "str",1 }; f().say for 1..10;
camelia rakudo-moar d67cb0: OUTPUT«Type check failed for return value; expected Either but got List␤ in sub f at /tmp/R4KZkKVLuu line 1␤ in block <unit> at /tmp/R4KZkKVLuu line 1␤␤»
11:46 vendethiel left, virtualsue left
gfldex that doesn't check for excess elements tho 11:46
hahainternet indeed, where clauses are certainly sufficient 11:47
it's not a problem i'm facing in any real code
it just came after some discussion about code in haskell with a friend 11:48
gfldex return type checks do not contribute to MMD, where in heskell they do. In Perl 6 return type checks can keep errors local and that's pretty much it. 11:49
hahainternet well i don't expect perl6 to be as strict as haskell :) 11:51
RabidGravy well I *think* my longpoll version of changes feed is better than the previous hack 11:57
11:59 leont joined 12:00 _Vi left, _Vi joined 12:01 vendethiel joined
lucs Can I get a list of the possible signatures a method has in some class? 12:07
flussence gfldex: your last doc commit deleted half of a =head2 (I'm not at a computer where I can fix it myself or else I would've :) 12:09
gfldex flussence: i'm on it
moritz m: 42.^can('sqrt')>>.candidates>>.signature # for lucs
camelia ( no output )
moritz m: say 42.^can('sqrt')>>.candidates>>.signature
camelia rakudo-moar d67cb0: OUTPUT«(((Int:D $: *%_)) ((Cool $: *%_)))␤»
lucs Thanks moritz
The return types don't happen to show up there, eh ... 12:10
RabidGravy you can always hit .returns 12:13
lucs Oh, okay.
RabidGravy it's possible that the return type isn't actually specified in the code
lucs Yep, I see. 12:14
12:15 _mg_ left 12:24 AlexDaniel joined 12:31 Skarsnik joined
Skarsnik Hello 12:31
12:31 _mg_ joined
RabidGravy erp 12:33
12:34 joydo left 12:35 kid51 joined 12:37 nanis joined
nanis When I clone from rakudo/rakudo, and run perl Configure.pl --gen-moar ..., what determines which MoarVM and nqp snapshots I am going to get? What do I need to do if I just want the tip? 12:39
Skarsnik the tip? 12:40
RabidGravy HEAD 12:41
nanis Yes, I meant HEAD.
It's still early for me.
Is specifying --gen-moar=master the right thing? 12:42
RabidGravy I think that it gets at *least* the version specified
12:42 kid51 left
Skarsnik --build-moar=master probably 12:43
moritz if you leave out the version, it takes the NQP version from tools/bulid/NQP_REVISION
and the NQP repo then has a similar file that specifies the default MoarVM version
so if you just perl Configure.pl --gen-moar, you get the recommended versions
nanis moritz: Thanks for the explanation. 12:44
12:47 vendethiel left
Skarsnik is there something to display number in a nice way? like with 52463 -> 52.463 ? 12:50
AlexDaniel Skarsnik: /1000 ?
Skarsnik: and printf 12:51
DrForr '.' isn't necessarily a decimal separator, I think that's what Skarsnik is after.
AlexDaniel oh
nanis AlexDaniel: What to do with 1000000?
AlexDaniel right, ok 12:52
DrForr (living in a country where the decimal separator is ', ' or "'", and months are in Roman numerals sensitizes you to such things :)
AlexDaniel DrForr: roman numerals are fine. At least it's not some random made up names that don't make any sense 12:53
Skarsnik: it sounds like a great idea for a module
Skarsnik: or perhaps you can manage to get that into printf, hmm… 12:54
DrForr Like names of dead Roman gods make any more sense.
That requires LC_ALL &c.
|Tux| DrForr, as if there are still Roman Gods alive :)
ely-se Roman numerals are great and they are the reason I love INTERCAL.
Skarsnik hm, not sure printf can do that
DrForr ely-se: Slang::Roman :)
It took a great deal of restraint *not* to use Ir for the prefix. 12:55
AlexDaniel why slang? 12:56
m: say Ⅷ
camelia rakudo-moar d67cb0: OUTPUT«8␤»
AlexDaniel well ok it wont work with more than one character 12:57
DrForr say XVII;
ely-se lol
DrForr m: say XVII;
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/UYwm7eWLsC␤Undeclared name:␤ XVII used at line 1␤␤»
RabidGravy Locale specific representations of stuff is probably something that should be in the ecosystem 12:58
ely-se DrForr: unicode.org/cldr/utility/character.jsp?a=2167
AlexDaniel m: say Ⅹ + Ⅶ
camelia rakudo-moar d67cb0: OUTPUT«17␤»
DrForr If I have the tuits I'll use the combining overbar so you can represent numbers in the millions.
Skarsnik hm, to split a string in chuck of a X lenght, what should I use?
DrForr ely-se: It supports Unicode and the full range of Roman numbers. 12:59
Including ↂ
AlexDaniel m: say ↂ 13:00
camelia rakudo-moar d67cb0: OUTPUT«10000␤»
DrForr Incidentally ↀ
(grr.)
AlexDaniel m: say join ‘’, (0..0x1FFFF ==> grep { .uniname ~~ m/‘ROMAN’/ })».chr
camelia rakudo-moar d67cb0: OUTPUT«ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↀↁↂↃↅↆↇↈ𐆐𐆑𐆒𐆓𐆔𐆕𐆖𐆗𐆘𐆙𐆚𐆛𛱍𛱖␤»
DrForr is used on some buildings in Amsterdam.
ely-se Roman numerals are used on lots of buildings.
AlexDaniel .u ↆ 13:01
yoleaux U+2186 ROMAN NUMERAL FIFTY EARLY FORM [Nl] (ↆ)
AlexDaniel m: say ↆ
camelia rakudo-moar d67cb0: OUTPUT«50␤»
AlexDaniel what
ok
DrForr The CD glyph above is what I meant.
13:01 ely-se is now known as ely-se-VI
AlexDaniel .u 𛱍𛱖 13:01
yoleaux No characters found
AlexDaniel m: say ‘𛱍’.uniname; say ‘𛱖’.uniname 13:02
camelia rakudo-moar d67cb0: OUTPUT«DUPLOYAN LETTER ROMANIAN I␤DUPLOYAN LETTER ROMANIAN U␤»
DrForr This module supports 0rXVII + 3 * 0rIX # though.
. o ( Duployan letter... /me looks out of curiosity.)
nanis I am getting literally no output from several tests under t\04-nativecall. Is this expected or should I investigate further?
Skarsnik that weird 13:03
what test?
nanis 06-struct.t, 09-nativecast.t, 11-cpp.t, 12-sizeof.t, 13-union.t, 14-rw-attrs.t, Wstat: 10240, Non-zero exit status: 40 13:04
On Windows 10, cl 19.00.23506
Skarsnik what limit does on split? x) 13:05
hm, that's weird
AlexDaniel m: say ‘helloworldthisisatest’.comb(/.**3/)
camelia rakudo-moar d67cb0: OUTPUT«(hel low orl dth isi sat est)␤»
Skarsnik try running one of them without the harness
AlexDaniel Skarsnik: ↑
ely-se-VI m: vⅥ.c.say
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ci8CWup2f7␤Bogus postfix␤at /tmp/ci8CWup2f7:1␤------> 3v7⏏5Ⅵ.c.say␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement modifier␤ st…»
Skarsnik m: say "Helloworl".split('', 2) 13:06
camelia rakudo-moar d67cb0: OUTPUT«( Helloworl)␤»
Skarsnik hm
AlexDaniel m: say ‘foofoofoofoofoofoo’.split(‘oo’, 2)
camelia rakudo-moar d67cb0: OUTPUT«(f foofoofoofoofoo)␤»
13:07 ely-se-VI is now known as ely-se
AlexDaniel m: say ‘foofoofoofoofoofoo’.split(‘oo’, 4) 13:07
camelia rakudo-moar d67cb0: OUTPUT«(f f f foofoofoo)␤»
nanis Skarsnik: Did that. That's when I thought I would check here first. perl6 t\04-nativecall\14-rw-attrs.t ... literally no output.
Skarsnik Oo
AlexDaniel Skarsnik: limit means that you want to get exactly N pieces
and comb is what you actually want :) 13:08
nanis perl6 --stagestats t\04-nativecall\14-rw-attrs.t
Stage start : 0.000
Stage parse : 13.219
Stage syntaxcheck: 0.000
Stage ast : 0.000
Stage optimize :
end of run
Skarsnik maybe it don't manage to create a lib? 13:09
try running 17 or 18
they don't create file
AlexDaniel, the issue it only capture grp of size 3. it's **1-3 for a range? 13:11
ely-se my @xs = 1, 2, 3, 4; say map(* %% 2, ^@xs.elems)
nanis 18-routine-sig-sanity.t runs fine, 17-libnames.t gives ok i - # SKIP <unknown> for i = 1, ..., 7
ely-se m: my @xs = 1, 2, 3, 4; say map(* %% 2, ^@xs.elems)
camelia rakudo-moar d67cb0: OUTPUT«(True False True False)␤»
ely-se m: my @xs = 1, 2, 3, 4; say @xs[map(* %% 2, ^@xs.elems)] # is there a shorter way of doing this?
camelia rakudo-moar d67cb0: OUTPUT«(2 1 2 1)␤»
ely-se wait, I'm so confused
AlexDaniel m: helloworldthisisatesta’.comb(/.**1..3/)
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Ypzujid8U4␤Bogus postfix␤at /tmp/Ypzujid8U4:1␤------> 3helloworldthisisatesta7⏏5’.comb(/.**1..3/)␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ …»
ely-se m: my @xs = 1, 2, 3, 4; say @xs[grep(* %% 2, ^@xs.elems)] # is there a shorter way of doing this?
camelia rakudo-moar d67cb0: OUTPUT«(1 3)␤»
AlexDaniel m: say ‘helloworldthisisatesta’.comb(/.**1..3/)
camelia rakudo-moar d67cb0: OUTPUT«(hel low orl dth isi sat est a)␤»
AlexDaniel Skarsnik: ↑
Skarsnik nanis, hm, maybe it fail to create the lib file 13:12
for the other test
13:12 sufrostico joined
nanis Skarsnik: How can I begin to diagnose this? Is there any verbosity level etc I can set to see what's going on? 13:12
Skarsnik No idea. edit one test file? or try to run on the tests dir? 13:13
maybe it does not find the compiler
RabidGravy had forgotten that there was a vestigial .procmailrc on the computer
AlexDaniel m: my @xs = 1..4; say @xs.grep: * !%% 2
camelia rakudo-moar d67cb0: OUTPUT«(1 3)␤»
AlexDaniel ely-se: ↑ ?
nanis Skarsnik: I'll work on CompileTestLib.pm in that directory. 13:15
ely-se AlexDaniel: hmm 13:16
Skarsnik m: say "12345".reverse.comb(/.**1..3/).join('.').reverse
camelia rakudo-moar d67cb0: OUTPUT«(123.45)␤»
Skarsnik hm
ely-se AlexDaniel: that filters the elements by themselves, not by their indices 13:17
Skarsnik m: say "12345".comb(/.**1..3/).join('.').reverse
camelia rakudo-moar d67cb0: OUTPUT«(123.45)␤»
AlexDaniel Skarsnik: ah I don't think you want to work with strings like that
Skarsnik Ooh it's flip for string x) 13:19
moritz m: say ('a'..'z')[0, 2 ... *] 13:20
camelia rakudo-moar d67cb0: OUTPUT«(a c e g i k m o q s u w y)␤»
moritz ely-se: ^^
Skarsnik my issue was to display size (ram)
ely-se moritz: yes! great! thanks!
AlexDaniel m: ‘123’ ~~ m/^ (\d+) (\d**2) $/; say “$0.$1” 13:21
camelia rakudo-moar d67cb0: OUTPUT«1.23␤»
13:21 nanis left
AlexDaniel Skarsnik: ↑ you want something like this 13:21
moritz m: say (123 / 100).fmt('%.2f')
camelia rakudo-moar d67cb0: OUTPUT«1.23␤»
AlexDaniel moritz: what if you want another delimiter
s/‘.’/‘,’/ ? :D 13:22
moritz m: say (123 / 100).fmt('%.2f').trans('.' => ',')
camelia rakudo-moar d67cb0: OUTPUT«1,23␤»
13:22 sortiz left
Skarsnik 4-5 Mb leaked at each iteration of my loop x) 13:22
not fun lol
AlexDaniel m: ‘123’ ~~ m/^ (\d*?) (\d**0..2) $/; say "$0,$1" 13:23
camelia rakudo-moar d67cb0: OUTPUT«1,23␤»
moritz Skarsnik: #LolNotLol
jnthn ZoffixWin: In rt.perl.org/Ticket/Display.html?id=127359 I think you got the wrong syntax for adverbs. Should be `41 + 1 :foo<42>`. 13:24
Skarsnik hm, let see if I can get the stack size
13:24 vendethiel joined
AlexDaniel Skarsnik: but anyway, if you don't want to postprocess fmt then perhaps it is a good idea to parse the number yourself with a regex 13:25
Skarsnik I am fine with get-statm<data>.flip.comb(/.**1..3/).join('.').flip for now x) 13:26
DrForr If this is for localization, the number of digits between places needs to be configurable too, India uses 1.00.00.000.000 for instance. 13:27
Skarsnik It just displaying 1564454 445556 make it hard for me to see
ely-se my favourite line of code of the day: gist.github.com/rightfold/82ebf246...ile-pm6-L4 13:29
13:31 brrt joined
Skarsnik I don't remember what is the heap already for a process? 13:32
brrt the heap is where the memory allocator works
Skarsnik it the basic memory? stuff you get with malloc? 13:33
brrt exactly that yes :-) 13:34
its the data structure applied to the pages that the process gets from the memory
Skarsnik I am trying to track down why the elements (a search method) in XML leak 13:35
It's pure perl6 13:36
I lost 5mb for each request on the tree. it's not fun
brrt hmmm
no, that shouldn't happen
sure you're not leaking memory in perl6 space?
creating a reference from a live variable to a temporary one? 13:37
Skarsnik gist.github.com/Skarsnik/5dfb0dce3b517f13d767 based of test. the for loop (I added stuff to show the memory usage)
RabidGravy anyone know a website that *always* returns compress/gzip data? 13:38
Skarsnik a link to a .zip ? 13:39
RabidGravy that is with a Content-Encoding of compress/gzip
not an actual zip file
13:40 _Vi left
RabidGravy ah, good old httpbin 13:40
httpbin.org/gzip
Skarsnik github.com/Skarsnik/fimstuff/archive/master.zip ? 13:41
or it probably generate a zip and give a zip file
I don't know x)
anthk_ what's the syntax to shift bytes to the left in Perl6? 13:45
Skarsnik +<< ?
awwaiid Was there another programming language from which p6 Adverbs was adopted? Or is it an original concept? (obviously there is nothing new under the sun, so let's say... relatively-original)
13:46 vendethiel left
jnthn m: say 8 +< 2 13:47
camelia rakudo-moar d67cb0: OUTPUT«32␤»
13:47 ZoffixW joined
ZoffixW m: multi postcircumfix:<{ }> ($h, $k, :$foo, :$bar) {say "[$foo $bar]" }; my %h = :42foo; say %h<foo>, :foo<meow>, :bar<moo>; 13:48
camelia rakudo-moar d67cb0: OUTPUT«Use of uninitialized value $foo of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub postcircumfix:<{ }> at /tmp/Jau4HTHwtb line 1␤Use of uninitialized value $bar of type Any in string co…»
yoleaux 15 Jan 2016 18:37Z <AlexDaniel> ZoffixW: “roundrobin is very similar to zip. The difference is that roundrobin will not stop on lists that run out of elements but simply skip any undefined value:” (Hotkeys++)
ZoffixW m: multi postcircumfix:<{ }> ($h, $k, :$foo, :$bar) {say "[$foo $bar]" }; my %h = :42foo; say %h<foo> :foo<meow> :bar<moo>;
camelia rakudo-moar d67cb0: OUTPUT«[meow moo]␤True␤»
ZoffixW jnthn, I see. So then the second example that uses the adverb correct doesn't work simply because named parameters are not considered by multi dispatch? 13:49
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow <$foo>"}; say 42 + 1 :foo<42>;
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/Y6ROYpbLVs line 1␤␤»
ZoffixW And if that's the case, then I'd argue there's an inconsitency: my sub gets called if I don't use the named param, but native sub gets called if I do. 13:50
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow <$foo>"}; say 42 + 1; 13:51
camelia rakudo-moar d67cb0: OUTPUT«Use of uninitialized value $foo of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub infix:<+> at /tmp/Pme9w9wueT line 1␤meow <>␤True␤»
ZoffixW m: multi sub infix:<+> (Int:D $a, Int:D $b) {say "meow <$foo>"}; say 42 + 1;
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tCeuK_SjJ6␤Variable '$foo' is not declared␤at /tmp/tCeuK_SjJ6:1␤------> 3ix:<+> (Int:D $a, Int:D $b) {say "meow <7⏏5$foo>"}; say 42 + 1;␤»
ZoffixW m: multi sub infix:<+> (Int:D $a, Int:D $b) {say "meow <foo>"}; say 42 + 1; 13:52
camelia rakudo-moar d67cb0: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int:D $a, Int:D $b)␤ in block <unit> at /tmp/sMv0YnZHKj line 1␤␤»
ZoffixW ^ and clearly it's doing *something* with the named params
moritz it uses them for tie breaking 13:55
Skarsnik brrt, there is no way to query the gc?
brrt no.... unfortunately 13:56
jnthn ZoffixW: Named paramters only act as constraints 13:57
ZoffixW: And an optional parameter isn't constraining in any way
ZoffixW: So you'd need to make it a required named 13:58
ZoffixW jnthn, but it'd still call the wrong sub
m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo is required) {say "meow <$foo>"}; say 42 + 1 :foo<42>;
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/nKg8tx0O0O line 1␤␤»
ZoffixW I'm not sure what it's constraining there...
jnthn m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo is required) {say "meow <$foo>"}; say (42 + 1 :foo<42>);
camelia rakudo-moar d67cb0: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/50RI62n624 line 1␤␤»
jnthn hmm
Skarsnik, brrt: --profile will record some GC stats and you can find them in the report. There's enough to know if you're promoting objects to the old generation a lot or not. 14:00
Skarsnik --profile is not usable on big stuff
brrt i had no idea :-) thanks
ZoffixW And it actually works on postcircumfix: 14:01
m: multi postcircumfix:<{ }> ($h, $k, :$foo, :$bar) {say "[$foo $bar]" }; my %h = :42foo; say %h<foo> :foo<meow> :bar<moo>;
camelia rakudo-moar d67cb0: OUTPUT«[meow moo]␤True␤»
Skarsnik it will be more useful if we could start/stop the profiling x)
ZoffixW m: multi sub postfix:<**> (Int:D $a, :$foo is required) {say "meow <$foo>"}; say 42**2; 14:02
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Gv0X1fY4Ze␤Two terms in a row␤at /tmp/Gv0X1fY4Ze:1␤------> 3 required) {say "meow <$foo>"}; say 42**7⏏052;␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
ZoffixW Weird to get that error :S 14:03
brrt that's not a bad idea. i have no idea whether or not it is difficult to do, although providing an nqp-level op to do so should be the way to go
ZoffixW Ohhh. brainfart on my part
brrt also, i'm not doing it :-P
14:03 molaf joined
ely-se > A computer without COBOL and Fortran is like a piece of chocolate cake without ketchup and mustard. 14:04
jnthn I suspect I'll build a sampling profiler later on in the year, which will also give some line-level info. Then we'll probably make that the default, and leave the current instrumenting profiler there for minute analysis of microbenchmarks - which is what it was really designed for anyway. 14:05
ZoffixW ely-se, hah
Skarsnik my guess is the object holding the xmltree get copied in a weird way on method call? basicly xml elements code is : see if the element match stuff, if not, call element on on the childs...
14:13 cdg joined
Skarsnik jnthn, what should I look in the output the profiler give me? 14:14
14:15 ZoffixW left
jnthn Skarsnik: Look at the GC tab 14:16
Skarsnik: And see if it's promoting bytes every time
I forget which color promoted is :)
Skarsnik stuff get promoted and retained x) 14:17
jnthn retained is normal. Promoted - how much? Significant amounts every time? Also, is there ever a collection marked as a full one?
Promoted means "objects survived two garbage collection runs" 14:18
Skarsnik I don't know how to read that. there 15 'runs' on 70 that get promoted stuff 14:19
jnthn There's a column titled Full Collection or so
And it has a star in if it was a full collection, or empty if not
Skarsnik 170Kb each time, and Full is emtpy
jnthn Ah 14:20
That's interesting.
Skarsnik want a screenshot?
jnthn Does memory grow forever, or does it just get larger to a point, then drop off again?
Skarsnik the file is quite huge
jnthn Can do, though I think I understand what you're seeing.
Skarsnik I keep growing at the same rate until my ram is full/swap
jnthn Urgh, OK 14:21
Skarsnik well not in this run
but in other run
14:21 vendethiel joined
Skarsnik I can stream too maybe, it's more useful 14:21
jnthn It may well be a genuine leak, though it may also be the "unmanaged memory doesn't count" issue. 14:22
Skarsnik imgur.com/Fga4ZQU 14:23
jnthn In short: if objects that reference large native data structures are promoted into the long-life pool, then the amount of memory the GC sees as being promoted is relatively small, but they may be holding onto large amounts of native memory.
Skarsnik gah I cut the first ><
jnthn Wow, lot of green. :) 14:24
Skarsnik 285KB / 177KB / 3635KB
jnthn But yeah, if you're getting unlucky and it's the XML native objects getting promoted, it could be the issue I described.
Skarsnik Well I let the loop run 2 time. the process take 90Mb before the loop 14:25
14:25 go|dfish left, xpen joined
Skarsnik Well it's a big deal for me. I have a bot that fetch a html page every 2 min and I take 1Gb of memory after 24h already xD 14:27
jnthn Skarsnik: I'm tied up with $dayjob stuff at the moment, but you might try a build/install of MoarVM with this patch applied: gist.github.com/jnthn/4fa3dc78457f65240f3b
Yeah, that sounds like a real leak
Rather than the unmanaged sawtooth
Since with the issue I described things do get reclaimed eventually 14:28
AlexDaniel DrForr: what about Slang::CountingRods ? :)
m: say 𝍫 + 𝍢 14:29
camelia rakudo-moar d67cb0: OUTPUT«33␤»
14:30 DHAD05 joined
brrt jnth: what's the green bits 14:30
14:30 xpen left
brrt jnthn 14:30
AlexDaniel m: say 〇 14:31
camelia rakudo-moar d67cb0: OUTPUT«0␤»
DHAD05 Hello
mspo that seems wrong?
jnthn brrt: It's available memory in tospace after a collection
AlexDaniel DHAD05: hi! 14:32
jnthn brrt: Which is equivalent to nursery size - (reclaimed nursery objects + promoted objects)
brrt: Generally, the more of it the better :)
Skarsnik gah rakudo make that does not redo moar make x) 14:33
brrt ah, i see
nice :-)
14:33 brrt left 14:34 DHAD05 left
jnthn Skarsnik: If you just do make install in your Moar build directory you'll be fine 14:34
Skarsnik: Re-installing moar doesn't need a rebuild of NQP/Rakudo
anthk_ how can I seek a file handle? 14:35
jnthn anthk_: .seek method, see doc.perl6.org/routine/seek 14:36
14:36 nanis joined
Skarsnik ah damn, perl6 modules are tie to the perl6 running 14:36
AlexDaniel m: my \u = ‘ABCD’; my \l = ‘abcd’; say [~] u.comb Z~ l.comb
camelia rakudo-moar d67cb0: OUTPUT«AaBbCcDd␤»
AlexDaniel ZoffixWin: ↑ what about this?
ZoffixWin: I really dislike the 「join ‘’」 part 14:37
ZoffixWin: and the parens… 14:38
nanis Happy to report that the problems I was having earlier with native call tests were being caused by an errant -Gy "separate functions for linker" in %CFLAGS% in my environment. With that removed, all native call tests pass.
anthk_ jnthn: $fh.seek() ? 14:41
being $sh a file handle
jnthn anthk_: yes
AlexDaniel ZoffixWin: ah dammit! That's what the first comment says! 14:42
anthk_ Cannot call seek(IO::Handle: Int, Int); none of these signatures match: 14:43
ely-se does NativeCall support volatile?
jnthn anthk_: Yes, I gave you a link to the docs showing how you have to call it above 14:44
14:44 go|dfish joined
ely-se It seems not. :/ In that case how can I distribute C code with a Perl 6 module? 14:45
Skarsnik nanis, nice
volatile? 14:46
RabidGravy ely-se see LibraryMake in the first instance
Skarsnik is that not a c++ stuff?
RabidGravy there are a few examples of modules that do it in the ecosystem
jnthn ely-se: A volatile what, ooc?
ely-se jnthn: equivalent of extern int volatile *p; *p = 0; 14:47
jnthn Ah, on a global
I don't think our optimizer is smart enough to not make every read an actual read yet anyway on those :) 14:48
Skarsnik why would you want to use volatite?
ely-se jnthn: ok :p 14:49
leont There are very few cases where volatile is something you want or need
In general, it does something different from what many people assume
jnthn Not to mention it does different things in different languages. :) 14:50
dalek c: f2972d8 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Callable.pod:
more build fixing
leont That too
jnthn iirc, it's really not strongly defined in C
ely-se jnthn: and in different compilers for the same language
14:50 regreg joined
leont C++11 pretty much deprecated it in favor of atomic loads/saves with explicit memory ordering 14:51
ely-se MSVC guarantees reads and writes from and to volatiles are atomic (lol)
leont: what? no. volatile never had anything to do with atomic loads and stores, and C++ never deprecated it
leont I know, it's the explicit memory ordering that's replacing the volatile
jnthn The C# definition is acquire/release semantics, and so prevents certain re-orderings.
Which is kinda useful. 14:52
leont en.cppreference.com/w/cpp/atomic/memory_order
It's just that you can't really do any sensible memory ordering without it being atomic
ely-se I want to use volatile and clearing to make it less likely passwords end up in crash dumps, and mlock to make them not go to swap 14:53
14:54 skids joined
Skarsnik jnthn, it leaks/grow a bit more now xD 14:55
14:56 sena_kun joined
anthk_ odd, I use $fh.seek(1, 0) to read a byte at a time and it doesn't work 14:56
Skarsnik imgur.com/9Gu1Flh 14:57
leont ely-se: why would volatile help there?
anthk_ it's inside a for loop, I don't know, if I open the file, I understand it would beggin to seek from the byte 0 by default 14:58
ely-se leont: the compiler may otherwise optimise out the assignments
RabidGravy m: $*IN.seek(1,0) 14:59
camelia rakudo-moar d67cb0: OUTPUT«Cannot call seek(IO::Handle: Int, Int); none of these signatures match:␤ (IO::Handle:D $: Int:D $offset, SeekType:D $whence = { ... }, *%_)␤ in block <unit> at /tmp/ek8MKJ_W2Y line 1␤␤»
Skarsnik camelia has empty IO::Handle I think? 15:00
jnthn Skarsnik: Well, you note it does full collects
*you'll
RabidGravy anthk_, why don't you just use .read(1)
jnthn But if it's still leaking with those then yeah, it's a real leak, not the GC sawtooth thing
RabidGravy having first opened the file with :bin
anthk_ RabidGravy: because I am mapping a file to an array byte per byte(as a ROM) 15:01
Skarsnik jnthn, pastebin.com/r9QE1sbZ (I read the memory from /proc/pid/statm)
15:02 nanis left
RabidGravy anthk_, right, why don't you just use .read(1) 15:02
while not $fh.eof { @array[$i++] = $fh.read(1) } 15:03
15:03 yeahnoob left
anthk_ RabidGravy: that could work? 15:03
moritz don't we have a .recv method or so that provides the data in batches as they come in? 15:05
anthk_ the problem is that I have to load the ROM file in the 512th byte, by default from the program counter
15:05 vendethiel left
moritz reading byte by byte sounds a bit slow :-) 15:05
Skarsnik sound like snes rom? x)
anthk_ Skarsnik: chip8 :|
loading fonts into the RAM array was straightforward
RabidGravy should do, infact you should just be able to do "@array = $fh.slurp-rest(:bin).list" 15:06
or something like that
15:07 ely-se left 15:09 vendethiel joined
sena_kun hi guys 15:09
15:09 _Vi joined 15:13 Technaton joined
gfldex m: say 'hi sena_kun!'; 15:14
camelia rakudo-moar d67cb0: OUTPUT«hi sena_kun!␤»
15:14 ely-se joined
sena_kun I have about a week of totally free time(and much of time after), some programming skills and wish to learn perl6 deeper. What can I write(from 'Most wanted' or no) useful for community and interesting enough(where perl6 will be the best choice)? Except for rakudo itself and writing docs. Contributing to already started project is also an option. 15:15
RabidGravy does anyone know of a list of media types that can safely be considered "text" for the purposes of decoding? e.g. "application/xml" , "application/javascript" etc 15:16
Skarsnik hm, use xdg ref? 15:17
or whatever the 'desktop' standard is
DrForr Pull something off the "most wanted" list and go for it? Pretty much everything there is fair game. 15:18
lizmat and a new Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/01/25/...waiting-4/
Skarsnik Oohhh
lizmat for some reason, some "f"'s are not rendering, although they *are* in the source
Skarsnik finally. the monthly weekly !
ugexe m: my $s; $s.?Supply.tap({.say}) # is this a bug or just a `don't do that`
camelia rakudo-moar d67cb0: OUTPUT«(Any)␤»
DrForr Are they too skinny? :)
15:18 travis-ci joined
travis-ci Doc build passed. Wenzel P. P. Peppmeyer 'more build fixing' 15:18
travis-ci.org/perl6/doc/builds/104651352 github.com/perl6/doc/compare/7dc22...972d87daaf
15:18 travis-ci left
lizmat I blame wordpress JS madness 15:18
AlexDaniel just discovered this: strangelyconsistent.org/blog/how-pe...lls-itself
15:19 anthk_` joined
moritz sena_kun: another option is to go to modules.perl6.org, find a module you like, and extend it; many of the modules are rather minimal 15:19
AlexDaniel lizmat: hi! Nice to see you here :)
lizmat commute to AmsterdamX.pm meeting &
.oO( and gone again :-)
15:19 lizmat left
AlexDaniel “reason i ask is because the Perl fans seem to live in caves / don't post their thoughts on the debate” – haha 15:20
15:20 sjoshi left
AlexDaniel well, who knows. Perhaps they're busy getting things done :) 15:20
[Coke] my wife borrowed a book from a coworker on friday, starts reading it. Chapter one is about... Larry Wall. small world.
15:20 anthk_ left
DrForr Still a bitch to paint it. 15:20
ilmari [Coke]: which book? 15:21
moritz [Coke]: do you have any tasks for the 2016.01 with which I could help?
RabidGravy wow, lizmat++ such summarisation :)
moritz [Coke]: I've started to fill out docs/ChangeLog
sena_kun DrForr, hmm, I'll look at it it nobody has something more interesting to advice. Also, this lists need update. 15:22
[Coke] moritz: you working on the branch?
15:23 g4 left
RabidGravy sena_kun, I think the modules list also has the number of issues on the modules, pick something that looks useful with a bunch of issues and fix some 15:23
jnthn ugexe: I think there's a Supply coercer that turns any value into a one-emit on-demand Supply, much like .list makes any item a one-element list.
15:23 _Gustaf_ left
moritz [Coke]: yes 15:23
jnthn ugexe: And it's defined in Any I expect, so everything has it
DrForr sena_kun: Well, if it neds updating, there's something right *there* to work on :)
RabidGravy (checking first that they're not being fixed already)
[Coke] moritz: that's an excellent help, thank you
moritz lizmat++ # blog
AlexDaniel “any time frame for an official Larry Wall release?” – haha, yeah. I wonder when we will release Larry Wall
RabidGravy RELEASE THE BATS! 15:24
DrForr ignores the muffled banging from downstairs.
[Coke] (book) NeuroTribes, I think.
My wife has never met larry, but apparently i mentioned him a few times or something. :) 15:25
moritz [Coke]: somehow that sounds familiar :-)
sena_kun DrForr, I'll send a PR with changes then. Also, is there any point when module stops to be "WIP" and excluded from 'most wanted' list? 15:26
moritz sena_kun: nothing well-defined. When somebody feels it's ready. 15:27
sena_kun moritz, thanks.
[Coke] moritz, niner, jnthn: if we are happy with the point release so far (I have done no review yet!), I am happy to test it out tonight and see if I can cut a release tonight. 15:28
moritz: also, see #perl6-release 15:29
jnthn [Coke]: There's just the matter of those patches from R* 15:31
15:31 vendethiel left 15:35 ely-se left
FROGGS jnthn: I'll take care about that tonight 15:36
[Coke] someone broke the doc build.
... and someone else already fixed it. whee. 15:37
jnthn FROGGS++
15:38 zakharyas left
[Coke] rt.perl.org/Ticket/Display.html?id=127363 should be easy to fix... 15:38
AlexDaniel How can I write unicode symbols by using hex codes? 15:40
ilmari m: say "\c[U+666]" 15:41
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/m7mzutzkHN␤Unrecognized character name U+666␤at /tmp/m7mzutzkHN:1␤------> 3say "\c[U+6667⏏5]"␤»
ilmari m: say "\c[0x0666]"
camelia rakudo-moar d67cb0: OUTPUT«٦␤»
ilmari m: say "\c[0x666]".uniname
camelia rakudo-moar d67cb0: OUTPUT«ARABIC-INDIC DIGIT SIX␤»
moritz m: say unival("\c[0x666]")
camelia rakudo-moar d67cb0: OUTPUT«6␤»
jnthn \x666 15:42
ilmari m: say "\x666"
camelia rakudo-moar d67cb0: OUTPUT«٦␤»
AlexDaniel m: say “\c[U+1F926]”
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qGcWOOm5nh␤Unrecognized character name U+1F926␤at /tmp/qGcWOOm5nh:1␤------> 3say “\c[U+1F9267⏏5]”␤»
15:42 khw joined
moritz m: say unival("\c[666]") 15:42
camelia rakudo-moar d67cb0: OUTPUT«NaN␤»
moritz m: say unival("\x[666]") 15:43
PerlJam m: say "\c[COMET]"; # too
camelia rakudo-moar d67cb0: OUTPUT«6␤»
rakudo-moar d67cb0: OUTPUT«☄␤»
moritz \x[...] for hexadecimal input
\c is for de*c*imal, usually
ilmari thought it stood for "character"
AlexDaniel I'm confused, so how do I write U+1F926 ? 15:44
jnthn ilmari: Me too :)
Juerd ilmari: It originally did :)
15:44 Peter_R left
Juerd Specifically, like in C's 'char' 15:44
moritz AlexDaniel: by removing the leading U+ 15:45
Juerd I recall having read that, but references to it seem to have been carefully cleaned up. Or maybe I dreamt it.
Skarsnik is a fork routine planned? or what I can I do as a workaround for my leak issue? x)
AlexDaniel moritz: like?
mspo someone probably needs to start a POSIX
15:45 Peter_R joined
geekosaur > say unival("\x[1f926]") 15:46
DrForr Not it :)
PerlJam mspo: I thought someone already had.
15:46 lokien_ joined
anthk_` m: say (0x02 +< 8 || 0x0c +< 4).fmt("%04x"); 15:46
camelia rakudo-moar d67cb0: OUTPUT«0200␤»
geekosaur beh
too tired
moritz m: say "\x[1F926]"
camelia rakudo-moar d67cb0: OUTPUT«🤦␤»
moritz m: say "\x[1F926]".uniname
camelia rakudo-moar d67cb0: OUTPUT«<reserved>␤»
AlexDaniel oh with \x
moritz AlexDaniel: ^^
AlexDaniel okay, thanks
moritz you're welcome
PerlJam mspo: github.com/cspencer/perl6-posix 15:47
mspo github.com/cspencer/perl6-posix
but it doesn't seem to have fork
moritz pull request to add it?
Skarsnik Well I tried using fork with NC, but it did not end well 15:48
diakopter m: "\x[99999999]"
camelia rakudo-moar d67cb0: OUTPUT«===SORRY!===␤chr codepoint cannot be negative␤»
Skarsnik it block some other NC code
AlexDaniel diakopter: yeaaaaah……
15:48 raiph joined
diakopter AlexDaniel: ? 15:49
AlexDaniel diakopter: another overflow :)
AlexDaniel silently hates RT. Searching for 99999 opens a ticket with id 99999 15:51
diakopter #125817
DrForr I'd just like to be able to *view* a bug that I submitted...
AlexDaniel m: say chr 99999999 15:52
camelia rakudo-moar d67cb0: OUTPUT«(signal SEGV)»
AlexDaniel segmentation fault!
hooray!
“closable with tests” right?
diakopter well it was previously
now it needs tests AND another fix 15:53
MadcapJake does List.map set the topic variable? 15:55
yeah looks like it does 15:56
moritz MadcapJake: it just invokes the callable you pass to it
AlexDaniel m: say chr 9999999999
camelia rakudo-moar d67cb0: OUTPUT«(signal SEGV)»
AlexDaniel m: say chr 999999999999
camelia rakudo-moar d67cb0: OUTPUT«chr codepoint cannot be negative␤ in block <unit> at /tmp/jicTmB4rt5 line 1␤␤»
moritz MadcapJake: and if that callable is a block without explicit signature, then -> $_? is rw {} is the default signature (or similar)
MadcapJake moritz: cool, thanks for the explanation! 15:57
moritz m: say ({$_}).signature.perl
camelia rakudo-moar d67cb0: OUTPUT«:(;; $_? is raw)␤»
moritz ok, is raw, not rw
AlexDaniel m: say chr 999999999999999999999999999
camelia rakudo-moar d67cb0: OUTPUT«Cannot unbox 90 bit wide bigint into native integer␤ in block <unit> at /tmp/UhwBhUHUEP line 1␤␤»
MadcapJake what's the raw trait mean?
hoelzro o/ #perl6
moritz MadcapJake: "bind rw if possible, but fall back to ro"
MadcapJake: whereas rw dies if it can't bind to a writable container 15:58
MadcapJake interesting!
15:59 kubrat left
[Coke] tries to respond to ki51's latest ticket... diplomatically. 16:01
*kid51
geekosaur heh 16:02
actually getting git and curl from macports/homebrew/whatever plus whatever is provided to get updated certs (since it uses the OS certs by default and those are almost certainly too old/expired) might be eough
[Coke] m: say chr 999999999999 16:03
camelia rakudo-moar d67cb0: OUTPUT«chr codepoint cannot be negative␤ in block <unit> at /tmp/_Cw6TPM0xC line 1␤␤»
[Coke] m: say chr 99999999
camelia rakudo-moar d67cb0: OUTPUT«(signal SEGV)»
[Coke] huh. nifty.
geekosaur we go through this with macports too "why don't you support <x> on 10.5/ppc?" "we don't *have* 10.5/ppc. if you do, become maintainer for <x>"
can't build ppc on buildbots, etc. 16:04
16:06 jernster joined 16:16 _Vi left
ugexe should it be best practice to declare/request dists with `-` instead of `::`? then you can differentiate between the two 16:18
16:19 leont left, psy_ joined
ugexe differentiate dists and modules that is 16:19
so meta6 would be `Foo-Bar` and in your provides you might have your "Foo::Bar" (or maybe not if the dist doesnt provide such a module) 16:20
16:22 ParsonsNose joined 16:25 zakharyas joined 16:28 chacewells joined
chacewells hi all. i'm trying to figure out the idiomatic way to pipe print and say statements to an external command 16:28
dalek c: 133f3e7 | (Wenzel P. P. Peppmeyer)++ | doc/Language/regexes.pod:
fix heading
16:31 Fleurety left, mohae left 16:32 sena_kun left, mohae joined 16:33 virtualsue joined 16:35 pmurias joined
pmurias fork is not built in? 16:35
Skarsnik I think run has stuff for it? 16:36
geekosaur fork isn't portable :(
you should see the horrible hacks cygwin uses to fake it 16:37
16:37 alpha123 joined
geekosaur (and of course perl 5 ithreads staretd out as a workaround for no fork() on Windows) 16:37
[Coke] run returns a Proc. see docs.perl6.org/type/Proc
chacewells yeah. i'm trying to figure it out. in perl5, i'm pretty sure you would just go "open my $cmd, '-|', 'uniq'"
oh cool. thanks 16:38
[Coke] chacewells: don't thank me yet, the docs might not help.:) 16:39
pmurias fork doesn't seem to be supported on the jvm even on linux, so keeping it in a module might make sense 16:40
chacewells haha that's been my experience
it's almost like there's *too* much documentation 16:41
mspo yes, go to the lowest common denominator ;)
16:42 jdrab left 16:45 sena_kun joined 16:46 leont joined
AlexDaniel chacewells: just use run 16:47
16:48 Calibellus joined
AlexDaniel chacewells: run(‘cmd’, ‘arg1’, :in(…)) 16:48
chacewells: what has to go into :in() is a good question though!
hmm
perhaps it's just :in and then you can print into .in
16:49 Fleurety joined, maslan left 16:50 MARTIMM joined
chacewells AlexDaniel: that seems to make sense. 6's IO model def takes some getting used to 16:50
i think it would be $*IN 16:51
AlexDaniel chacewells: my $r = run(‘cat’, :in); $r.in.say(‘hello world’);
chacewells: sure enough you have to .in.close; it afterwards 16:52
chacewells: is that what you want?
16:52 FROGGS left
alpha123 that's dope actually 16:52
chacewells ooooh
alpha123 proceeds to steal the idea of Proc#in for his toy little language 16:53
chacewells so :in is basically saying "yes, this gets an input stream"
16:53 domidumont left
AlexDaniel chacewells: yes 16:53
chacewells: and you can specify what it gets
chacewells that's friggin awesome. i'm so excited about 6! 16:54
16:54 xinming left 16:55 xinming joined
AlexDaniel chacewells: for example, you can try this: 16:55
chacewells: my $r1 = run(‘echo’, ‘hello world’, :out); my $r2 = run(‘cat’, :in($r1.out));
chacewells ic 16:56
AlexDaniel chacewells: also note that this way we are not working with shell, so all shell problems are gone
chacewells: that being said you can still change 「run」 to 「shell」 and it will work too
though you obviously can't pass separate args this way to shell, so you just smash it into one vulnerable string :) 16:57
e.g. shell(‘echo hello world’)
but :out and :in should work exactly the same way
chacewells so great. OO, yet concise 16:58
AlexDaniel chacewells: one thing that is not so concise is when you want to slurp everything into a variable. In that case it is 「my $x = run(…, :out).out.slurp-rest;」 16:59
chacewells: so you specify that you want the output. then you get it and then you slurp everything from it. Sure enough it makes sense, but it is a bit painful to type :) 17:00
chacewells: as for the docs, see this: doc.perl6.org/type/Proc 17:01
17:02 leont left
AlexDaniel which actually mentions everything that I've said earlier :) 17:02
Technaton Hello, everybody! :) I'm a long-time perl5/ruby user who wants to try Perl6. The first task I've set for myself is "read a long string from stdin and decode it as JSON", but I'm already stuck --- is there a way to slurp STDIN? 17:04
AlexDaniel alpha123: I'd say that this is actually not good enough. So feel free to make piping even easier in your own toy language :)
alpha123: because people still get back to shell for some reason 17:05
alpha123: e.g. they want args to be separated automatically and they want piping to be easy
alpha123 supposes he could overload the pipe (|>) operator for procs 17:06
hoelzro Technaton: $*IN.slurp-rest should do it
AlexDaniel no
it is actually easier
m: my $x = slurp; 17:07
camelia ( no output )
AlexDaniel m: my $x = slurp; say $x
camelia rakudo-moar d67cb0: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
hoelzro oh, good point AlexDaniel
Technaton Hah, yes, that works. I actually tried $*IN.slurp-rest, but my script just died on me. I now know why --- JSON::Tiny eats up all the memory. And I though I'd so something wrong and it waits for EOF endlessly... 17:08
Thanks! 17:09
17:09 laz78 joined
AlexDaniel Technaton: so the answer to your task is: say from-json slurp 17:09
m: say from-json slurp 17:10
camelia rakudo-moar d67cb0: OUTPUT«Invalid JSON: Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleannt…»
AlexDaniel fair enough! 17:11
Technaton AlexDaniel: Thanks! Yes, I see that now. :) Now lets just try to find a replacement for JSON::Tiny that doesn't eat my 16G RAM in order to parse a 82MB JSON file.
:)
AlexDaniel m: say from-json “\{ "data": "{slurp}" \}”
camelia rakudo-moar d67cb0: OUTPUT«Invalid JSON: { "data": "Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bh…»
MARTIMM camelia: Just a moment and you get perl6 to sing it 17:12
awwaiid Technaton: If you are feeling particularly experimental, you could try: use Inline::Ruby; ruby_require 'json', :import<JSON>; my $data = JSON.parse("yourdata.json"); ...
alpha123 lol
17:13 sufrostico left
Technaton awwaiid: Actually Ruby would be my go-to solution at the moment for any type of "parse this JSON and extract some data from it"-20-lines script. 17:13
AlexDaniel Technaton: what about this? modules.perl6.org/#q=json%20fast
Technaton I just thought I'd give Perl6 a shot today, because... why not?
AlexDaniel Technaton: it says that it is a drop-in replacement
17:14 sufrostico joined
AlexDaniel “Currently it seems to be about 5x faster and uses up about a fourth of the RAM.” – perhaps it is not good enough, but try it 17:14
Technaton AlexDaniel: Switched over a minute ago. Currently uses 2G without any output (on moarVM). "kill -TERM" it is... :/
AlexDaniel Technaton: Doh! 17:15
Technaton The JSON doesn't contain any loops or similar, I created the program that outputs it. (And reads it back in, actually.)
17:16 colomon left
AlexDaniel m: say from-json “\{ "data": "{slurp.trim}" \}” 17:16
camelia rakudo-moar d67cb0: OUTPUT«Invalid JSON: { "data": "Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bh…»
AlexDaniel m: say from-json “\{ "data": "{slurp.tr(“\n”, ‘’)}" \}”
camelia rakudo-moar d67cb0: OUTPUT«Method 'tr' not found for invocant of class 'Str'␤ in block <unit> at /tmp/vGifUlahkn line 1␤␤»
17:16 colomon joined
AlexDaniel m: say from-json “\{ "data": "{slurp.trans(“\n” => ‘’)}" \}” 17:17
camelia rakudo-moar d67cb0: OUTPUT«data => Céad slán ag sléibhte maorga Chontae Dhún na nGallAgus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luíI mo dhiaidh bhí gleanntáin ghlas’ Gh…»
AlexDaniel yeaaaaaah!
alpha123 why is that #trans and not #tr
AlexDaniel #askadesigner 17:18
dalek c: abe314f | (Zoffix Znet)++ | doc/Type/IO.pod:
Fix broken link
autarch m: my @foo = < x 1 y 7 >; my %bar = @foo; say %bar.perl 17:25
camelia rakudo-moar d67cb0: OUTPUT«{:x(IntStr.new(1, "1")), :y(IntStr.new(7, "7"))}␤»
17:27 zakharyas left
AlexDaniel m: say IntStr.new(42, ‘69’).perl 17:27
camelia rakudo-moar d67cb0: OUTPUT«IntStr.new(42, "69")␤»
AlexDaniel hmmmmmm
17:27 maslan joined 17:28 sQuEE is now known as sQuEE`, dakkar_ left
Technaton Okay, neither JSON::Tiny nor JSON::Fast can actually parse the 82M JSON dump. :( Argh, and I though that calculating the eucledean distance of a number of vectors would be a nice opportunity to try Perl6… Well, something else will come up. :) 17:29
17:30 pi4 left
AlexDaniel Technaton: what about Inline::Ruby solution above? 17:31
if something works faster somewhere else, just steal it :)
Technaton That feels awfully like cheating. ;-)
AlexDaniel but you can still be comfortably using Perl 6 as a glue
moritz Technaton: cheating is technique 17:32
alpha123 Technaton: I prefer "borrowing existing implementations"
ilmari alpha123: "leveraging" 17:33
alpha123 ah yes, that's the word i was looking for
good artists reimplement, great artists leverage existing solutions
Technaton Uuuuh. Okay, marketing did its job wonderfully, I'll try using Ruby's parser. 17:34
jdv79 Technaton: maybe someday that will work; hopefully
17:34 yqt joined
alpha123 Technaton: Rakudo is not particularly fast at the moment. Sorry :((( 17:34
autarch when I write "my %foo = @bar" what is actually happening under the hood? is this a coercion? how does p6 know how to coerce an array to a hash? 17:35
AlexDaniel Technaton: well, actually it is not so much about cheating, it is more about glueing
Technaton alpha123: I don't expect miracles, no worries. And I want to try a new language that has just seen its Christmas release, so... Who am I to complain?
AlexDaniel Technaton: NativeCall and Inline::* are very useful tools :)
Technaton I'll keep that in mind, thanks. 17:36
alpha123 autarch: well %foo is a hash and @bar is an array so it does what you tell it to....
Technaton I was just worried about the RAM consumption. I left Rakudo with JSON::Tiny to work on my JSON file and went to eat something, and when I came back, the OOM killer had terminated it. So I naturally thought I did something very, very wrong.
jnthn autarch: It calls %foo.STORE(@bar). STORE iterates @bar. If it sees a Pair object it uses its key/value properties. Otherwise, it just uses things as keys and values in turn 17:37
17:37 pi4 joined
alpha123 Technaton: that doesn't seem quite right 17:37
autarch jnthn: thanks
pmurias creating Perl 6 hashes in NativeCall'ed C code is not supported by design? 17:38
pmurias thinks how possible it would be to create a JSON parser that works fully in C code 17:39
Technaton AlexDaniel, alpha123: FYI, using Ruby's JSON parser worked like a charm. Thanks!
jdv79 i think there are plenty to link up with pmurias:) 17:40
AlexDaniel OK on the similar topic: is there anything that will do the job of HTML::Parser::XML but faster? 17:41
it doesn't eat 16 gigs of ram but it takes about 15 seconds to parse a page – not good enough in my particular task
17:41 _mg_ left
jdv79 I::P5 + those modules (HTML::Builder, TokeParser, etc...) ? 17:41
AlexDaniel any recommendations? Some perl or ruby module?
pmurias jdv79: the hard part would be to minimalize the NativeCall overhead 17:42
AlexDaniel I don't have to generate HTML, just parse it 17:43
jdv79 isn't it just "here's a json text. give me back a p6 structure"? how does that have high NC overhead?
AlexDaniel: #perl sayd Mojo::DOM is what the cool kids use. 17:44
AlexDaniel jdv79: interesting 17:45
17:46 sena_kun left
jdv79 back in the day i used the HTML::Tree dist 17:46
17:48 sQuEE` is now known as sQuEE
jdv79 i think an interesting way forward may be libxml bindings but i think froggs was doing that a while ago 17:48
dalek rl6-most-wanted: d5598cf | Altai-man++ | most-wanted/bindings.md:
Update.
17:49
rl6-most-wanted: 3a9b294 | (Zoffix Znet)++ | most-wanted/bindings.md:
Merge pull request #15 from Altai-man/master

Update
17:49 lokien_ left 17:50 konobi left 17:52 ely-se joined 17:53 ely-se left, ely-se joined
ely-se is there a shorter form of @l.map({$o.m($_)})? 17:56
i.e. pass argument to method in map
in python you can do map(o.m, l)
gfldex @l>>.m
ely-se no, that calls .m on the elements of l 17:57
I want to call m on $o passing the elements of l as argument
AlexDaniel ely-se: @l.map($o.m: *)
ely-se: isn't it short enough?
ely-se m: my @xs = 1, 2, 3; @xs.map($*OUT.print: *)
camelia rakudo-moar d67cb0: OUTPUT«*Cannot call map(Array: Bool); none of these signatures match:␤ ($: Hash \h, *%_)␤ (\SELF: &block;; :$label, :$item, *%_)␤ (HyperIterable:D $: &block;; :$label, *%_)␤ in block <unit> at /tmp/62uybjhMne line 1␤␤»
ely-se m: my @xs = 1, 2, 3; @xs.map(* ==> $*OUT.print) 17:58
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LdHcH6SJ76␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/LdHcH6SJ76:1␤------> 3my @xs = 1, 2, 3; @xs.map(*7⏏5 ==> $*OUT.print)␤ expecting any of:␤ infix…»
ely-se m: my @xs = 1, 2, 3; @xs.map(* ==> $*OUT.print())
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YNdTyEswZ5␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/YNdTyEswZ5:1␤------> 3my @xs = 1, 2, 3; @xs.map(*7⏏5 ==> $*OUT.print())␤ expecting any of:␤ inf…»
ely-se m: my @xs = 1, 2, 3; @xs.map(* ===> $*OUT.print)
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/2HRhsTET1F␤Preceding context expects a term, but found infix > instead␤at /tmp/2HRhsTET1F:1␤------> 3my @xs = 1, 2, 3; @xs.map(* ===>7⏏5 $*OUT.print)␤»
ely-se I forgot that syntax :P
whatever :P
17:59 SCHAAP137 joined, abraxxa left
AlexDaniel right 17:59
18:00 _mg_ joined
AlexDaniel m: my @xs = 1, 2, 3; @xs.map: { $*OUT.print: $_ } 18:01
camelia rakudo-moar d67cb0: OUTPUT«123»
AlexDaniel yeah it feels like it is the easiest way
hmmm
ely-se ok :) 18:02
ilmari huh, why doesn't $x.y(*) return WhateverCode?
AlexDaniel ely-se: why do you even use map in this case?
m: my @xs = 1, 2, 3; $*OUT.print($_) for @xs 18:03
camelia rakudo-moar d67cb0: OUTPUT«123»
ely-se AlexDaniel: I need the results of the function calls
like "return @data.map({$parser.def($_)});"
TimToady ilmari: only operators can autocurry arguments 18:04
AlexDaniel m my @xs = 1, 2, 3; my @data = [$*OUT.print($_) for @xs]; say @data 18:05
m: my @xs = 1, 2, 3; my @data = [$*OUT.print($_) for @xs]; say @data
camelia rakudo-moar d67cb0: OUTPUT«123[True True True]␤»
AlexDaniel ely-se: what about this? ↑
ely-se and only _some_ operators can as we saw yesterday :)
AlexDaniel: hey cool I didn't know that
TimToady all but a few exceptions, to be more precise
AlexDaniel m: my @xs = 1, 2, 3; my @data = gather take $*OUT.print($_) for @xs; say @data 18:06
camelia rakudo-moar d67cb0: OUTPUT«123[True True True]␤»
AlexDaniel it is funny to see 「gather take」 being written like this 18:07
TimToady m: my @xs = 1, 2, 3; my @data = ($*OUT.print($_) for @xs); say @data 18:08
camelia rakudo-moar d67cb0: OUTPUT«123[True True True]␤»
18:08 pmurias left
AlexDaniel TimToady: any difference between () and [] in this case? 18:09
TimToady () doesn't make an Array
jnthn (and so will be cheaper, though semantically they'll do the same)
ely-se m: [1, 2, 3].WHAT.say; (1, 2, 3).WHAT.say;
camelia rakudo-moar d67cb0: OUTPUT«(Array)␤(List)␤»
18:10 maslan left 18:11 addison joined
AlexDaniel m: my @xs = 1, 2, 3; my @data := ($*OUT.print($_) for @xs); say @data 18:11
camelia rakudo-moar d67cb0: OUTPUT«123(True True True)␤»
AlexDaniel m: my @xs = 1, 2, 3; my @data := [$*OUT.print($_) for @xs]; say @data
camelia rakudo-moar d67cb0: OUTPUT«123[True True True]␤»
AlexDaniel what about these?
gfldex m: my &f = &print.assuming($*OUT); f(1);
camelia rakudo-moar d67cb0: OUTPUT«This type cannot unbox to a native string␤ in sub __PRIMED_ANON at EVAL_2 line 4␤ in sub __PRIMED_ANON at EVAL_2 line 1␤ in block <unit> at /tmp/XG9Xorlcdk line 1␤␤»
18:11 FROGGS joined
FROGGS o/ 18:13
jnthn: hi, I tried to tackle rt.perl.org/Ticket/Display.html?id=127306 18:15
jnthn: do you know why gist.github.com/FROGGS/2dca7df3cb040da864a3 is not enough?
jnthn: is it because the returns trait runs outside of the routine?
jnthn No, it's a static/dynamic confusion 18:17
You're trying to do the generic instantiation at compile time
Whereas it actually needs instantiating at runtime, just before the check.
FROGGS hmmm, I was thinking about that too...
jnthn The archetypes check is right, but we need to generate code that does a lexical lookup of the name
And checks against that 18:18
FROGGS okay, thank you :o)
jnthn I'd probably do it in the Actions
FROGGS yeah
jnthn Or at least, that'd be where I'd think to look first.
ely-se m: @xs = 1, 2; "@xs[0]".say
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IryEZX6aGO␤Variable '@xs' is not declared␤at /tmp/IryEZX6aGO:1␤------> 3<BOL>7⏏5@xs = 1, 2; "@xs[0]".say␤»
ely-se m: my @xs = 1, 2; "@xs[0]".say
camelia rakudo-moar d67cb0: OUTPUT«1␤»
ely-se interesting
FROGGS ely-se: and correct 18:19
18:19 ZoffixW joined
ZoffixW This looks buggered: 18:19
m: multi infix:<+> (Int $a, Int $b) { $a - $b }; say 10 + 5 18:20
camelia rakudo-moar d67cb0: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int $a, Int $b)␤ in block <unit> at /tmp/7bIu5QJLzG line 1␤␤»
ZoffixW m: multi infix:<+> (Int:D a, Int:D b --> Int:D) { a - b }; say 10 + 5
camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iz2L7Zqtc7␤Malformed parameter␤at /tmp/iz2L7Zqtc7:1␤------> 3multi infix:<+> (Int:D7⏏5 a, Int:D b --> Int:D) { a - b }; say 10␤ expecting any of:␤ constraint␤ formal parameter␤»
ZoffixW oh
AlexDaniel ely-se: why is it interesting?
ZoffixW I'm not getting that locally. I'm getting "ambiguous call"
AlexDaniel ely-se: is it a surprise that double quotes interpolate vars? 18:21
ZoffixW Oh right... Of course I'll be getting it
multi infix:<+> (Int:D \a, Int:D \b --> Int:D) { a - b }; say 10 + 5
m: multi infix:<+> (Int:D \a, Int:D \b --> Int:D) { a - b }; say 10 + 5
camelia rakudo-moar d67cb0: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int:D \a, Int:D \b --> Int:D)␤ in block <unit> at /tmp/vuyBkjFa3N line 1␤␤»
Skarsnik AlexDaniel, Gumbo to parse HTML with real speed 18:22
ilmari should it let you declare a multi that exactly matches an existing one?
AlexDaniel m: say “{my @xs = 1, 2; @xs[1]}” # this is slightly more interesting though
camelia rakudo-moar d67cb0: OUTPUT«2␤»
ZoffixW m: multi infix:<+> (Int:D \a, Int:D \b --> Int:D) is tighter( &infix:<+> ) { a - b }; say 10 + 5 18:23
camelia rakudo-moar d67cb0: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int:D \a, Int:D \b --> Int:D)␤ in block <unit> at /tmp/zbAxMwWhyH line 1␤␤»
AlexDaniel Skarsnik: interesting. Thanks
ZoffixW Is there a way to make addition behave like subtraction is my question, I guess :) 18:24
Skarsnik AlexDaniel, if you want a comparaison, h:p:x take
AlexDaniel Skarsnik: h:p:x what?
Skarsnik 36 sec to parse the 250kB file I need vs 0.02 sec for the C parse of gumbo
html:parse:xml
18:25 espadrine left
AlexDaniel hmmm 18:25
ZoffixW m: my int32 $x = 42; say $x + 10e0; 18:28
camelia rakudo-moar d67cb0: OUTPUT«52␤»
ZoffixW How does this work? The candidates for + do not have int32 at all, or even int + Num
Ah, but there is ($a, $b) and (\a, \b).... never mind me 18:29
AlexDaniel m: my int32 $x = 42; $x += 2⁶⁴; say $x
camelia rakudo-moar d67cb0: OUTPUT«Cannot unbox 65 bit wide bigint into native integer␤ in block <unit> at /tmp/2hMx91X50o line 1␤␤»
AlexDaniel m: my int32 $x = 42; $x += 2⁴⁰; say $x 18:30
camelia rakudo-moar d67cb0: OUTPUT«42␤»
18:30 ParsonsNose left
AlexDaniel ?? 18:30
ZoffixW m: my int32 $x = 42; $x++ for 2⁶⁴; say $x
camelia rakudo-moar d67cb0: OUTPUT«43␤»
ZoffixW AlexDaniel, weird :S 18:31
18:31 ugexe left
AlexDaniel m: my int32 $x = 42; $x++ for 2⁶³; say $x 18:31
camelia rakudo-moar d67cb0: OUTPUT«43␤»
ZoffixW :S
AlexDaniel :/
ZoffixW Ah
Right
m: my int32 $x = 42; $x++ for ^2⁶⁴; say $x
AlexDaniel haha yeah
camelia rakudo-moar d67cb0: OUTPUT«(timeout)» 18:32
AlexDaniel nah it's not gonna make it
ZoffixW It's weird that it takes 2^40 but not 2&64
AlexDaniel m: my int32 $x = 42; $x += 2²⁰; say $x
camelia rakudo-moar d67cb0: OUTPUT«1048618␤»
AlexDaniel m: my int32 $x = 42; $x += 2³⁰; say $x
camelia rakudo-moar d67cb0: OUTPUT«1073741866␤»
AlexDaniel m: my int32 $x = 42; $x += 2³⁵; say $x 18:33
camelia rakudo-moar d67cb0: OUTPUT«42␤»
AlexDaniel :S
ilmari because moarvm native ints are 64bit
ZoffixW m: my int32 $x = 42; $x += 2⁶³; say $x
camelia rakudo-moar d67cb0: OUTPUT«42␤»
AlexDaniel ilmari: on 64-bit system or everywhere?
ilmari AlexDaniel: everywhere
well, registers have slots of every signedness and size, but the native int ops use the i64 slot 18:36
18:36 konobi joined, konobi is now known as Guest36303 18:38 Guest36303 is now known as konobi_
AlexDaniel Skarsnik: and why you didn't mention that you've already made a Gumbo module for perl6? 18:39
:)
awesome
Skarsnik: thank you very much
masak greetings, #perl6
ZoffixW \o 18:40
ely-se given "multi method m(T:D $xs) { }", is it possible to get an error "Type check failed in binding $xs"? as opposed to "none of these signatures match"
if so, how?
AlexDaniel ilmari: so it is a bug or not?
ilmari: I don't see any exception thrown
dalek kudo-star-daily: 2952a92 | coke++ | log/ (6 files):
today (automated commit)
18:41
AlexDaniel Skarsnik: oh, and it also returns XML::Document! Almost a drop-in replacement for HTML::Parser::XML !! This is so awesome 18:43
18:44 spider-mario joined
ely-se because I did get that error and I have no idea how it could happen 18:44
masak ely-se: you could provide a fall-back multi that matches when nothing else does. 18:45
ely-se: that's what I tend to do.
AlexDaniel Skarsnik: yeah, it is around 10 times faster indeed. Thank you
ely-se masak: yeah, but why the weird error?
masak ely-se: because multis can look in so many ways, and there's not a guarantee that there's a $xs in all signatures 18:46
s/look in so many ways/be extremely heterogenous/
AlexDaniel huggable: parse html :is: github.com/Skarsnik/perl6-gumbo
huggable AlexDaniel, Added parse html as github.com/Skarsnik/perl6-gumbo
18:47 maslan joined
ely-se masak: I expected the error "none of these signatures match" but I got "Type check failed in binding" 18:47
18:47 domidumont joined
[Coke] gives up on backscroll for the weekend, ah well. 18:48
ZoffixW :D
Skarsnik AlexDaniel, the idea is when supercedes exists you can replace h:p:x with gumbo::parser xD
masak ely-se: oh!
ely-se: that... surprises me too o.O
ely-se I can't seem to figure out a smaller test case though 18:49
jdv79 [Coke]: i gave up a few weeks ago 18:50
and am now kinda lost
maybe text-to-speeching it while i sleep and i'll just wake up in sync 18:51
masak induce a trance-like state, and put the backlog on repeat
jdv79 probably have too many nightmares that way though so maybe not
[Coke] blogs (unusual!) at blogs.perl.org/users/coke/2016/01/p...-soon.html
ZoffixW I'm thinking of ideas for my Perl 6 talk. It's titled "Wow, Perl 6!" and it'll be just a 1-hour overview of all things cool in Perl 6. Here are the topics I jotted down so far. Do you see if missed something cool? Something that'd make the audience go "Wow" when I show it? gist.github.com/zoffixznet/5d28d64190c6a64c6711
ely-se masak: oh wait, it is the case that the methods are in a role that is added to a class with .^add_role
maybe I forgot to do something silly 18:52
[Coke] ZoffixW: I'd make grammars a top level thing, but otherwise, looks like at least an hours worth of time.
18:53 zhmylove left, firstdayonthejob joined
masak m: class T {}; role R { multi method m(T:D $x) {} }; class C does R {}; C.new.m(42) 18:53
camelia rakudo-moar d67cb0: OUTPUT«Cannot call m(C: Int); none of these signatures match:␤ (C $: T:D $x, *%_)␤ in block <unit> at /tmp/e5ZhehVonQ line 1␤␤»
masak ely-se: how do you mean 'with .^add_role' ?
18:53 ugexe joined
ZoffixW Cool. Thanks. 18:54
masak ely-se: could you adapt the above one-liner to show what you mean?
ely-se masak: ah I got it 18:55
this reproduces it: gist.github.com/rightfold/f536f9be6d4729ec8377 18:56
masak looks 18:57
ely-se the last line causes the error 18:58
it doesn't seem to happen if R is a class and the whole Metamodel::ClassHOW/.^ business is absent 18:59
oh wait, it does :D
18:59 domidumont1 joined
masak yes, just noticed 19:00
left a comment
I will keep minimizing
ely-se the interesting thing is that Any:D is a catchall
masak ely-se: if I remove the first (successful) call to .f, the second one starts working! 19:01
ely-se well, almost (as it requires definedness)
masak: lol
masak ely-se: feels like a screwing-up of method caches...
ely-se eek caches
masak aye
ely-se this multimethod mechanism is integral to my _extensible compiler_ design, so I hope I can work around it for now 19:02
DrForr I .. think I can get Inline::Guile working. I just corectly got the response from (+ 1 2) from an eval.
*correctly
ely-se is it possible to disable method caches?
masak ely-se: inlining T as a `where` in the siggie also makes things work properly
ely-se: (so one way to work around it would be to inline the subtype) 19:03
19:03 domidumont left
masak ely-se: as far as I can see, it fails because we first match T correctly, but in the second invocation we match List but not T. 19:05
masak submits rakudobug
ely-se masak: I reported a bug, you may want to add that as a comment
#127367 19:06
masak m: subset T of List where { .[0] == 1 }; .f([1, 2]) && .f([2, 2]) given class C { multi method f(T:D $) { self.f(42) }; multi method f(Any:D $xs) { say $xs } } 19:07
camelia rakudo-moar d67cb0: OUTPUT«42␤Type check failed in binding <anon>; expected T but got Array␤ in method f at /tmp/2og_5AYXa7 line 1␤ in block <unit> at /tmp/2og_5AYXa7 line 1␤␤»
RabidGravy fixes some undetected bit-rot in HTTP::UserAgent 19:08
19:08 ZoffixW left, _mg_ left
masak m: subset T of List where { .[0] == 1 }; .f([1, 2]), .f([2, 2]) given class C { multi method f(T:D $) { self.f(42) }; multi method f(Any:D $xs) { say $xs } } 19:08
camelia rakudo-moar d67cb0: OUTPUT«42␤Type check failed in binding <anon>; expected T but got Array␤ in method f at /tmp/6QOzj4w8mL line 1␤ in block <unit> at /tmp/6QOzj4w8mL line 1␤␤»
masak ely-se: great 19:09
masak adds the relevant conversation to that ticket
ely-se yay I inlined the constraints and now my tests pass :) 19:10
Skarsnik RabidGravy, if you want to fix more, http::cookie clear expired sucks xD
masak m: subset T of List where { .[0] == 1 }; .f([1, 2]) && .f([2, 2]) given class C { multi method f(T:D $) { self.f(42) }; multi method f(Any $xs) { say $xs } }
camelia rakudo-moar d67cb0: OUTPUT«42␤Type check failed in binding <anon>; expected T but got Array␤ in method f at /tmp/cMyjkxekX6 line 1␤ in block <unit> at /tmp/cMyjkxekX6 line 1␤␤»
masak getting golfier by the minute
RabidGravy no, I don;t want to fix more, I want to fix things that break the tests :) 19:11
masak .oO( only the golfiest bacon you've ever seen )
Skarsnik Well I fix it to pass test, but it should not accept legit expire date I think
masak m: subset N of Int where * == 5; .f(5), .f(7) given class C { multi method f(N:D $) { self.f("OH HAI") }; multi method f($x) { say $x } } 19:12
camelia rakudo-moar d67cb0: OUTPUT«OH HAI␤Type check failed in binding <anon>; expected N but got Int␤ in method f at /tmp/q_VI1BMJ_Z line 1␤ in block <unit> at /tmp/q_VI1BMJ_Z line 1␤␤»
masak ely-se: it's not just Lists
m: subset T of List where { .[0] == 1 }; .f([1, 2]) && .f([2, 2]) given class C { multi method f(T:D $) { self.f(42) }; multi method f($xs) { say $xs } } 19:14
camelia rakudo-moar d67cb0: OUTPUT«42␤Type check failed in binding <anon>; expected T but got Array␤ in method f at /tmp/tlPcEFvwR1 line 1␤ in block <unit> at /tmp/tlPcEFvwR1 line 1␤␤»
19:18 zakharyas joined, rindolf left
ely-se also, it seems "List:D $xs" is prefferred over "List:D $xs where *[0] eqv symbol('do')" when the input is [symbol('do')] 19:19
19:19 vendethiel joined
ely-se or at least sometimes 19:20
masak that one might just come down to ordering, though. try reversing the order :) 19:21
ely-se nope
masak m: class C { multi method f(42) { say "one" }; multi method f(42) { say "two" } }; C.f(42) 19:22
camelia rakudo-moar d67cb0: OUTPUT«one␤»
masak ely-se: hm. the one with the `where` clause *should* be (epsilon) narrower
DrForr Does NativeCall handle variadic arguments yet?
Skarsnik there is code for it 19:24
maybe there are tests for it?
ely-se masak: might be related to caches too
DrForr Actually I don't quite need that yet... 19:25
19:26 ZoffixW joined
autarch I'm giving a short talk on p6 tomorrow night at my local Perl Mongers - I'd appreciate some feedback on my presentation 19:26
if you check out github.com/autarch/presentations and then go into perl6-for-mpm you can see it 19:27
ely-se masak: seems to be a problem with recursive multis
autarch you can just open the index.html in your browser and it should work - if you wanted to also see the speaker notes you'd need to run "grunt serve" and then hit "s" in the browser when it opens the presentation
ZoffixW That's a lot of talks you got there :D 19:28
autarch I'm mostly interested in feedback about whether things are actually correct, not adding more content, since the goal is 20-30 minutes and I'm sure there will be lots of questions
masak ely-se: do you have a (golfed) example?
errand &
autarch ZoffixW - yeah, I really need to split them up into separate repos, I think
ZoffixW m: my @things = ^1000_000; say sum @things.map.({ $_ * 2 }); say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«Cannot call map(Array: ); none of these signatures match:␤ ($: Hash \h, *%_)␤ (\SELF: &block;; :$label, :$item, *%_)␤ (HyperIterable:D $: &block;; :$label, *%_)␤ in block <unit> at /tmp/8YdN2D5PyN line 1␤␤»
ZoffixW m: my @things = ^1000_000; say sum @things.map({ $_ * 2 }); say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«999999000000␤4.998560␤»
ZoffixW m: my @things = ^1000_000; say sum @things».&({ $_ * 2 }); say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«999999000000␤8.34724397␤» 19:29
ZoffixW ^ weird results. 2 times SLOWER than non-threaded
awwaiid splitting and joining more expensinve than *2 maybe? 19:30
ZoffixW hm?
awwaiid does >>.& actually thread?
ZoffixW It should, but I don't think that's implemented yet.
gfldex no
jnthn autarch: $output.IO.open(:w) - correct, though I tend to just say open($output, :w) :)
autarch I'm trying to emphasize the underlying OO-ness 19:31
ZoffixW m: my @things = ^300_000; @things = @things.map: *.uc; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«1.8095831␤»
ZoffixW m: my @things = ^300_000; @things = @things».uc; say now - INIT now
camelia rakudo-moar d67cb0: OUTPUT«1.51040915␤»
ZoffixW hm, maybe it's just that particular example
awwaiid autarch: can you .open:w without the parens?
19:32 TEttinger left
[Coke] autarch: how is one supposed to "play" the presentation? 19:32
autarch arrow keys
19:32 zakharyas left
[Coke] those don't seem to work. 19:32
ZoffixW I get a "ReferenceError: Reveal is not defined" when I open the presentation 19:33
[Coke] looks like none of the css or js loaded.
awwaiid broken symlinks :)
[Coke] Do I need to put this behind a web server?
awwaiid ../reveal.js is empty 19:34
[Coke] ah
jnthn autarch: Yes, but making things OO that don't need to be may also put some people off. :-)
autarch [Coke]: git submodule update in the top level dir, I suspect 19:35
jnthn $input.IO.open(:r).slurp-rest # leaks a file handle
autarch or update --init
jnthn slurp($input) is shorter and doesn't :)
ZoffixW "leaks a filehandle"? What doe sthat mean?
jnthn Or $input.IO.slurp
19:35 cdg left
jnthn ZoffixW: The handle that was opened is never closed 19:35
ZoffixW ah
jnthn Technically it will at some unknown future point when things are GC'd. 19:36
[Coke] autarch: no effect. reveal.js is still empty. So, no feedback from me, sorry.
awwaiid autarch: git submodule update --init worked
[Coke] ah, init did it. reading...
jnthn method open ($class: Str:D $filename) { # this is done to use $class later, though you don't need it and can use self.new(...) later 19:38
19:38 virtualsue left
ZoffixW autarch, third slide: "Perl 6 is defined its test suite" should be "Perl 6 is defined ***by*** its test suite 19:38
awwaiid autarch: I confirmed that `$outfile.IO.open :w` (with a space before the :w) works as well :) 19:40
ZoffixW "$file.IO.words" works too, without explicit .open (slide 7) 19:41
19:41 rindolf joined
AlexDaniel autarch: what's the easiest way to render that thing 19:45
autarch: ?
autarch AlexDaniel: if you check out the repo, then "git submodule update --init", then open the index.html, it should be visible
ZoffixW AlexDaniel, git submodule update --init; then just open it with your browser
AlexDaniel autarch: it seems like it requires reveal.js but there's no…
oh ok
ZoffixW autarch++ read it all. Looks good to me :)
AlexDaniel autarch: so it requires your public key in order to do that… 19:46
I mean, not just the public key
autarch doh, let me fix that
AlexDaniel because it is trying to clone from [email@hidden.address] 19:47
hmm interesting… why would that be a problem?
ZoffixW You know what would be cool? A way to say "await" for all promises in the current scope.
autarch AlexDaniel: fixed 19:48
jnthn ZoffixW: await gather { ... take all the promises } :-)
ZoffixW still needs to learn what gather/take are all about 19:49
AlexDaniel ZoffixW: interestingly I've asked that question about a year ago
or maybe more
autarch: thanks, it works now 19:50
PerlJam ZoffixW: without the gather/take syntax it sounds like you just asked for action-at-a-distance
[Coke] autarch++ 19:51
AlexDaniel autarch: why build 2015.12 ?
autarch: instead of the latest
ZoffixW PerlJam, not too much distance. Say, running a bunch of fire-and-forget code, and just waiting for them to complete at the end of the block
ely-se Is it possible to disable caching of multidispatch resolution? 19:53
ZoffixW m: sub do-things { Promise.in(2).then: { say "42"} }; do-things; say "meow" 19:54
camelia rakudo-moar d67cb0: OUTPUT«meow␤»
ZoffixW PerlJam, like this ^, for example
19:54 musiKk joined
AlexDaniel autarch: about “counting words” example, is it supposed to be 1 to 1 port? 19:55
autarch: because there are ways to make it much shorter in perl 6
jnthn ely-se: No, though why would you wish to?
ZoffixW m: sub do-things { await gather { take Promise.in(2).then: { say "42"} } }; say "meow";
camelia rakudo-moar d67cb0: OUTPUT«meow␤»
jnthn ely-se: It only caches based on type, never on constraints.
autarch AlexDaniel: I copied the build instructions from perl6.org 19:56
AlexDaniel: not really supposed to be 1-to-1 port, though if the shorter version is more like a golf version I don't think I'd want to use that - what were you thinking of specifically?
jnthn (And of course "no" as in "there's no API for it 'cus it's purely an optimization" - if you're willing to null out the thingy where the cache is stored then you can...
...excpet the VM will have inlined based on the cache too perhaps.) 19:57
ely-se jnthn: for debugging
there seems to be a problem with recursive multis 19:58
jnthn Well, you can set MVM_SPESH_DISABLE=1 to rule out the VM's own opts 20:01
(rule them out if it makes no difference, that is)
ely-se jup, problem persists 20:02
the program crashes 100ms faster with that environment variable, though :) 20:03
Skarsnik huhu
20:03 konobi_ is now known as konobi
AlexDaniel autarch: First thing was that I thought List.unique was able to produce a hash with counts (exactly what is required). But it doesn't, such a pity. 20:04
autarch: then, the first loop can be written with 「for」 on right hand side
autarch jnthn: btw, did you see the slide about the perl6 stack? I wasn't sure if I described that correctly - it's slide 16
AlexDaniel autarch: otherwise it is kinda weird, why write the second one in such fashion but not the first one? it is other way round :)
autarch: because I find the second one a bit hard to read because of that. But that's just a style question, so whatever. 20:05
autarch AlexDaniel: what is first & second in this sentence?
AlexDaniel autarch: for loops
autarch: in “counting words” example
autarch oh, I see postfix vs prefix
AlexDaniel autarch: in perl 5 version it was required because it had 「chomp」 20:06
autarch right
yeah, in that case I was just copying the program structure between 5 & 6
AlexDaniel but indeed it's such a pity that List.unique can't give you the count right away 20:07
unique even has :as(&lc) trick which is required in this example 20:08
20:12 chacewells left
AlexDaniel autarch: sort(&[<=>]) or sort(* <=> *) is perhaps more readable than sort({ $^a <=> $^b }) 20:12
autarch: but again, it's not an issue. Great presentation 20:13
timotimo oh, a presentation?
ah, there it is
ZoffixW autarch, if you want some pedantism: lc is not a good thing to use for caseless comparison. Perl 6 has .fc method and Perl 5 has fc function for that.
timotimo hm. what should i do to watch this? 20:14
AlexDaniel timotimo: git clone it
20:14 roguelazer left
Skarsnik fc? 20:14
ZoffixW timotimo, git submodule update --init; then just open it with your browser 20:15
Skarsnik, "fold case"
huggable, Str
huggable ZoffixW, class Str [String of characters]: doc.perl6.org/type/Str
AlexDaniel autarch: also, as a Perl 5 programmer I'd probably like to see 「.say for $foo.values;」 instead of 「say $_ for $foo.values;」
20:15 ruoso left
timotimo yeah, wow those people! 20:15
ZoffixW autarch, I have a shorter version for your thing. 20:16
m: my $s = Bag.new: <foo bar foo ber>; say $s
camelia rakudo-moar d67cb0: OUTPUT«bag(ber, foo(2), bar)␤»
ZoffixW autarch, ^ use a Bag instead of the hash (or checkout other Bag/Set types)
Then your first loop just becomes my $words = Bag.new: $file.IO.open.words; 20:17
(i.e. no loop needed)
AlexDaniel oh!! Bag!!
there it is! Yes!
jnthn autarch: I didn't see anything in there that concerned me.
(about the stack)
AlexDaniel ZoffixW++ for remembering Bag! 20:18
ZoffixW In the Bag, I also see classify-list and categorize-list methods that sounds interesting, but aren't documented :D
I wonder if they can be used in lue of the sorting loop
20:19 darutoko left
ZoffixW Bag.new: $file.IO.words; # .open is not needed 20:19
AlexDaniel ZoffixW: yeah, I didn't like that open too
autarch: we're being overly pedantic, please don't mind that :) 20:20
ely-se jnthn: just to be absolutely sure, this is _not_ desired behaviour, right? gist.github.com/rightfold/a4bdccd99dae16ba8ad7 20:21
ZoffixW Yeah, the talk is fine the way it is... We're just thinking aloud here :)
jnthn ely-se: That won't dispatch to either since you're not passing a List?
ely-se refresh :P 20:22
musiKk can anybody offer a mnemonic for rule vs. token? I always forget which one has sigspace.
AlexDaniel ZoffixW: it seems like .categorize-list just eats a list into existing Bag 20:23
20:23 roguelazer joined, domidumont1 left
ZoffixW ely-se, that code doesn't produce any output for me, suggesting the first multi is run 20:23
jnthn ely-se: That one always dispatches to the first candidate.
20:23 atweiden left
jnthn (Trying it locally, anyway) 20:24
ZoffixW musiKk, rule => raw (i.e. you get whitespace and all)
ely-se musiKk: pad with spaces both "rule" and "token" until 5 characters :P
AlexDaniel ZoffixW: and classify-list does something similar
ely-se jnthn: ok
jnthn ely-se: multi term-expr(List:D $datum where *[0] eqv 'do') { say 'correct' } # it always runs this one for me
AlexDaniel ZoffixW: github.com/rakudo/rakudo/blob/nom/...gy.pm#L517
ely-se jnthn: yeah my code is a little more contrived but thanks for confirming
it's hard to make a reproducable example for this 20:25
jnthn musiKk: Tokenizing is traditionally about breaking things up into tokens, that is the "atoms" 20:26
musiKk: But I guess that only works for those of us with enough of a compiler-y background :)
ZoffixW musiKk, tokens make me think of subway tokens... no sig space around them :)
jnthn Maybe the rules rule over the little tokens :) 20:27
skids
.oO(every grammar should have a token token)
20:29 ruoso joined 20:30 molaf left
musiKk hm... 20:31
flussence rule is huffmanized slightly more, which is in line with not manually typing out where whitespace goes 20:33
ZoffixW m: (-Inf..Inf).grep(/1337/)[0].say
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
20:35 ChoHag left
timotimo hah, yeah, good luck with that 20:35
musiKk OK. Token creates a single token. I'll go with that. I'm sure I'll forget it until the next time I need it. Somehow it works both ways in my brain. 20:36
jnthn bah, Perl 6 is so slow, it can't even count up from negative infinity to zero in finite time! :P
ZoffixW :P
m: (1..Inf).grep(/1337/).grep(*.is-prime).map("This number is prime " ~ *)[0..2].say
ZoffixW can't get enough of this stuff
camelia rakudo-moar d67cb0: OUTPUT«(This number is prime 31337 This number is prime 111337 This number is prime 113371)␤»
ely-se I can't make a reproducable example :( 20:37
timotimo m: (1, -1, -> $a, $b { $a - 1, $b + 1 } ... * > 100_000).grep(/1337/).map(*.say)
ZoffixW Hopefully will make for a fun bit in my talk: "Let's start with an infinite list...." :D
camelia rakudo-moar d67cb0: OUTPUT«(timeout)»
timotimo oh, nothing said, eh?
m: (1, -1, -> $a, $b { $a - 1, $b + 1 } ... * > 100_000).grep(/1337/)[^100].map(*.say)
camelia rakudo-moar d67cb0: OUTPUT«(timeout)» 20:38
timotimo ah, i know what's wrong
ZoffixW What?
The * > 1000 bit? 20:39
timotimo m: (1, -> $a { $a < 0 ?? -$a !! $a + 1 } ... * > 10).say
camelia rakudo-moar d67cb0: OUTPUT«(1 2 3 4 5 6 7 8 9 10 11)␤»
timotimo hm, or maybe not
ZoffixW That seems one elaborate way to write 1..11 :D
timotimo m: (1, -> $a { $a > 0 ?? -$a !! $a + 1 } ... * > 10).say
camelia rakudo-moar d67cb0: OUTPUT«(1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 -1 0 1 ...)␤»
ZoffixW m: say ^10 + 1
camelia rakudo-moar d67cb0: OUTPUT«1..^11␤»
timotimo m: (1, -> $a { $a > 0 ?? -$a !! $a - 1 } ... * > 10).say
camelia rakudo-moar d67cb0: OUTPUT«(1 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -6…»
timotimo m: (1, -> $a { $a > 0 ?? -$a !! -$a - 1 } ... * > 10).say 20:40
camelia rakudo-moar d67cb0: OUTPUT«(1 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 ...)␤»
timotimo god damn it :)
AlexDaniel why not … Inf ?
timotimo initially so that it may terminate faster
i'll just do this instead: 20:41
m: (^20).map({$_, -$_}).say
camelia rakudo-moar d67cb0: OUTPUT«((0 0) (1 -1) (2 -2) (3 -3) (4 -4) (5 -5) (6 -6) (7 -7) (8 -8) (9 -9) (10 -10) (11 -11) (12 -12) (13 -13) (14 -14) (15 -15) (16 -16) (17 -17) (18 -18) (19 -19))␤»
timotimo m: (^20).map({slip $_, -$_}).say
camelia rakudo-moar d67cb0: OUTPUT«(0 0 1 -1 2 -2 3 -3 4 -4 5 -5 6 -6 7 -7 8 -8 9 -9 10 -10 11 -11 12 -12 13 -13 14 -14 15 -15 16 -16 17 -17 18 -18 19 -19)␤»
20:44 ZoffixW left 20:47 ChoHag joined
ely-se jnthn: it seems to be a weird interplay of multi resolution and lazy lists 20:50
holdon
sprinkling .eager here and there "fixes" the problem
dalek kudo/nom: cf7706f | FROGGS++ | src/core/CompUnit/Repository/ (2 files):
make CUR.bindir overridable

This is useful when several CURs share a single bin directory on disk. Also when we have repositories that keep the distribution data on a non-local storage, we need to keep the wrapper scripts in a local bindir, so that these can be in PATH. Rakudo Star will be the first user of this funtionality.
AlexDaniel m: for ^10 { state $x = 42 if $_ == 0; say $x } 20:51
camelia rakudo-moar d67cb0: OUTPUT«42␤42␤42␤42␤42␤42␤42␤42␤42␤42␤»
AlexDaniel m: for ^10 { state $x = 42 if $_ == 3; say $x }
camelia rakudo-moar d67cb0: OUTPUT«(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤» 20:52
moritz FROGGS: does this commit need to go into 2016.01?
FROGGS moritz: yes
nine FROGGS: note that this is an extension oof the 6.c API
moritz FROGGS: then you should cherry-pick it into the 2016.01-preparation branch
FROGGS nine: yes, but without this ther won't be a star 20:53
moritz: will do after patching panda
nine Is there really no other way?
symlinks or something?
timotimo AlexDaniel: state variables are always initialized on first entry; the if in there doesn't help that much 20:54
FROGGS nine: that would imply not using panda in star
nine: and would probably also mean to not use CURI
moritz prefers to extend the API in a backwards compatible way instead of piling up workarounds 20:57
20:58 revhippie joined 20:59 cdg joined, lokien_ joined 21:00 cpage_ left, cpage__ joined 21:02 cpage__ left, cpage_ joined 21:04 pi4 left, pi4 joined 21:08 ajr_ joined 21:09 CIAvash left
Skarsnik Using gptrixie to write a small libmxl2 based xml parser to use it to parse xml file in gptrixie is fun xD 21:11
ajr_ I'm using the sub MAIN to validate command line arguments, but it appears to be running after all the code. Can it be made to run first, so the program will have validated arguments? 21:12
moritz ajr_: don't write code in the mainline; write it inside your MAIN subroutine!
21:12 kaare_ left
jnthn Or in subroutines called from MAIN :) 21:13
The reason the mainline comes first is to allow manipulation of @*ARGS before it's used to dispatch to MAIN
ajr_ Is there an example of the proper way to do that in the documentation?
El_Che_ or in a class loaded by MAIN (to be mister-echo)
21:14 El_Che_ is now known as El_Che
moritz ajr_: it's just a sub; you can write code inside it. 21:14
21:14 zhmylove joined 21:15 mohae left
DrForr Inline::Scheme now on Github. 21:16
mst ajr_: surely that means you meant to put the code inside MAIN rather than at top-level?
alpha123 waits for Inline::Whitespace
Skarsnik x)
mst DrForr: oooh. which one?
DrForr Guile.
mst and so the cycle continues
21:16 mohae joined
mst (you saw my LPW talk, right? :) 21:16
Skarsnik I should write perl6 binding for libmoar 21:17
DrForr mst: Gotta accelerate it somehow.
Skarsnik not sure of the use, but why not
DrForr And yes, of course.
alpha123 Skarsnik: for Inline::Perl6, obviously
mst surprised you didn't either (a) call it Inline::Guile (b) do an Inline::Racket instead
oooh, an Inline::Scheme with pluggable backends onto multiple r5rs interps would be ace
DrForr Guile was the first one I ran across that seemed reasonably commonplace. 21:18
mst racket is, to my mind, more so (used to be drscheme)
moritz oh, I learned some scheme with drscheme 21:19
mst and in fact I stopped even pretending to plan to maintain perl5's Guile bindings when I realised audrey had written mzscheme mindings
DrForr Ah, I've worked with that when it ws drscheme.
mst guile's not a bad choice, but mzscheme/racket is IMO a better scheme
moritz we had an optional CS course in $schooll that was worth its name, learned a bit of scheme there. That was fun
mst of course, my exact memories on this are buried in the mists of years ago
awwaiid Cool DrForr. I'm hoping that we can extract some comonalities between these Inline:: langs (and rename the namespace while we're at it); I'll take a look at Inline::Scheme to see what overlap we have 21:20
21:20 jernster is now known as jme`
autarch doc.perl6.org/ and doc.perl6.org/ appear to have different styles 21:20
nine awwaiid: go go go :)
awwaiid nine: I got Inline::Ruby broken out into some separate files and bashed travis-ci into submission finally 21:21
PerlJam wonders when we'll get Inline::COBOL and Inline::Fortran ;-)
awwaiid nine: sometime I'll see if I can get Inline::Perl5 on travis
DrForr awwaiid: It's pretty simplistic at this stage, it'll be more complex/useful once I figure out how to portably crack an SCM type object open.
awwaiid in theory I'm at $work right now though
revhippie autarch: woah, strange. 21:22
autarch yep
21:23 nowan left
alpha123 Inline::Fortran would be pretty useful 21:23
autarch aha, chrome is blocking the load of one of the sheets because it has an explicit http:// url
probably best to make all sites canonize to https or http
awwaiid it's actually the ecosystems that I want to get ahold of more than the langs :)
21:24 Psyche^_ joined
moritz autarch: or just link to protocol-relative URLs 21:24
ugexe to test Inline::Perl5 on travis just use `perl: '5.20-shrplib'`
autarch no point in serving the site from both http & https, is there?
moritz yes: choice
also, I'm pretty new to the whole running-as-https thiing
flussence lazy fix would be to throw a "Content-Security-Policy: upgrade-insecure-requests" header in there and let the browser figure it out :) 21:25
awwaiid ugexe: yes. and to test ruby I just added 'rvm install ruby-2.3'. But... subtle issues esp around linking haunted me. I hope it'll be that easy.
moritz autarch: what's the offending resource?
21:25 Psyche^ left
alpha123 autarch: //url.com works uses http: or https: depending on the current url, so you don't need to bother canonicalizing them 21:25
autarch moritz: design.perl6.org/perl.css 21:26
ugexe i've installed Inline::Perl5 on travis and test it. there were no issues luckily
autarch alpha123: yes, I'm quite familiar
alpha123 whoops
21:26 nowan joined
awwaiid ugexe: awesome! 21:29
dalek ar/release: 1225071 | FROGGS++ | tools/build/Makefile.in:
fix thinko when invoking panda

Running "perl6 panda-m.bat" certainly wont work on windows. Though
  "perl6 panda-m" will.
moritz off topic: does anybody know some tool to help fat-package a perl binary and all perl dependencies into a Debian package?
21:30 geraud joined
Skarsnik dh_make? 21:30
Oh a fat package
21:30 jpoehls_ joined
Skarsnik I don't know 21:30
moritz Skarsnik: I was thinking more magical, like dh-virtualenv for python
FROGGS moritz: I just know about staticperl, which packs all the things into a binary 21:32
mst moritz: build local::lib. tar up results. feed tarball into fpm?
ajr_ mst: In almost all shell scripts, I validate the command line arguments, (#, types, and values) first, then start the actual operations. MAIN looked as though it would do some of that automatically and provide a place to do the rest of the validation, but it feels wrong to put the rest of the code in there. but 21:33
21:33 abaugher_ left, yurivish_ joined
mst ajr_: well, if you're using MAIN, that's where the code belongs 21:33
that's like the whole point of it 21:34
provide an entrypoint for the main code of the script
that can do argument validation etc. for you
21:34 autarch left
mst if you define MAIN, it's basically equivalent to having 21:34
moritz ajr_: Perl 6 isn't shell scripting. Get over it :-)
21:34 abaugher_ joined
mst run_arg_parser_and_call(MAIN); 21:34
at the bottom of the script
ajr_: and I'm sure you've seen shell scripts that end 'main;'
moritz: yes, that's a much kinder and constructive thing to say to a confused newbie than my explanation :P 21:35
jnthn YOu can also do `unit sub MAIN($a, $b);`
Which will make the rest of the program body be considered the implementation of that sub.
Which shaves a level of indentation
Uh, saves 21:36
21:36 jpoehls_ left
jnthn Though I guess shaves works too :) 21:36
mst When indenting / command line scripts / always remember / unit shaves
21:36 autarch joined
dalek ar/release: 0ff0e63 | FROGGS++ | modules/panda:
update panda revision, to include --bin-prefix support
21:37
ar/release: 8d69d3c | FROGGS++ | / (2 files):
remove WIP patch files
RabidGravy hacks deflate/gzip handling into H::UA 21:39
Skarsnik hm, how? 21:40
RabidGravy using Compress::Zlib, works really nicely
ajr_ mst: (16:34) Can't say that I have, but I haven't read many others, except for the system stuff.
Hotkeys used on its own what is the difference between given and with
jnthn with only runs the code if the value is defined 21:41
mst ajr_: well, it's pretty common tbh
Hotkeys ah
jnthn There's a without for the other case
mst ajr_: but, yeah, as jnthn said, if you don't want the indenting
Skarsnik RabidGravy, is not perl6 native?
mst unit sub MAIN (...);
<now inside MAIN until eof>
is totally supported
RabidGravy Skarsnik, que? 21:42
mst and if you find it more comfortable, go ahead and use it
Skarsnik C:Z is written in perl6 or it's NC code? x)
ajr_ Running an entire program inside a subroutine just feels wrong.
RabidGravy Oh native call
mst ajr_: everything is always doing that
ajr_: it's just some things provide an implicit magical top-level subroutine for the file
ajr_: really 21:43
dalek kudo/2016.01-preparation: 74dd4e2 | FROGGS++ | src/core/CompUnit/Repository/ (2 files):
make CUR.bindir overridable

This is useful when several CURs share a single bin directory on disk. Also when we have repositories that keep the distribution data on a non-local storage, we need to keep the wrapper scripts in a local bindir, so that these can be in PATH. Rakudo Star will be the first user of this funtionality.
mst ajr_: and because shell does it taht way, you don't see the main subroutine
21:43 sevvie joined
RabidGravy but I've made it optional. It just craps out if it isn't installed and the body needs inflating 21:43
mst ajr_: but conceptually it's totally there
moritz ajr_: on the contrary, it's best practice; makes testing easier for example
mspo isn't pretty mucb every lanaguage structured like that?
moritz python folks do it all the time
21:43 dotness joined
mst mspo: um. no. C uses main(), java uses main(), lots of things use main() 21:44
21:44 dotness left
mst perl6 lets you use MAIN if you want to, and not if you don't 21:44
but if you decide to avoid MAIN, you don't get the features of MAIN
mspo so lower level languages have you explicitly type it
RabidGravy I think it's a nice compromise 21:45
21:45 maslan left
moritz travis-ci.org/perl6/Pod-To-HTML/bu.../104747418 can anybody make sense of this? 21:45
mst ajr_: so, yeah, it only feels weird because you've missed all the other languages that do do it that way, and it's ok :)
also it makes it way easier to write tests for things
if the 'body' of the script isn't in an implicit top level sub 21:46
you can load it and poke it with a stick
moritz ah, do we have to add /home/travis/.rakudobrew/moar-nom/install/share/perl6/site/bin to $PATH in the travis.yml?
mst so basically all my shell scripts and perl5 scripts have a main anyway
it's a pretty standard convention for anybody writing production scripting stuff
(common in Tcl as well, and in python)
Skarsnik RabidGravy, a nice thing will be a full perl6 zip support x) 21:47
RabidGravy and if you want to do something different you can make it easier (by inserting a MAIN or otherwise capturing control at that point)
ajr_ I'm familiar with C's main, but I think it's the "subroutine" part that's causing the cognitive dissonanance.
RabidGravy Skarsnik, carry on I won't be stopping you :) 21:48
Skarsnik x)
I am surprise it did not exist
moritz ajr_: you can still call other routines, making MAIN only a *SUB*set of all the routines in there
Skarsnik *suprised
21:48 dfcarpenterak joined
mspo C's main is a subroutine? 21:48
RabidGravy well a function
in C parlance
moritz it's just nomenclature
alpha123 perl subroutine == c function
mspo they're all just objects ot C, right? :) 21:49
Skarsnik main is just a symbol
int main; is a valid C program x)
ajr_ This discussion may have cleared up a question about the Test modules. It was clear how they worked for subroutines and modules, but testing whole programs seemed to need another step up.
21:49 colomon left
mspo is 'main' special in asm? 21:49
alpha123 mspo: that's up to your assembler 21:50
Skarsnik Na, but the kernel search for a main symbol
moritz ajr_: a nice trick is to a a multi sub MAIN('test') { use Test; test code here; }
masak hm, I wonder how close a JS-like "transpiler" approach might be able to push Perl 5 towards Perl 6...
maybe that won't actually be much more powerful than what can already be done with source filters and parser hooks 21:51
DrForr Solved the core of the typing issue, will do an improved version tomorrow with any luck.
moritz masak: afaict there are two approaches; one generates readable but often wrong code, and the other generates unreadable code with lots of supporting libs
DrForr Most assuredly my ToPerl6 converter does the former :) 21:52
G'nite.
masak moritz: are you talking about compile-to-JS languages in particular? because IMO TypeScript generates readable *and* correct code most of the time
RabidGravy toodles
moritz masak: no, about 5-to-6 or 6-to-5 transpilers 21:53
RabidGravy but aren't TypeScript, CoffeeScript et al *designed* to be "transpiled" to Javascript?
don't have that luxury with 5-to-6 21:54
diakopter I think the word transpile is meant to imply 'readably compile'
konobi coffeescript is a shitshow
arnsholt My suspicion for P5 on P6 is that the P5 lexer and parser stages need to be compiled to Perl 6 code (custom flex and yacc compilers, possibly? But what about the action code, in C, which is the meat of it?) and then the rest of the runtime can be implemented on top of that
masak note that I wasn't saying "compiler Perl 6 to Perl 5"
I was saying "try to push Perl 5 closer to Perl 6 by compiling a language to it" 21:55
diakopter how does that push...
konobi probably better as a tool to inspect the AST and suggest changes 21:56
masak I dunno. all I know is that TypeScript pushes JavaScript closer to being a static language.
konobi yeah, with some side effects
arnsholt Oh, right. Now I see what you mean, masak. Never mind my gibberings 21:57
I'm not sure what it would look like, but it does sound like an intriguing idea 21:58
21:58 skids left 21:59 skids joined, skids left 22:02 maslan joined
jdv79 is the cur stuff still in flux? 22:02
22:02 rindolf left
moritz not so much 22:03
jdv79 i have a rakudo from a few hours ago and a panda from a few minutes ago and bootstrap failed
22:03 virtualsue joined
moritz if you had panda installed before compiling the new rakudo version, you don't even have to bootstrap 22:03
jdv79 that's already over my head. i thought bootstrap installed panda under the rakudo dir 22:04
nine FROGGS just pushed commits to both. Maybe related?
jdv79 or i'm misunderstanding
i rm -rf'ed my preview rakudo checkout and cloned fresh and built 22:05
nine jdv79: you're correct. What moritz meant is that if you have installed panda on a previous version of rakudo, you keep it despite upgrading
Technaton Good night, sleep tight, ... and don't let the bedbugs bite...!
jdv79 ok
22:05 Technaton left
jdv79 i'll update my rakudo then 22:05
nine Oh, rm -rf is the exception of course :)
jdv79 do panda and zef get along together? 22:11
22:15 maslan left 22:17 colomon joined 22:22 ely-se left 22:23 FROGGS left, musiKk left 22:27 MARTIMM left 22:36 AlexDaniel left 22:37 dfcarpenterak left 22:38 gtodd joined
gtodd perl6advent.wordpress.com/2010/12/...-operator/ could there be a comment or edit on this post to explain why the approach no longer works with perl6 xmas release? (GLR stuff I guess) 22:39
camelia: r: my @odd-numbers   := 1, 3 ... *; say @odd-numbers ; 22:41
camelia gtodd: rakudo-jvm 6c0f93: OUTPUT«Type check failed in binding; expected Positional but got Seq␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-moar cf7706: OUTPUT«Type check failed in binding; expected Positional but got Seq␤ in block <unit> at /tmp/tmpfile line 1␤␤»
gtodd etc.
dalek c: f16bdf2 | (David Brunton)++ | doc/Language/terms.pod:
To, too.
22:46
c: d78c5ef | RabidGravy++ | doc/Language/terms.pod:
Merge pull request #368 from dbrunton/patch-4

To, too.
masak 'night, #perl6
RabidGravy toodles 22:47
gfldex gtodd: post fixed 22:49
22:50 addison left 22:52 leont joined, travis-ci joined
travis-ci Doc build errored. Jonathan Stowe 'Merge pull request #368 from dbrunton/patch-4 22:52
travis-ci.org/perl6/doc/builds/104767020 github.com/perl6/doc/compare/abe31...8c5efb024b
22:52 travis-ci left
awwaiid gfldex: that post mentions "@Fibonacci[30]" but is using binding to $Fibonacci throughout 22:52
gfldex awwaiid: that should be fixed too 22:54
awwaiid gfldex: also, any reason it isn't using @x = ... instead of $x := ...? 22:55
(every time I see := I am suspicious)
gfldex i just prefer binding for lazy lists. Makes it a little clearer what's going on
gtodd gfldex: wheee! 22:56
22:56 TEttinger joined
awwaiid gfldex: I guess I don't know why $x = 1,2,...* doesn't work 22:57
gtodd gfldex: there's tons of non working code examples out there since GLR but the advent calendar is almost "official" documentation :)
awwaiid gfldex: oh... hmm. $x = (1,2,3...*) does work 22:58
yeah. I don't get it :)
22:59 maslan joined
gtodd gfldex: oh I thought the "fix" was my @fib = ( 1, 1, * + * ... * ); #List context feeds into array 23:02
gfldex: @fib[1..9] 23:03
23:03 sortiz joined
gtodd or something 23:03
sigh
sortiz \o #perl6
23:04 RabidGravy left
gtodd but I like your explanation ... if there was a perl6style or PBP maybe something that is a lazy lists should bind to something that is not an Array ... 23:05
would be part of it ... errm P6BP ... 23:06
23:09 Skarsnik left, laz78 left 23:17 laz78 joined 23:19 AlexDaniel joined 23:20 yurivish_ left 23:24 laz78 left
autarch thanks to everyone who reviewed my slides earlier - I made a bunch of changes based on your feedback 23:25
23:25 skids joined 23:34 virtualsue left 23:35 yurivish_ joined
ajr_ If rakudo* is installed, is panda supposed to work "out of the box", or is there a further install required? I see it, but in a directory way down from anything on $PATH. 23:35
23:35 virtualsue joined 23:43 drrho left, drrho joined
AlexDaniel autarch: nice! 23:45
autarch: hmm did you miss Bag thing or did you find it inappropriate for that example? 23:46
23:46 addison_ joined 23:47 anthk_` left
AlexDaniel m: m: my $s = Bag.new: <foo bar foo ber>; say $s 23:47
camelia rakudo-moar cf7706: OUTPUT«bag(ber, foo(2), bar)␤»
23:49 leont left 23:51 drrho left, drrho joined 23:52 virtualsue left, adu joined