Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-10-18

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 firstdayonthejob joined #perl6
00:05 [Coke] konobi: no clue, sorry
00:12 rurban joined #perl6
00:13 tokuhirom_ joined #perl6
00:18 Hor|zon joined #perl6
00:20 [Sno] joined #perl6
00:28 testing joined #perl6
00:29 aborazmeh joined #perl6
00:29 aborazmeh joined #perl6
00:41 bjz joined #perl6
00:43 psch konobi: i'd look in Makefile-JS.in first
00:43 psch konobi: at least from how the other backends build, the gen-* usually just does stuff slightly beyond concatenation
00:44 psch konobi: although -js might of course do things differently and pmurias is definitely the person to ask... :)
00:44 psch (of course it also depends on which part of the build you want to affect...)
00:45 konobi psch: i think it's that gen script that generates the Makefile-JS.in
00:49 psch konobi: i'm pretty sure that's not the case.  the gen- script generates a Makefile out of Makefile-common.in and Makefile-$BACKEND.in
00:49 psch konobi: https://github.com/perl6/nqp/blob/master/tools/build/Makefile-JS.in it's on the repo, so it's not generated.  it *might* get altered by the gen- script, but that'd be different than the other backends
00:50 llfourn joined #perl6
00:50 psch konobi: and i'd still be confident in saying that Makefile-JS.in won't get altered on disk, if so a copy gets altered
00:50 weihan joined #perl6
00:51 psch konobi: from the looks of it, gen-js-makefile.nqp writes the Makefile used to build nqp-js
00:52 psch although i don't see a reference to Makefile-JS.in
00:55 psch konobi: Configure.pl calls fill_template_fill from tools/NQP/Configure.pl, which (indirectly) does some processing and (basically) cats the template into Makefile
00:55 weihan joined #perl6
00:55 psch s/_fill/_file/
00:55 * psch .oO( we do have a quite interesting build system... )
00:58 weihan joined #perl6
01:02 weihan joined #perl6
01:05 dalek rakudo/nom: 5cd7ef0 | TimToady++ | src/Perl6/ (2 files):
01:05 dalek rakudo/nom: make with/without topicalize properly
01:05 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5cd7ef0a4d
01:05 TimToady finally...
01:08 konobi psch: >.<
01:10 tokuhiro_ joined #perl6
01:16 dalek roast: b26e8b3 | TimToady++ | S04-statements/with.t:
01:16 dalek roast: unfudge with topicalization
01:16 dalek roast: review: https://github.com/perl6/roast/commit/b26e8b3c3d
01:19 bjz_ joined #perl6
01:19 Hor|zon joined #perl6
01:19 psch konobi: not sure what you're trying to tell me..? :)  in any case, what is that you want to change about the nqp-js build?
01:25 Jaglor joined #perl6
01:30 konobi psch: just trying to work it out
01:46 ilbot3 joined #perl6
01:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
01:55 araujo_ joined #perl6
02:05 dalek ecosystem: cf85616 | (Fayland Lam)++ | META.list:
02:05 dalek ecosystem: Add Gravatar::URL to ecosystem
02:05 dalek ecosystem:
02:05 dalek ecosystem: See https://github.com/fayland/perl6-Gravatar-URL
02:05 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/cf85616a32
02:06 llfourn joined #perl6
02:14 noganex_ joined #perl6
02:20 Hor|zon joined #perl6
02:30 tokuhirom_ joined #perl6
02:37 Sgeo joined #perl6
02:42 lichtkind good night
02:48 ngie joined #perl6
02:52 dalek rakudo-star-daily: bfd9d62 | coke++ | log/ (9 files):
02:52 dalek rakudo-star-daily: today (automated commit)
02:52 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/bfd9d6239e
02:52 dalek rakudo-star-daily: 5a1ca12 | coke++ | log/ (8 files):
02:52 dalek rakudo-star-daily: today (automated commit)
02:52 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/5a1ca12b5d
02:52 dalek perl6-roast-data: 6639af4 | coke++ | / (9 files):
02:52 dalek perl6-roast-data: today (automated commit)
02:52 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/6639af424a
02:53 dalek rakudo/nom: 4f2ee3d | TimToady++ | src/Perl6/ (2 files):
02:53 dalek rakudo/nom: fix topicalization of without as well
02:53 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4f2ee3d00c
02:53 dalek roast: 47f8eb0 | TimToady++ | S04-statements/with.t:
02:53 dalek roast: test with/without much more thoroughly
02:53 dalek roast: review: https://github.com/perl6/roast/commit/47f8eb0539
02:54 Suzeanne joined #perl6
02:59 dalek roast: df29028 | TimToady++ | S04-statements/unless.t:
02:59 dalek roast: test that 'unless true' returns Slip
02:59 dalek roast: review: https://github.com/perl6/roast/commit/df29028a35
03:00 tokuhiro_ joined #perl6
03:03 tokuhirom_ joined #perl6
03:03 xxx joined #perl6
03:21 Hor|zon joined #perl6
03:29 llfourn joined #perl6
03:37 Jaglor left #perl6
03:54 Brynn joined #perl6
03:56 weihan joined #perl6
03:57 Brynn left #perl6
04:06 tokuhiro_ joined #perl6
04:22 Hor|zon joined #perl6
04:27 llfourn my perl6 REPL is no longer working nicely with ← giving me ^[[D
04:27 llfourn after rebuilding -- how2fix?
04:28 llfourn ^^ dw I fixed it :)
04:29 Suzeanne joined #perl6
04:41 konobi llfourn: might be worth looking at the npm library "blessed". It has a native implementation of tput... should work for *nix and win32
04:43 masak m: sub foo($n) { $n == 2 ?? Empty !! $n }; say (1, 2, 3).map(&foo)
04:43 camelia rakudo-moar 4f2ee3: OUTPUT«(1 3)␤»
04:43 masak m: sub foo($n) { $n == 2 ?? Slip.new !! $n }; say (1, 2, 3).map(&foo)
04:43 camelia rakudo-moar 4f2ee3: OUTPUT«(1 3)␤»
04:43 masak is there any detectable difference between Empty and Slip.new ?
04:44 llfourn konobi: I was just talking about the inbuilt Perl 6 REPL.... I just needed to reinstall Linenoise. blessed looks cool though :)
04:45 konobi yeah, but blessed it all native... also doesn't even need readline
04:47 llfourn konobi: You use it with Perl6 somehow
04:47 llfourn ?
04:47 konobi nope, just worked with it in the early days
04:47 konobi um... blessed that is
04:48 konobi though I also worked with perl6 back in the early days too ^_^
04:48 masak :)
04:48 llfourn I see :)
04:48 masak how early are the early days, OOC?
04:51 konobi masak: good ol' pugs era
05:11 ilbot3 joined #perl6
05:11 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
05:12 kipd joined #perl6
05:12 SmokeMachine_ joined #perl6
05:14 preyalone joined #perl6
05:15 Spot__ joined #perl6
05:15 zemmihates joined #perl6
05:16 TimToady konobi: jnthn++ is off on his honeymoon
05:17 konobi TimToady: oh wow... nice! if there's someone worthy of having a nice time off, mr worthington is definitely up there.
05:17 konobi TimToady: how's things? excited to finally release before christmas? =0)
05:21 TimToady it...please me :)
05:21 TimToady *pleases
05:23 TimToady m: if 0 {} orwith Nil { .say } else { .say }
05:23 camelia rakudo-moar 4f2ee3: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in block <unit> at /tmp/FM2qMOlbSk:1␤␤»
05:23 TimToady but I found a bug...
05:23 konobi TimToady: <3
05:23 Hor|zon joined #perl6
05:24 konobi TimToady: have been out of the perl world for a while... but with the announcement... definitely swinging back in to have a peek
05:24 TimToady well, we still have lots of work to do before Christmas...
05:24 TimToady but it's nice to officially be in beta state now
05:24 konobi =0)
05:25 konobi so it's moarvm based now, right? parrot is still off in the sidelines?
05:26 TimToady yes, moarvm is the main effort, but looks like jvm is sticking close too
05:26 TimToady parrot...not so much
05:26 TimToady and there's a js backend coming along too
05:26 konobi TimToady: have a look at the vmkit stuff that's available for llvm at all?
05:27 TimToady llvm is very...ll
05:27 konobi TimToady: I'll try to help with the JS backend as much as I can... since I'm pretty tied to nodejs... for my sins.
05:27 TimToady ok, pmurias++ is the one working on it mostly
05:28 TimToady he might well be glad of some assistance
05:30 TimToady now, to figure out this bug...
05:31 konobi TimToady: rgr! old belfast.pm folk to the rescue!
05:35 masak konobi: yay, JS backend! \o/
05:36 masak I still belive that one will be a game-changer in unknowable ways.
05:36 masak (simply because JavaScript is eating everything and things will only survive long-term to the extent they compile down JavaScript)
05:36 konobi masak: ruh-roh
05:36 masak down to*
05:37 konobi masak: oh hey... masak! how's it going!
05:37 masak :D
05:37 konobi now I clock ^_^
05:37 masak well, hey. :) yet another survivor from back in the Pugs days. :)
05:38 masak konobi: you may be doing nodejs for your sins -- I'm doing Perl 6 macros in Rakudo for my sins ;)
05:39 masak TimToady: speaking of which, I have a question for you about unquotes.
05:40 masak TimToady: given the code `quasi { my $x = "OH NOES"; { {{{$stmt}}}; say($x) } }`, is there any AST $stmt could be that would make that code print "OH HAI\n"?
05:40 konobi masak: yar... node has taken up a lot of my life, the last few years... but mainly because i was involved very early.
05:40 masak konobi: sounds... rather nice, actually. I mean, node seems very interesting. and v8, too.
05:40 masak konobi: I'm very into JS these days, though not node in particular. just, you know, the whole thing.
05:41 masak I definitely should do more server-side things.
05:41 masak and build/toolchain things
05:42 llfourn speaking of JS is there any way to tie a self to a bit of code like in JS?
05:42 konobi masak: the fact that nodejs and npm use TAP, is genuinely my fault =0)
05:42 masak huh, Perl 6 mentioned in https://news.ycombinator.com/item?id=10404720 -- a thread about Ravi, a typed Lua
05:42 masak konobi: kudos :)
05:42 masak llfourn: depends what you mean.
05:42 konobi the big thing for node at the time and still to this day, is that it's async from day one.
05:43 * llfourn tries to figure out what he means
05:43 masak m: class A { has $.x; method foo { say($.x) } }; class B { has $.x }; A.^find_method("foo")(B.new(:x("OH HAI")))
05:43 camelia rakudo-moar 4f2ee3: OUTPUT«Type check failed in binding <anon>; expected A but got B␤  in method foo at /tmp/DeTUyyeFKg:1␤  in block <unit> at /tmp/DeTUyyeFKg:1␤␤»
05:43 masak hm :)
05:43 masak m: class A { has $.x; method foo { say($.x) } }; class B is A { has $.x }; A.^find_method("foo")(B.new(:x("OH HAI")))
05:43 camelia rakudo-moar 4f2ee3: OUTPUT«OH HAI␤»
05:44 masak so, that works :)
05:44 masak it's a kind of "tie a self" thing, if you will
05:44 konobi masak: any idea how independent moarvm is at all?
05:44 llfourn masak: But can you return a code object with the self tied into it without calling it
05:45 konobi masak: ie: could it be easily bundled in a statically linked fashion?
05:46 masak llfourn: just put it in a lambda, I guess?
05:46 masak konobi: dunno -- maybe ask #moarvm?
05:46 konobi also... how useful is moarvm by itself o.O
05:46 masak &
05:46 konobi masak: freenode?
05:47 llfourn masak: yeah -- that's what I'm doing. I was thinking that maybe you could return the method object and somehow prebind self into it and then just $method-install.()...
05:47 llfourn I mean $method.() I don't know what "install" is there
05:55 llfourn https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind <= that is what I meant
05:57 llfourn but I guess lambdas are much less cumbersome in p6 v JS so not super necessary
06:02 dalek rakudo/nom: ef77bd7 | TimToady++ | src/Perl6/Grammar.nqp:
06:02 dalek rakudo/nom: 'else' needs $/ update to see $<sym>[-1]
06:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ef77bd72ec
06:02 dalek roast: e8bc45e | TimToady++ | S04-statements/with.t:
06:02 dalek roast: test mixed if/with/else usage
06:02 dalek roast: review: https://github.com/perl6/roast/commit/e8bc45ee78
06:04 TimToady masak: I presume a statement resembling $::("OUTER::x") = "OH HAI"; would work
06:07 tokuhiro_ joined #perl6
06:10 konobi TimToady: is there any dtrace in the implementation currently?
06:12 TimToady wha?  dtrace is more like a kernel level thing, afaik
06:14 konobi nope
06:14 konobi it's a utility you can use from kernel the whole way up through userland
06:15 TimToady then I don't understand "in the implementation"
06:16 konobi while lots of the core syscalls, and libc calls are covered... you can add dtrace instrumentation to lots of stuff... perl5 has it, jvm has it, ruby and python have it... nodejs mostly does...
06:17 llfourn perl5 doc for dtrace: http://perldoc.perl.org/perldtrace.html
06:17 TimToady feel free to hack something in :)
06:17 * TimToady is just the language designer...
06:18 konobi llfourn: that's a little differnt too
06:18 konobi brb... lemme bug the dtrace guy
06:24 Hor|zon joined #perl6
06:29 masak TimToady: I realize I didn't constrain my question enough -- you're not allowed to modify the existing $x :)
06:29 masak TimToady: what I'm after is -- is there any way for an unquote to create a new variable?
06:30 masak in the *current* scope
06:31 domidumont joined #perl6
06:31 masak because if there is, as soon as there's an unquoted statement or bigger, all bets are off. we can't even say "Variable '$y' is not declared", because for all we know, it was declared in the unquoted part.
06:33 masak I take solace in the fact that (I hope) something like `my $COMPILING::y = "OH HAI";` does not make sense inside a Qtree injected into an unquote. I'm just wondering if there are other possible loopholes which might allow that.
06:33 boegel joined #perl6
06:37 domidumont joined #perl6
06:40 bjz joined #perl6
06:44 pmurias joined #perl6
06:44 pmurias konobi: hi
06:45 pmurias konobi: tools/build/gen-js-makefile.nqp is the thing that needs to be updated
06:59 masak what's the idiomatic way in Perl 6 to say "$x and $y are of exactly the same type" ?
07:00 masak $x.WHAT === $y.WHAT ?
07:02 karim joined #perl6
07:03 karim I want my class to be able to parse itself from json, something like
07:03 karim class C1 {
07:03 karim method parse-from-json($json) {
07:03 karim }
07:03 karim }
07:03 karim 1) How can I make that method static so I'll be able to call it on the class level?
07:03 karim 2) how to return "self" being an instance of C1 from "parse-from-json"?
07:04 masak m: class C1 { method parse-from-json($json) { say "look ma, no instance!" } }; C1.parse-from-json('{}')
07:04 camelia rakudo-moar ef77bd: OUTPUT«look ma, no instance!␤»
07:05 masak that's your first question, I guess. by default, methods can be called both on the class and on instances.
07:05 masak m: class C1 { has $.json; method parse-from-json($json) { self.bless(:$json) } }; C1.parse-from-json('{}').json
07:05 camelia rakudo-moar ef77bd: ( no output )
07:06 masak m: class C1 { has $.json; method parse-from-json($json) { self.bless(:$json) } }; say C1.parse-from-json('{}').json
07:06 camelia rakudo-moar ef77bd: OUTPUT«{}␤»
07:06 masak and that's the answer to your second question, I guess. you call `self.bless` to construct an instance, passing as named parameters the attribute values.
07:09 ShimmerFairy masak: though S12 does say it should default to :D on invocants, so really you should need to do  method foo(C1:_:) {...}  to get the current behavior (I don't know if there are still plans to fix that, or keep current behavior)
07:13 masak ShimmerFairy: S12: 'If you declare an ordinary method, it can function as a "class" method when you pass it a type object such as "C<Dog>" regardless of how defined the prototype object is, as long as the method body doesn't try to access any information that is undefined in the current instance.'
07:13 masak ShimmerFairy: which part of S12 were you reading? :)
07:14 ShimmerFairy "In standard Perl 6, Int is generally assumed to mean Int:_, except for invocants, where the default is Int:D. (The default new method has a prototype whose invocant is :U instead, so all new methods all default to allowing type objects.)"
07:14 ShimmerFairy masak: ^^^ that one :)
07:15 masak I'd say those two parts are in opposition.
07:15 masak (and that Rakudo is currently implementing the one I dug up.)
07:16 ShimmerFairy For the record, the part I read is newer by about a year :P  (2011 compared to 2010)
07:17 masak yes, I suspected that.
07:17 masak but the newer part is still conjectural, and unimplemented.
07:23 bjz joined #perl6
07:25 Hor|zon joined #perl6
07:32 kaare_ joined #perl6
07:35 rurban joined #perl6
07:39 masak heh. that thing where you go "why isn't this passing? this should be passing!", and then you notice that the expected value in the test is wrong :P
07:44 kanishka joined #perl6
07:50 llfourn joined #perl6
07:55 RabidGravy joined #perl6
07:55 CIAvash joined #perl6
08:05 firstdayonthejob joined #perl6
08:09 darutoko joined #perl6
08:09 tokuhiro_ joined #perl6
08:26 Hor|zon joined #perl6
08:34 FROGGS yay, I finally seem to have a proper fix for subst-in-a-loop
08:34 FROGGS it took three evenings :S
08:38 margeas joined #perl6
08:43 s_kilk joined #perl6
08:44 moritz that's the nature of some bug fixes
08:48 dalek ecosystem: 7c1cb44 | (Shane Kilkelly)++ | META.list:
08:48 dalek ecosystem: Add Config::Clever to ecosystem
08:48 dalek ecosystem:
08:48 dalek ecosystem: See https://github.com/ShaneKilkelly/perl6-config-clever
08:48 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/7c1cb442be
08:48 dalek ecosystem: d32e392 | RabidGravy++ | META.list:
08:48 dalek ecosystem: Merge pull request #80 from ShaneKilkelly/master
08:48 dalek ecosystem:
08:48 dalek ecosystem: Add Config::Clever to ecosystem
08:48 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/d32e392219
08:49 Ven joined #perl6
08:50 vendethiel joined #perl6
09:02 kjs_ joined #perl6
09:05 [Tux] test             50000    37.913    37.801
09:05 [Tux] test-t           50000    39.782    39.669
09:21 szabgab joined #perl6
09:22 Zoffix joined #perl6
09:22 Zoffix .botsnack
09:22 yoleaux :D
09:22 synbot6 om nom nom
09:22 yoleaux 14 Oct 2015 18:15Z <azawawi> Zoffix: it was the HTTP code 303 after all that caused the hanging. Now it is working :)
09:22 yoleaux 14 Oct 2015 21:48Z <ZoffixMobile> Zoffix: check out https://github.com/tony-o/perl6-hiker when you're sober
09:22 yoleaux 15 Oct 2015 15:53Z <tony-o_> Zoffix: the other thing to check out, one step more removed from hiker is HTTP::Server::Router - https://github.com/tony-o/perl6-http-server-router
09:23 szabgab p6: say 1+int rand*6
09:23 camelia rakudo-moar ef77bd: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> 3say 1+int7⏏5 rand*6␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statemen…»
09:23 szabgab p6: say 1+int(rand*6)
09:23 camelia rakudo-moar ef77bd: OUTPUT«Cannot invoke this object␤  in block <unit> at /tmp/tmpfile:1␤␤»
09:23 szabgab p6: rand*6
09:23 camelia rakudo-moar ef77bd: OUTPUT«WARNINGS:␤Useless use of "*" in expression "rand*6" in sink context (line 1)␤»
09:23 szabgab p6: 6*rand
09:23 camelia rakudo-moar ef77bd: OUTPUT«WARNINGS:␤Useless use of "*" in expression "6*rand" in sink context (line 1)␤»
09:23 szabgab p6: say 6*rand
09:23 camelia rakudo-moar ef77bd: OUTPUT«0.687734836974753␤»
09:24 szabgab p6: say int(6*rand)
09:24 camelia rakudo-moar ef77bd: OUTPUT«Cannot invoke this object␤  in block <unit> at /tmp/tmpfile:1␤␤»
09:25 moritz m: say (6*rand).Int
09:25 camelia rakudo-moar ef77bd: OUTPUT«4␤»
09:25 moritz m: say (^6).pick
09:25 camelia rakudo-moar ef77bd: OUTPUT«5␤»
09:25 RabidGravy I was just going to suggest that
09:26 moritz szabgab: .pick on a Range is the idiomatic way to generate a random integer in p6
09:26 szabgab p6: (1..6).pick
09:26 camelia rakudo-moar ef77bd: ( no output )
09:26 szabgab p6: say (1..6).pick
09:26 camelia rakudo-moar ef77bd: OUTPUT«6␤»
09:26 moritz m: .say for (1..6).roll(10)
09:26 camelia rakudo-moar ef77bd: OUTPUT«1␤6␤4␤4␤4␤5␤4␤2␤1␤1␤»
09:26 moritz or .roll, for that matter
09:27 szabgab moritz: thanks, it would be nice to mention this on http://doc.perl6.org/routine/rand
09:27 szabgab p6: say (1..6).roll
09:27 camelia rakudo-moar ef77bd: OUTPUT«1␤»
09:27 szabgab p6: say (1..6).roll
09:27 camelia rakudo-moar ef77bd: OUTPUT«5␤»
09:27 Hor|zon joined #perl6
09:28 RabidGravy It's mentioned somewhere in the docs, but can't remember where
09:29 szabgab I mean a link from rand to pick and roll
09:29 CurtisOvidPoe I now have a second box on which I’m getting this panda failure. I can’t build any Perl 6 modules as a result. https://gist.github.com/Ovid/8d3085d466110d78aeda
09:30 CurtisOvidPoe Running “rakudobrew build moar” works just fine, however.
09:30 RabidGravy that's curious
09:31 ^elyse^ joined #perl6
09:32 CurtisOvidPoe Running it through the debugger now. Last time I tried I got stuck and didn’t have the time to finish.
09:33 Zoffix Weird: "Perl v6.0.0 required--this is only v5.20.2" seems it's using perl instead of perl6
09:34 RabidGravy CurtisOvidPoe, is this a completely fresh install or was there a rakudo on there before?
09:34 CurtisOvidPoe I was wondering if somehow perlbrew and rakudobrew were incompatible.
09:34 RabidGravy I seem to recall something like this from ages ago
09:34 CurtisOvidPoe RabidGravy: on my brand, spanking new MacBook, it’s a fresh install.
09:35 CurtisOvidPoe But I’ve coped over my .bash* files and I suspect there’s something in there which might cause an issue.
09:35 RabidGravy could be a weird interaction with perlbrew
09:38 CurtisOvidPoe Getting closer. I can manually replicate this with: ‘cd /Users/curtispoe/.rakudobrew/moar-nom/panda; /Users/curtispoe/.rakudobrew/bin/../moar-nom/install/bin/perl6 rebootstrap.pl’
09:39 moritz PSA: I've just tweaked permissions of the perl6 organization on github. Every member can now create a new repo in that organization.
09:40 Zoffix \o/
09:40 moritz along with some more permissions regarding teams in that org
09:41 masak got it. thanks.
09:48 szabgab could you please review: http://perl6maven.com/number-guessing-game ?
09:49 Zoffix CurtisOvidPoe, is your PROVE_COMMAND env var set to anything?
09:49 CurtisOvidPoe Nope.
09:49 CurtisOvidPoe Still digging in :)
09:49 Zoffix :)
09:49 FROGGS_ joined #perl6
09:50 bjz joined #perl6
09:57 rindolf joined #perl6
10:00 Zoffix I've reached a dead end here: https://github.com/tadzik/panda/blob/master/lib/Panda/Tester.pm#L24 :) Seems it's not picking up the "-e /Users/curtispoe/.rakudobrew/bin/../moar-nom/install/bin/perl6" bit and runs p5 instead. But I don't have an OSX to test on :P ¯\_(ツ)_/¯
10:04 CurtisOvidPoe Zoffix: at that point, $*EXECUTABLE is set to /Users/curtispoe/.rakudobrew/bin/../moar-nom/install/bin/perl6, and $prove-command is set to ‘prove’.
10:05 CurtisOvidPoe But I’m guessing you know that :)
10:08 Zoffix I suspected so :) I wonder if that '/../' bit tripping something up in p5 land.
10:08 masak we never did reverse our decision to make .bless only reach dot-sigil attributes. is that a thing we might want to get in before Sixmas?
10:09 ggoebel joined #perl6
10:10 masak dot-sigil right now is "that arbitrary thing you have to do in order to have the default BUILD recognize your attribute"
10:10 CurtisOvidPoe Bah. I run the command manually (prove -e /Users/curtispoe/.rakudobrew/bin/../moar-nom/install/bin/perl6 -Ilib t/builder.t) and I get “Could not find Panda::Common in any of: …”
10:10 tokuhiro_ joined #perl6
10:12 CurtisOvidPoe Well, will you look at that. When I set PERL6LIB correctly from the command line, it all passes ( PERL6LIB=/Users/curtispoe/.rakudobrew/moar-nom/install/share/perl6/site/lib,ext/File__Find/lib,ext/Shell__Command/lib,ext/JSON__Fast/lib,lib prove -e /Users/curtispoe/.rakudobrew/bin/../moar-nom/install/bin/perl6 -Ilib t/builder.t )
10:13 ShimmerFairy masak: from the perspective of "$.foo is public, $!foo is private", it makes sense. From the perspective of "$!foo is an attribute, $.foo will generate a getter method for it too", not so much :)
10:13 masak ShimmerFairy: I remember how it came about. it was in a p6c thread I started, I believe.
10:14 masak ShimmerFairy: the intent was noble: prevent excessive knowledge of truly private things
10:15 masak the eventual fallout was twofold: disallow .new/.bless from installing values in private attrs, and disallow .perl from showing them
10:15 masak m: class C { has $!x = 42 }; say C.new.perl
10:15 camelia rakudo-moar ef77bd: OUTPUT«C.new␤»
10:15 masak :(
10:15 masak I'm not so sure those decisions were correct anymore.
10:15 masak .perl is a debugging tool, a way to say "OK, just show me what's inside"
10:15 ShimmerFairy masak: I think the problem is that "public" and "private" don't mean anything truly special in class attributes. Now that I think about it, I find it hard to believe that the distinction exists for P6 at all.
10:15 masak it's not necessarily a tool that needs to play by encapsulation rules
10:16 masak ShimmerFairy: "private" does mean something. Perl 6 objects really are opaque. the question is more what role you are in when you do .new and .perl, and whether normal concerns of encapsulation apply there.
10:16 dalek rakudo/nom: 32d7b08 | FROGGS++ | src/ (2 files):
10:16 dalek rakudo/nom: fix usage of match variable in replacement part of substitution
10:16 dalek rakudo/nom:
10:16 dalek rakudo/nom: $_ ~~ s[(.)] = "$0" compiled to $_.subst{-mutate} before. This was
10:16 dalek rakudo/nom: problematic in so far that the $0 in the string were interpolated
10:16 dalek rakudo/nom: before the match (.) happened.
10:16 dalek rakudo/nom: The we compile to a method call to .match and APPLY-MATCHES separately,
10:16 dalek rakudo/nom: which gives us the opportunity to set $/ before interpolating the match
10:16 dalek rakudo/nom: result in the right hand side.
10:16 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/32d7b08334
10:17 ShimmerFairy masak: In other words, the $.foo form feels less like "this is an attribute of the public kind", and more like "this is sugar for a $!foo attr and writing both a 'method foo'"
10:18 masak well, yes
10:18 masak but those things are for "normal" use of a class
10:18 ShimmerFairy Aside from the artificial-seeming limitation of the default BUILD, I don't think there's a real, technical difference. I think P6's version of "public" turned out to be implemented as just "methods returning a [private] attribute"
10:19 ShimmerFairy masak: here's the problem, though: I can define a method foo { $!foo } , and suddenly it's public. I can define my own method foo { die } , and now the 'foo' attribute is private.
10:19 CurtisOvidPoe Zoffix: By the time we get to run-and-gather-output(*@command), everything seems fine. If I skip the Proc::Async code (to avoid trying to debug that!) and let it run via ‘my $p = shell("$cmd 2>&1", :out);’, it fails for the same reason. If I run the $cmd (setting PERL6LIB) from the command line, it works just fine.
10:20 CurtisOvidPoe So are there any known bugs regarding the shell() command on OS X?
10:20 RabidGravy .tell szabgab you might find something like https://gist.github.com/jonathanstowe/c569f10659f13cb43abd is even more idiomatic
10:20 yoleaux RabidGravy: I'll pass your message to szabgab.
10:21 RabidGravy .tell szabgab but otherwise yeah great :)
10:21 yoleaux RabidGravy: I'll pass your message to szabgab.
10:22 masak m: class C { has $!x; method !x() is rw { return-rw $!x }; method new { my $o = self.bless; $o!x = 42; $o } }; say .^attributes[0].get_value($_) given C.new
10:22 camelia rakudo-moar ef77bd: OUTPUT«42␤»
10:22 masak ShimmerFairy: I don't see that as a problem, as long as the default accessor method does the right thing.
10:23 ShimmerFairy masak: unless there's a real difference between public and private beyond just "there is[n't] a method for it" that I'm unaware of, I think you could actually make the argument that Perl 6 doesn't technically have a concept of public/private attributes, they're all "private" :)
10:25 bjz_ joined #perl6
10:28 CurtisOvidPoe OK, I don’t think it’s the shell() command because I have a small test case which runs just fine with that :/
10:28 Hor|zon joined #perl6
10:29 CurtisOvidPoe How come when I run a shell command and print the results with “for $result.out.lines { .chars && .say; }”, it works fine but ends with the warning “Invocant requires an instance of type IO::Pipe, but a type object was passed.  Did you forget a .new?”?
10:31 masak ShimmerFairy: yes, that argument can indeed be made. which only strengthens the case for re-allowing .new/.bless/.perl to reach them
10:31 masak (because the distinction "has an auto-generated accessor" isn't a very meaningful one)
10:32 ShimmerFairy masak: that's why, now that I'm thinking about it, I can't really see much of a point for making .new/.bless/.perl ignore "private" attributes :)
10:32 ShimmerFairy (and now I also wonder what the distinction ends up being like in other languages :P)
10:32 masak that's what I'm saying.
10:33 masak it was a noble goal, but it doesn't really make sense to exclude accessor-less attributes.
10:35 CurtisOvidPoe I asume we can’t actually run the shell() command with p6? I’d try, but it seems rude :)
10:37 moritz CurtisOvidPoe: you may try; just don't do something fatal with it, in case it works
10:37 moritz m: shell("echo foo")
10:37 camelia rakudo-moar ef77bd: OUTPUT«shell is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting:1␤  in sub shell at src/RESTRICTED.setting:15␤  in block <unit> at /tmp/GCmiBtbPDx:1␤␤»
10:39 * llfourn learns that there is a a way to restrict use of some things in rakudo
10:39 CurtisOvidPoe Here’s the exact error I’m getting: https://gist.github.com/Ovid/fe4fb45360d32369cf67
10:40 CurtisOvidPoe (Along with the code to invoke it. I can’t see what I did wrong)
10:41 CurtisOvidPoe Hmm, should have been .chars, but that doesn’t impact it.
10:42 RabidGravy CurtisOvidPoe, need an :out on the shell()
10:44 llfourn perl6 -e 'shell("ls -l /")' by itself prints stuff out o.O
10:45 RabidGravy yeah, but without the :out adverb it doesn't capture it hence the .out is just a type object
10:45 CurtisOvidPoe Cheers!
10:45 llfourn so it is simply outputting to stdout by default?
10:45 RabidGravy it's not capturing so the output of the command is just going to where it would go
10:46 llfourn orite
10:47 CurtisOvidPoe I feel like such a complete n00b :)
10:48 RabidGravy :) but we love you anyway
10:48 CurtisOvidPoe And I can verify that “my $result = shell("prove -e $*EXECUTABLE -Ilib test.p6"):out;“ works just fine in a small test case. It’s in building panda that something goes horribly wrong.
10:58 CurtisOvidPoe Does anyone here have an OS X box on which they have successfully done ‘rakudobrew install panda’?
10:58 RabidGravy sorry
10:59 CIAvash joined #perl6
11:00 Nickmob joined #perl6
11:01 llfourn CurtisOvidPoe: yes, but months ago
11:02 llfourn for me it's rakudobrew build-panda
11:07 ^elyse^ joined #perl6
11:09 virtualsue joined #perl6
11:12 CurtisOvidPoe It’s something in my environment. I can now build panda with this: env -i PATH=/usr/bin:/Users/curtispoe/.rakudobrew/bin rakudobrew build-panda
11:15 RabidGravy weird
11:15 CurtisOvidPoe I’ll figure it out now, but I have a couple of other things I need to resolve first.
11:16 CurtisOvidPoe In short: this is great news :)
11:16 RabidGravy :)
11:18 RabidGravy in a completely un-related note what's the best way to capture control when the accessor is being added for a "public attribute" in order to apply a role to the created method?
11:18 bjz joined #perl6
11:19 moritz m: say Num.^can('sqrt').^name
11:19 camelia rakudo-moar 32d7b0: OUTPUT«List␤»
11:19 moritz m: say Num.^can('sqrt')[0] does role { method flurb() { } };
11:19 camelia rakudo-moar 32d7b0: OUTPUT«sqrt␤»
11:20 moritz RabidGravy: something like this?
11:21 RabidGravy well sort of - I want to do "has $.foo is something" and for the application of something to cause a role to be applied to the accessor's method
11:22 RabidGravy so adding the role is fine and I grok that, I just want to get at the accessor method as early as possible
11:22 moritz ah, you want to write a trait
11:26 RabidGravy yeah, I'm cool with writing the trait, just want to know (.e.g) if I can apply a role to the attribute object via the trait which in turn can influence the accessor method
11:26 moritz what difference does early versus late make?
11:26 llfourn RabidGravy: Maybe custom metaclass and override: http://docs.perl6.org/type/Metamodel::AttributeContainer#method_add_attribute
11:27 RabidGravy moritz, largely because what I actually have in mind is a form of "access control" for object members and in that case I figure that earliest is bestest
11:29 moritz m: role important { }; multi sub trait_mod:<is>(Attribute $a, important) { say "applying trait"; $a does important }; class Foo { has $.x is important };
11:29 camelia rakudo-moar 32d7b0: OUTPUT«applying trait␤»
11:29 RabidGravy with a normal method it's fairly simple - trait on the method that dicks with the CALL-ME or something to provide the appropriate control
11:29 Hor|zon joined #perl6
11:29 moritz RabidGravy: fwiw if you supply your own accessor, none will be generated
11:30 RabidGravy yeah, but doesn't make such a nice interface
11:30 dalek features: 0286bce | (Zoffix Znet)++ | template.html:
11:30 dalek features: Fix markup error
11:30 dalek features: review: https://github.com/perl6/features/commit/0286bce8d9
11:31 Zoffix Oh god >_<
11:31 moritz RabidGravy: I don't think we're quite on the same wavelength here
11:31 Zoffix So much for --patch when you still commit with your 'add --all' alias
11:32 moritz Zoffix: get rid of that alias, I'd say :-)
11:32 Zoffix :)
11:37 RabidGravy moritz, actually I got it I think, need to wrap Attribute.compose, callsame the original then get the method and apply the role to it
11:37 diana_olhovik_ joined #perl6
11:45 kjs_ joined #perl6
11:49 nine r: sub s_s(*%n)  { %n>>.say }; s_s(|{:assoc<list>},:assoc<left>);
11:49 yoleaux 17 Oct 2015 17:45Z <jnthn> nine: IIRC, it was .clone not being deep enough, but I don't remember exactly either :(
11:49 yoleaux 17 Oct 2015 17:45Z <jnthn> nine: Maybe not creating fresh Scalar containers or so
11:49 camelia rakudo-moar 32d7b0: OUTPUT«list␤»
11:49 camelia ..rakudo-jvm 32d7b0: OUTPUT«left␤»
11:52 BenGoldberg joined #perl6
11:52 Ven joined #perl6
11:53 Ven_ joined #perl6
11:54 xfix joined #perl6
11:55 spider-mario joined #perl6
12:02 karim joined #perl6
12:03 CurtisOvidPoe I found the problem with my ‘rakudobrew build-panda’. As a convenience, I’ve set my PERL5LIB to ‘lib’. If I run ‘PERL5LIB= rakudobrew build-panda’, it works just find. Why does setting my PERL5LIB to ‘lib’ break rakudobrew build-panda?
12:06 ngie joined #perl6
12:07 ^elyse^ joined #perl6
12:08 kid51 joined #perl6
12:10 azawawi joined #perl6
12:10 azawawi hi #perl6
12:10 telex joined #perl6
12:11 moritz CurtisOvidPoe: it might try to load a Perl 6 module from Perl 5 somewhere down the rabbit hole
12:11 llfourn CurtisOvidPoe: same for me! -- looks like putting 'lib' must goof one of the perl commands because it adds a lib and perl5 tries to run a perl6 thing.
12:12 azawawi https://github.com/azawawi/perl6-selenium-webdriver/blob/master/examples/ex01.p6   # Automated UI test: Searching using google for "Perl 6\n" keyword :)
12:17 Zoffix azawawi, neat. What User-Agent does it report to Google?
12:18 Zoffix ('cause I know google blocks Perl 5's LWP, for example)
12:18 dalek roast: f665268 | FROGGS++ | S04-statements/for.t:
12:18 dalek roast: unfudge/add tests for capture in subst in loop
12:18 dalek roast: review: https://github.com/perl6/roast/commit/f665268fde
12:18 azawawi Zoffix: well im not setting a user agent atm
12:19 Zoffix azawawi, that "sleep 1;" is iffy though. What if it takes more than a second? Is there no way to check whether the request has completed?
12:19 azawawi Zoffix: going to implements waits :)
12:19 Zoffix \o/
12:21 karim is there any way to return an instance on the current class from a method without having to specify the name of the class? I'd like something like this:
12:22 karim class C1 { method m1() { ....; return self(1, 2, 3); } }
12:22 llfourn karim: self.new?
12:22 karim thx
12:22 azawawi Zoffix: then create a good documentation website like this one http://selenium-python.readthedocs.org/en/latest/getting-started.html
12:22 llfourn karim: my pleasure :)
12:23 leont joined #perl6
12:23 Zoffix azawawi, nice. That'll be a useful module.
12:23 azawawi yup
12:25 azawawi Zoffix: your github ticket is really useful. We need more documentation. That's what drew me into Perl in the first place.
12:26 azawawi Zoffix: doc.perl6.org is useful but lacks organization to a newbie imho
12:26 Zoffix It lacks a more powerful search too.
12:27 azawawi Zoffix: we need also to cater to our users e.g. new to Perl, old Perl 5 user and existing Perl 6 user
12:28 azawawi saying infix, postfix to someone new to Perl is like saying to him/her go away :)
12:29 azawawi i.e. http://doc.perl6.org/routine.html
12:30 karim joined #perl6
12:30 Hor|zon joined #perl6
12:31 azawawi comparing http://selenium-python.readthedocs.org/en/latest/getting-started.html to http://doc.perl6.org => no introduction or getting started whatsoever
12:31 karim I can't find the information about the "return",  is it optional? in the documentation it's not specified, however it seems it is optional.
12:31 dalek features: fd38b65 | (Zoffix Znet)++ | template.html:
12:31 dalek features: Fix incorrect overflow on mobile (Closes #4). Fix missing footnotes (Closes #3)
12:31 dalek features:
12:31 dalek features: pos:abs; on footnotes without a near parent causes them to invisibly overflow past .table-responsive
12:31 dalek features: review: https://github.com/perl6/features/commit/fd38b653c0
12:31 FROGGS_ azawawi: please file a doc issue
12:32 azawawi karim: return is optional
12:32 karim and how about ";" ?
12:32 llfourn azawawi: We do need a more general tutorial and to make tutorials more visually seperate.
12:33 azawawi llfourn: true
12:34 Zoffix karim, it's usually not optional. There are cases where it is, but even in those it's recommended that you place it anyway
12:34 azawawi m: sub foo { }; say foo.perl;
12:34 camelia rakudo-moar 32d7b0: OUTPUT«Nil␤»
12:34 azawawi m: sub foo { return }; say foo.perl;
12:34 camelia rakudo-moar 32d7b0: OUTPUT«Nil␤»
12:34 llfourn karim: return isn't documented properly anywhere afaik sorry!
12:34 azawawi m: sub foo { 1 }; say foo.perl;
12:34 camelia rakudo-moar 32d7b0: OUTPUT«1␤»
12:35 azawawi m: sub foo { ; }; say foo.perl;
12:35 camelia rakudo-moar 32d7b0: OUTPUT«Nil␤»
12:35 Zoffix FWIW: I was responding to "<karim> and how about ";" ?" :)
12:36 llfourn Zoffix: ah. Yeah I guess wtf is ';' is a question a lot of newbies will have.
12:36 llfourn this is where a general intro tutorial would be good
12:36 karim sorry, I don't understand. Is ";" optional or does it depend whether it's being used in the last sentence or not?
12:37 kjs_ joined #perl6
12:37 Zoffix karim, depends on whether it's last. if it's not last, then it's not optional.
12:38 karim ok
12:39 dalek features: 4cc9f61 | (Zoffix Znet)++ | template.html:
12:39 dalek features: Remove debugging markup
12:39 dalek features: review: https://github.com/perl6/features/commit/4cc9f61481
12:47 azawawi how can i embed github markdown in pod6 blocks?
12:49 azawawi rationale: markdown is way easier to work with than pod6
12:50 * pink_mist disagrees with that rationale, but don't let that get in the way of you trying =)
12:50 vendethiel joined #perl6
12:52 moritz azawawi: indent it 4 spaces
12:53 * azawawi tries it
12:54 vendethiel FROGGS_++
12:57 azawawi moritz: but why 4 spaces btw?
12:57 cognominal joined #perl6
12:58 pink_mist isn't that the standard markdown indenation style?
12:58 moritz azawawi: that way it doesn't get falsly parsed as pod
12:59 moritz the beauty is that you can use *any* markup in pod6 if you indent it
12:59 Zoffix 0.o
13:00 ShimmerFairy moritz: um... that's not right. Indenting just makes it an implicit =code block, and only in certain blocks. If you had, say, a line starting with an = in there, it'll be parsed as trying to begin a block
13:02 moritz ShimmerFairy: yes, and you can put markdown in there all you like
13:02 ShimmerFairy moritz: sure, but it'll just be a section of code. Suggesting code blocks as anything but that is just wrong.
13:03 RabidGravy couldn't you just do =begin markdown ... =end markdown ?
13:03 ShimmerFairy The real way to do it would be to put your markdown in some kind of  =Markdown  block, and then have a module or renderer that knew how to handle those blocks.
13:03 ShimmerFairy RabidGravy: yes, but not spelled 'markdown', that's a reserved block name :)
13:03 moritz RabidGravy: sure, but no renderer currently does anything with that block
13:04 RabidGravy well, surely if people want to use it then they should consider making a renderer ;-)
13:08 pmurias masak: re hiding private attributes from perl, how can you get them for debugging?
13:08 moritz pmurias: through the MOP
13:09 moritz http://doc.perl6.org/type/Attribute#method_get_value
13:09 pmurias seems really inconvenient
13:09 pmurias what was the reason for hidding the from .perl?
13:10 moritz it's *private*
13:10 azawawi m: constant NUMPAD_0 = "\x01A";
13:10 camelia rakudo-moar 32d7b0: ( no output )
13:10 moritz private attributes aren't inistialized by the default constructor
13:10 azawawi m: constant NUMPAD-0 = "\x01A";
13:10 camelia rakudo-moar 32d7b0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/85iGiBeUAD␤Missing initializer on constant declaration␤at /tmp/85iGiBeUAD:1␤------> 3constant NUMPAD7⏏5-0 = "\x01A";␤»
13:10 moritz so including it in .perl output doesn't make sense, because you can't use it recreate the value
13:11 azawawi NUMPAD-0 is not a valid kebab case constant identifier?
13:11 moritz azawawi: no
13:11 moritz because 0 isn't an identifier
13:11 azawawi i see
13:11 dalek doc: 3f80b9a | moritz++ | doc/Type/Attribute.pod:
13:11 dalek doc: Fix a usage example
13:11 dalek doc: review: https://github.com/perl6/doc/commit/3f80b9a2f1
13:11 ShimmerFairy moritz: as mentioned earlier, the problem at least to me is that there isn't really a difference between private and public attributes in Perl 6; the "no private attr by default" thing for .new and such feels arbitrary to me.
13:12 moritz ShimmerFairy: .new is part of the public API. If it set a private attribute, that attribute wouldn't be private
13:13 dalek doc: 774d9bd | moritz++ | doc/Type/Attribute.pod:
13:13 dalek doc: fix another Usage example
13:13 dalek doc: review: https://github.com/perl6/doc/commit/774d9bd7c3
13:13 ShimmerFairy moritz: but what is the difference between public and private attributes? Just sugar for an accessor method.
13:13 aborazmeh joined #perl6
13:13 aborazmeh joined #perl6
13:13 zakharyas joined #perl6
13:13 azawawi moritz: so kebab case in Perl 6 has its edge cases to handle when converting legacy code
13:13 moritz ShimmerFairy: no; there's meta data that identifies the attribute as public
13:14 moritz azawawi: Perl 6 identifiers follow rules, just like identifiers in any sane language. Of course this has implications.
13:15 ShimmerFairy moritz: but what for? AFAICT it's only for limiting what .new and .bless do by default, and what you do and don't see in .perl . There's no real difference between them. (Unlike in, say, C++, where public and protected attrs are directly usable by a subclass, and privates aren't)
13:16 Zoffix m: class Foo { has $!bar = 42; has $.ber = 43;  method moo { $!bar = 54; } }; my $x = Foo.new; $x.moo; say $x.get_value('bar')
13:16 moritz ShimmerFairy: what for? for avoiding private attributes leaking out
13:16 camelia rakudo-moar 32d7b0: OUTPUT«Method 'get_value' not found for invocant of class 'Foo'␤  in block <unit> at /tmp/PUtL2yxMNb:1␤␤»
13:16 Zoffix How do I fix this error?
13:16 ShimmerFairy moritz: my argument is that Perl 6 doesn't really have the notion of public vs. private attributes other than the seemingly arbitrary limits on a couple methods, such as .new
13:16 RabidGravy azawawi, from Perl 5 things you have watch for is e.g. print time-rand
13:16 moritz Zoffix: get_value is a method of the Attribute class
13:16 ShimmerFairy moritz: I can write  method foo { $!foo }  and suddenly it's like I typed  has $.foo  . I don't see how that's a useful distinction for limiting what .new and .bless accept by default
13:17 moritz Zoffix: which you can get via introspection
13:17 moritz ShimmerFairy: it has the distinction, and it's not arbitrary
13:17 Zoffix alright.
13:17 moritz ShimmerFairy: it's designed so that as somebody extern to the class, you never interact with private attributes in any way, except if you chose to go cheating (via the MOP)
13:18 masak m: sub foo { Empty }; say foo().perl
13:18 camelia rakudo-moar 32d7b0: OUTPUT«()␤»
13:18 moritz ShimmerFairy: which is the very definition of "private"
13:18 ShimmerFairy moritz: why is it not arbitrary, though? As far as I can tell, P6's "public" attribute is just a private attribute that creates an accessor method for you; you still interact with those attributes in-class via $!foo , for example
13:18 moritz ShimmerFairy: well, that quote isn't entirely accurate
13:19 moritz ShimmerFairy: and it's not arbitrary, because those restrictions cause an outsider to never see a private attribute
13:19 moritz ShimmerFairy: which is what makes them *private*
13:19 moritz ShimmerFairy: what would you consider private?
13:19 moritz "the amount of money I have on the bank is private, but if you call .perl on the bank account, you see it anway"?
13:19 ShimmerFairy moritz: I don't think you're understanding me. I'm arguing that because of how Perl 6 decided to implement public vs. private attributes, there's no real distinction. All attributes are private, and the  has $.foo  declaration just creates a getter method for you
13:20 moritz ShimmerFairy: but that's not true
13:20 moritz ShimmerFairy: which I'm trying to tell you
13:20 moritz ShimmerFairy: a public attribute is a private attribute + accessor + META DATA THAT MARKS IT AS PUBLIC
13:20 moritz and it's that meta data that makes .perl and .new respond to them
13:21 pmurias moritz: the real distinction is that the private attributes are declare as has $.foo the private ones as $!foo
13:21 ShimmerFairy moritz: what I'm arguing is that the "marks it as public" that lets default .new and so on use it isn't necessary. To me, the distinction should be far stronger than "the compiler says so"
13:21 pmurias s/.foo/.foo and the/
13:21 pmurias ShimmerFairy: it's not necessary
13:21 moritz ShimmerFairy: it is necesary
13:22 moritz ShimmerFairy: otherwise, privates would leak out
13:22 moritz you'd have to overwrite your own .perl and .new just to prevent privates from leaking out
13:22 moritz which wouldn't make them very private
13:22 moritz is that really that hard to understand?
13:22 pmurias moritz: .perl is just for debugging
13:22 moritz pmurias: no
13:22 ShimmerFairy moritz: every time you say "privates would leak out", I feel like you don't get me. I'm saying that attributes are all private, what makes them public is just the getter method.
13:23 moritz ShimmerFairy: and I'm telling you again and again that it's not true
13:23 pmurias ShimmerFairy: what makes them public is the getter method and the magic "public" bit
13:23 moritz ShimmerFairy: and you haven't yet presented a coherent design where that could be true, and privates wouldn't accidentally leak out
13:23 pmurias ShimmerFairy: we could only have private attributes but it would be bloody annoying to write the getters
13:24 eliasr joined #perl6
13:24 moritz pmurias: .perl is specified to round-trip under EVAL, not be useful for debugging
13:25 ShimmerFairy moritz: to me, "leak out" means "an external user can see it". With my "all attrs are really private" idea, that doesn't happen unless you specifically write a method that gives it.
13:25 pmurias what uses besides debugging does it have?
13:25 moritz pmurias: serialization
13:25 ShimmerFairy pmurias: to be clear, I'm not advocating abolishing  has $.foo  , just the part where that magically makes it ok for default .new, .bless, and .perl to see it  :)
13:26 moritz ShimmerFairy: ok, please formulate your "all attrs are really private" proposal in a gist or so; including answers to questions like "how does the default constructor work?"
13:26 pmurias ShimmerFairy: that part is just useful
13:27 pmurias moritz: is there a way to safely unpack .perl output?
13:27 ShimmerFairy moritz: the default constructor works like it does in NQP, or in other words takes all attributes by default. I don't know why you're so insistent on not understanding my point (ooc, have you seen the backlog where masak brought it up?)
13:27 moritz ShimmerFairy: if it respects all attributes, then those attributes aren't really private
13:28 moritz ShimmerFairy: which *directly* contradicts your "all attributes are private" approach
13:28 moritz pmurias: no; but there are many use cases where you don't have to
13:29 azawawi moritz: i see. thanks :)
13:29 ShimmerFairy moritz: when I talk about private attributes, I'm not talking about the strict, language-agnostic term, but I'm referring to specifically $!foo . In other words, "All $.foo are really $!foo with a method foo created for you"
13:29 moritz ShimmerFairy: ok, so then how would you make language-agnostic private attributes with your proposal?
13:29 moritz ShimmerFairy: attributes that the outside never sees?
13:30 azawawi moritz: solved it by moving it into a hash https://github.com/azawawi/perl6-selenium-webdriver/blob/master/lib/Selenium/WebDriver/Keys.pm6 :)
13:31 moritz azawawi: looks like a sensible choice :-)
13:31 ShimmerFairy moritz: All I know is that it's more often annoying than helpful for me that .new won't accept private attributes. To me, "public" means "the user of the object can mess with these variables", where "private" is more "the user of the object isn't trusted to safely mess with these directly"
13:31 Hor|zon joined #perl6
13:31 ngie left #perl6
13:31 llfourn moritz: do you coulnt setting the value of a private attribute at object contruction time to be seeing it?
13:31 llfourn count*
13:32 moritz ShimmerFairy: if the behavior of private attributes isn't useful to you, just use public attributes
13:32 ShimmerFairy So for .new, there are cases where I want the user to set an initial value, but otherwise I need to control retrieval and/or modification from the class.
13:32 moritz llfourn: of course
13:32 moritz ShimmerFairy: there are solutions to that in current Perl 6 too
13:32 llfourn mortiz: ok just checking as I think this is the crux of your disagreement
13:33 _28_ria joined #perl6
13:33 RabidGravy ShimmerFairy, in that case I'd consider making a BUILD that pretended to do that
13:33 moritz llfourn: if the outside can interact with it by default, it's not private. It's quite easy, IMHO :-)
13:33 ShimmerFairy moritz: And I'd disagree with that. To me, public/private is more about usage, and construction is a different process that happens before usage can begin.
13:33 moritz ShimmerFairy: well, if you have your own private definition of "private", of course it won't align with the default of how private attributes work
13:33 llfourn mortiz: being able to set it at object contruction time and then never set or get it again.... some might consider that private?
13:33 ShimmerFairy RabidGravy: the issue here is that having to write a new BUILD just because one attribute of yours doesn't fit neatly into either 'public' or 'private' as descriptors is LTA :)
13:34 llfourn mortiz: but I see your point :)
13:34 colomon or to put it another way, you should be able to change the name of a private attribute without affecting any code outside of your class.
13:34 moritz colomon: thanks, that's a nice way to put it
13:34 RabidGravy :)
13:35 ShimmerFairy RabidGravy: actually, the worst is when you write a .new that does positional stuff (thus you don't use attribute names as a user), and you still have to write your own BUILD, even though "you can change the name of a private attribute without affecting outside code" with that kind of .new  :)
13:37 RabidGravy in that case, if this was going to happen more than once in some code I intended to write I would make a role that provided a BUILD that would provide for the initialisation of otherwise private attribuates that are marked with some trait
13:37 RabidGravy :)
13:37 Zoffix In Perl 5's Moo, this type of stuff is done with public attributes that are "ro" (read only). Can't modify them after initialization. Maybe Perl 6 could have that, if it does not already. <ShimmerFairy> where "private" is more "the user of the object isn't trusted to safely mess with these directly"
13:38 Zoffix Or rather 'rwp' would be more appropriate: read only to the outside / read-write inside.
13:38 ecocode joined #perl6
13:38 ShimmerFairy Zoffix: that's how public attributes are by default (read-only). I suppose my issue is just that I don't call them public, and being forced to do so feels like a mistake
13:38 colomon what RabidGravy seems to be asking for is public attributes without accessors.
13:38 colomon which is pretty trivial to do by hand for each such attribute.
13:39 colomon and I suspect could easily be written up as a trait.
13:39 Zoffix ShimmerFairy, what do you call something that is invisible from the outside?
13:39 llfourn ShimmerFairy: so what you want is an attribute that is available to bless and default new but has no accessors?
13:39 RabidGravy *I'm* not asking for anything, I'm suggesting how one would achieve that without changing Perl
13:39 ShimmerFairy Basically, being forced to write your own BUILD just because you want to organize things lightly differently feels a bit too Boost-like for my tastes.
13:39 colomon RabidGravy: sorry, meant ShimmerFairy
13:39 RabidGravy :)
13:40 ShimmerFairy Keep in mind that masak is the one that brought it up, I'm generally fine with how things are now. I'm just arguing that the distinction doesn't seem significant enough, and thus the limits on default .new and .bless feel arbitrary
13:40 abaugher joined #perl6
13:40 moritz ShimmerFairy: can you name a few use cases of attributes that you want to be set from the outside during construction, but that shouldn't be readable once constructed?
13:40 pmurias ShimmerFairy: it's not arbitary, it's the only way that makes sense
13:41 ShimmerFairy (by "too Boost-like", I mean that the Boost library has too much of that "Want it lightly different? Now you have to write *ALL* the code!")
13:41 pmurias ShimmerFairy: just import some module which give you the no-access trait
13:42 RabidGravy yeah which is what I am suggesting
13:42 ShimmerFairy SecureRandomNumbers.new(:seed(42)) -- let the user set the seed, but I'm guessing you probably don't want that freely available in a more secure environment :)
13:42 moritz ShimmerFairy: but Perl 6 isn't a more secure environment
13:43 moritz ShimmerFairy: so that feels like a very constructed argument
13:43 ShimmerFairy moritz: they why are you carping about the need for private variables to not leak in the first place?
13:43 moritz private attributes can *never* be a security feature within the same process
13:44 moritz ShimmerFairy: because I want to avoid things becoming API that aren't meant to be API
13:44 moritz ShimmerFairy: it's the difference between avoiding leaks to avoid environmental pollution, and avoiding leaks as a security feature
13:46 ShimmerFairy moritz: I realize they're different areas, but I don't think it's very fair for you to go on about security in one respect (keeping API stable), and then criticize an example referencing security in another respect
13:46 RabidGravy yeah, data hygiene is different to data security
13:46 moritz ShimmerFairy: I've never today talked about security before
13:47 Zoffix ShimmerFairy, but how is that example secure? The user has the number ("42"), so restricting their reading it via an accessor is not much of a feature. What am I missing?
13:47 moritz ShimmerFairy: more about safety, really. Mentally mixing those two isn't a good idea
13:48 RabidGravy you do all realise in the time that this discussion has taken to get nowhere some proof of concept as I outlined above could have been written? ;-)
13:48 Zoffix :)
13:48 moritz RabidGravy: I asked for an example use case because I thought the discussion was going nowhere
13:48 moritz RabidGravy: and so far got only one constructed, unapplicable example
13:49 * llfourn enjoyed the discussion and understood both sides
13:50 moritz TBH in the past I've sometimes wished for this feature too, but upon closer inspection, none of my use cases has held up
13:50 moritz so now I'm looking for other people's use cases
13:50 SqrtNegInf joined #perl6
13:54 llfourn I also feel that having to write special methods to use constructor arguments to influence or set default values for $! attributes is a bit annoying
13:54 llfourn which is why I hardly ever use them
13:56 llfourn something like class A { has $!a is contructor-param; } so $!a could be set by bless would be nice.
13:57 RabidGravy which could be done with a user supplied role and a trait
13:58 llfourn RabidGravy: yep probs best to test out the idea in that respect at least
14:00 RabidGravy not everything has to be in the language
14:00 llfourn on a similar subject is there a way to set default values for attributes from other attributes like: class A { has $.a = 'default'; has $.b = $.a; }
14:00 llfourn like in Moose with lazy => 1
14:02 moritz m: class A { has $.a = 'default'; has $.b = $.a; }; say A.new.b
14:02 camelia rakudo-moar 32d7b0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/jAIrABouZT␤Virtual call $.a may not be used on partially constructed objects␤at /tmp/jAIrABouZT:1␤------> 3s A { has $.a = 'default'; has $.b = $.a7⏏5; }; say A.new.b␤    expecting any of:␤     …»
14:02 moritz m: class A { has $.a = 'default'; has $.b = self.a; }; say A.new.b
14:02 camelia rakudo-moar 32d7b0: OUTPUT«default␤»
14:02 moritz m: class A { has $.a = 'default'; has $.b = self.a; }; say A.new(a => 'blurb').b
14:02 camelia rakudo-moar 32d7b0: OUTPUT«blurb␤»
14:02 llfourn mortiz: awesome :)
14:02 * llfourn goes to document this feature
14:03 RabidGravy has that always worked?  I thought I tried that before and it complained about not being able to use self there
14:03 moritz llfourn: btw if you tab-complete my nick name after the first two or three characters, you're unlikely to misspell it every time :-)
14:04 moritz RabidGravy: it has worked for years, though it used to work with $.a syntax instead of self.a
14:05 RabidGravy Hmm weird, must be a false memory or I was trying to do something more complicated
14:05 llfourn moritz: thanks!
14:07 kjs_ joined #perl6
14:08 dalek roast: da8c0ee | usev6++ | S11-modules/require.t:
14:08 dalek roast: Add "use lib '.';" for test that needs it
14:08 dalek roast: review: https://github.com/perl6/roast/commit/da8c0ee3e1
14:11 llfourn moritz: is it meant to work wtih $.a?
14:11 dalek rakudo/nom: 23ccdc2 | lizmat++ | src/core/Supply.pm:
14:11 dalek rakudo/nom: Fix an omission in emission tracking
14:11 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/23ccdc2285
14:12 pink_mist lizmat++ I bet you enjoyed writing that commit message :P
14:12 lizmat :-)  yes I did  :-)
14:12 RabidGravy the VW commit
14:12 lizmat been binge watching Bones to get in the mood
14:12 lizmat RabidGravy: yes, and that  :-)
14:13 lizmat afk again&
14:18 dalek roast: 85edc25 | usev6++ | S32-num/power.t:
14:18 dalek roast: (Re-)fudge test for big exponent on rakudo.moar
14:18 dalek roast:
14:18 dalek roast: test was unfudged with b0f743e59e but is failing for a while now
14:18 dalek roast: review: https://github.com/perl6/roast/commit/85edc256ac
14:20 grondilu_ m: say &[>+<]
14:20 camelia rakudo-moar 32d7b0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Jy9OiphBYb␤Unable to parse expression in infix noun; couldn't find final ']' ␤at /tmp/Jy9OiphBYb:1␤------> 3say &[>7⏏5+<]␤»
14:21 * grondilu_ was wondering what is this equiv('>+<') mentioned above
14:22 Akagi201 joined #perl6
14:22 grondilu joined #perl6
14:24 Sgeo joined #perl6
14:31 dalek doc: 9793f64 | (Lloyd Fournier)++ | doc/Language/objects.pod:
14:31 dalek doc: mixed in a self into the attribute default example
14:31 dalek doc: review: https://github.com/perl6/doc/commit/9793f6450d
14:32 Hor|zon joined #perl6
14:32 pmurias_ joined #perl6
14:34 Ven_ joined #perl6
14:34 masak m: say Seq.^roles
14:34 camelia rakudo-moar 32d7b0: OUTPUT«Method 'iterator' must be implemented by PositionalBindFailover because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp:2661␤  in any apply at gen/moar/m-Metamodel.nqp:2671␤  in any compose at gen/moar/m-Metamodel.n…»
14:34 masak m: say Array.^roles
14:34 camelia rakudo-moar 32d7b0: OUTPUT«Method 'iterator' must be implemented by Iterable because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp:2661␤  in any apply at gen/moar/m-Metamodel.nqp:2671␤  in any compose at gen/moar/m-Metamodel.nqp:2807␤  in…»
14:34 masak is that... intentional?
14:35 Ven_ joined #perl6
14:36 Alina-malina joined #perl6
14:38 khw joined #perl6
14:40 nine m: say Iterable
14:40 camelia rakudo-moar 32d7b0: OUTPUT«Method 'iterator' must be implemented by Iterable because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp:2661␤  in any apply at gen/moar/m-Metamodel.nqp:2671␤  in any compose at gen/moar/m-Metamodel.nqp:2807␤  in…»
14:40 nine masak: I guess it's the same for all abstract roles
14:40 nine m: say role Foo { method foo { ... } }
14:40 camelia rakudo-moar 32d7b0: OUTPUT«Method 'foo' must be implemented by Foo because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp:2661␤  in any apply at gen/moar/m-Metamodel.nqp:2671␤  in any compose at gen/moar/m-Metamodel.nqp:2807␤  in any make_…»
14:41 masak nine: something feels wrong about that, though.
14:41 masak nine: I wasn't asking for an implementation of the role, just for its name.
14:41 masak nine: what's the idiomatic way to ask for the roles implemented by Array? :)
14:42 psch_ it feels consistent but useless, yes
14:42 nine masak: you sure? roles returns the type objects for the roles, not only their names
14:43 psch the type object puns, which is the consistent part
14:43 masak ok, then I would like to be able to hold a type object without it exploding.
14:43 nine So yes, consistent, but certainly useless :)
14:43 nine m: my $iterable = Iterable; say $iterable.^name;
14:43 camelia rakudo-moar 32d7b0: OUTPUT«Iterable␤»
14:43 nine masak: you can ;)
14:44 psch m: say Array.^roles>>.^name
14:44 camelia rakudo-moar 32d7b0: OUTPUT«List␤»
14:44 masak meh.
14:44 nine So it's just gist that could be improved
14:44 masak yeah
14:44 masak m: Iterable.gist
14:44 camelia rakudo-moar 32d7b0: OUTPUT«Method 'iterator' must be implemented by Iterable because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp:2661␤  in any apply at gen/moar/m-Metamodel.nqp:2671␤  in any compose at gen/moar/m-Metamodel.nqp:2807␤  in…»
14:45 psch ehh, can't .^ down the list...
14:45 nine Though I would not know how, since gist can only work on the punned type object
14:45 masak I think #perl6 has had this discussion before :)
14:45 masak and I don't have a good answer either, I just thinks it's not optimal the way it is
14:46 awwaiid In Rakudo, EVAL can take 'context', but I don't see that in the design docs. I'm exploring what all 'context' gives me (like... I can see lexical vars but callframe() isn't affected by the passed context). Is EVAL "$fo", context => ... even a thing I should be doing?
14:46 masak 'night, #perl6
14:46 Zoffix \o
14:46 colomon masak: where are you?
14:46 nine Good night masak
14:46 nine colomon: on .cn time
14:47 colomon yow.
14:48 awwaiid https://gist.github.com/awwaiid/f537ccf5d25cf4ad7cf7 -- EVAL w/ context not affecting callframe() example
14:51 CurtisOvidPoe This concurrent Perl 6 code appears to be blocking. Can someone help me understand what I did wrong? https://gist.github.com/Ovid/06ac6e9e0187e84a9589
14:53 timotimo CurtisOvidPoe: you're waiting for both the timeout *and* the get requests to complete
14:53 timotimo "allof" seems to be the wrong combiner in the last line
14:54 CurtisOvidPoe Rerunning now with ‘anyof’
14:54 timotimo you probably have to anyof(timeout, allof(results))
14:54 Ven_ joined #perl6
14:54 larion joined #perl6
14:55 RabidGravy yeah
14:56 RabidGravy though possibly allof() the requests then anyof that and the timeout
14:56 CurtisOvidPoe That seems like I can’t discard individual URLs which exceed the timeout. I’m guessing I need to construct individividual promise objects and have a Promise.in($timeout) for each?
14:57 timotimo RabidGravy: isn't that exactly what i suggested?
14:57 CurtisOvidPoe Also, changing that last line to “await @promises” blocks and prints nothing.
14:57 RabidGravy timotimo, oh so it was, distracted
14:58 timotimo CurtisOvidPoe: my initial idea would be to litter the code with "say" statements to see where it ends up not doing anything
14:58 timotimo like, is the LWP::Simple.get call taking forever for some reason?
14:59 CurtisOvidPoe Well, it works in serial. Those calls take about a minute and a half if run one after another.
14:59 timotimo or is it just that the poor HTML parser is woefully insufficient to handle a gigantic site like yahoo.com?
15:00 timotimo definitely weird.
15:00 CurtisOvidPoe It appears that not a single one is returning after the .get
15:00 timotimo thenperhaps LWP::Simple has a problem with parallelism
15:00 timotimo can you try HTTP::UserAgent instead?
15:01 timotimo i think it also has a submodule that you can use that'll give you the exact same API as LWP::Simple
15:02 CurtisOvidPoe Reducing this down to fetching a single URL (and thus creating only one promise), also fails.
15:03 kjs_ joined #perl6
15:03 timotimo that'? kind of bad
15:03 larion joined #perl6
15:04 larion joined #perl6
15:04 nine timotimo: have you had a look at p6for already? Is it useful to you?
15:05 CurtisOvidPoe Just running this hangs on my box: perl6 -e 'use LWP::Simple;await start { LWP::Simple.get("http://www.rakudo.org/") }'
15:05 timotimo i've had a brief look and it looks helpful indeed :)
15:05 nine timotimo: yeah!
15:05 timotimo it also brought up the ol' problem of "what to optimize in what order"
15:09 b2gills joined #perl6
15:10 Ven joined #perl6
15:13 CurtisOvidPoe This also hangs, but it works great in the debugger :( perl6 -MHTTP::UserAgent -e 'my $ua = HTTP::UserAgent.new; await start { say $ua.get("http://www.rakudo.org/").content }'
15:14 timotimo well, god damn it.
15:14 CurtisOvidPoe I know.
15:14 timotimo hm
15:14 timotimo we could try setting a scheduler up that ignores multi-threading
15:14 timotimo as in:
15:14 timotimo m: my $*SCHEDULER = CurrentThreadScheduler.new(); await start { say "hi" };
15:14 camelia rakudo-moar 23ccdc: OUTPUT«hi␤»
15:16 CurtisOvidPoe Nope. Now it’s hanging in the debugger.
15:16 timotimo o_O
15:16 timotimo why would it do that >:(
15:16 * CurtisOvidPoe is confused
15:16 timotimo what about without debugger?
15:16 * RabidGravy too, most of the time
15:16 BenGoldberg joined #perl6
15:18 bjz joined #perl6
15:18 CurtisOvidPoe I meant the REPL, sorry.
15:18 timotimo oh
15:18 CurtisOvidPoe And now it *works* in the REPL. WTF???
15:19 timotimo wellllll....
15:19 timotimo it could very well be because it tries to print the value of the last statement?
15:20 timotimo if not, the REPL has had weirdness issues in the past, for example before the commit that made the := operator work
15:21 s_kilk joined #perl6
15:22 CurtisOvidPoe Hmm, this might be reproducible. Hold on.
15:24 CurtisOvidPoe Got it, but it’s a weird bug … https://gist.github.com/Ovid/4cb42aefd126fde16000
15:24 CurtisOvidPoe You have to call $ua.get() at least once before the await start {} and it works
15:24 timotimo :o
15:25 CurtisOvidPoe Can someone else reproduce the error on their box?
15:25 diana_olhovik_ joined #perl6
15:25 * timotimo can't try right now ;(
15:25 llfourn CurtisOvidPoe: I actually tried to install HTTP::UserAgent just now but it hangs in one of the tests :(
15:25 CurtisOvidPoe So how do I properly submit a rakudobug?
15:26 timotimo just a mail to rakudobug@perl.org
15:26 CurtisOvidPoe Thanks for trying, llfourn
15:26 llfourn You also put [BUG] in the title to rakudobug@perl.org I think
15:27 RabidGravy CurtisOvidPoe, is that the same for both LWP::Simple *and* HTTP::UserAgent
15:27 CurtisOvidPoe Yes.
15:27 CurtisOvidPoe Wondering if it’s socket related?
15:28 RabidGravy yeah possibly some evil interation between the event loop and libuv's socket thingies
15:29 ugexe but the socket isn't created until the `get` is called
15:30 bjz_ joined #perl6
15:30 Peter_R joined #perl6
15:30 CurtisOvidPoe rakudobug filed.
15:30 RabidGravy yeah, but if there is some thread context thing in the socket implementation
15:31 CurtisOvidPoe Crap. I should have mentioned it’s on OS X. Forgot to include my version number, too.
15:31 RabidGravy It does it on Linux too FWIW
15:33 Hor|zon joined #perl6
15:33 CurtisOvidPoe Cheers, RabidGravy.
15:33 CurtisOvidPoe https://rt.perl.org/Ticket/Display.html?id=126390&amp;results=39d5438ca17b18677013afd8068e1539
15:33 ugexe never leaves the Planned state
15:36 Zoffix CurtisOvidPoe, if you're just looking for some UA, HTTP::Tinyish seems to work: https://github.com/shoichikaji/perl6-HTTP-Tinyish/
15:36 Zoffix 2.6s (though that's mostly startup and not get): http://fpaste.scsys.co.uk/500400
15:36 RabidGravy I guess they are all similarly afflicted
15:37 RabidGravy ooh
15:38 Zoffix Oh. I think this one just shells out to `curl'
15:38 ugexe yep
15:38 CurtisOvidPoe On the plus side, every time I update a Perl 6 talk, I get fewer errors in Perl 6 :)
15:39 timotimo i'm getting kind of nervous about our lack for advanced sockety stuff and being so close to christmas
15:39 timotimo udp sockets, for example
15:40 RabidGravy and/or local sockets
15:40 CurtisOvidPoe Just drop it from the spec ;)
15:40 timotimo just let people build that with NativeCall? :)
15:40 RabidGravy I've toyed with that idea
15:40 * CurtisOvidPoe waits for all the NativeCall concurrency bugs ...
15:40 timotimo someone already did that thing, RabidGravy
15:41 timotimo http://blog.64p.org/entry/2015/09/15/192721
15:41 btyler sockets (and async sockets) can use any spare love that's available, for sure
15:41 RabidGravy the libshout native binding works fine in a concurrent kind of thing
15:44 Ven joined #perl6
15:45 timotimo i don't think nativecall has big problems with concurrency
15:46 timotimo sadly, libuv isn't very friendly towards how we do multiple threads
15:46 RabidGravy yeah it'll mostly be libraries themselves that cause the problem
15:46 timotimo but ideally, our synchronous I/O would bypass libuv completely
15:47 vendethiel joined #perl6
15:49 timotimo that'd also remove the "you can't read data on a socket when your code runs on a different thread from the one that created it"
15:49 timotimo which is just ugh
15:50 RabidGravy is IO::Socket::Async thus aflicted?
15:50 timotimo i don't think so, as it does all its IO things on the extra thread anyway
15:51 timotimo as in, moar builds a thread dedicated to doing all its async dispatching when the first async i/o thing appears
15:58 BenGoldberg m: my $sock = Raw::Socket::INET.new( :host<localhost>, :port<9000> ); my $b = Buf.new(8); say await start { say $sock.recv($b, 8, 0); 42 };
15:58 camelia rakudo-moar 23ccdc: OUTPUT«Could not find symbol '&INET'␤  in block <unit> at /tmp/lNxgIKSirP:1␤␤Actually thrown at:␤  in block <unit> at /tmp/lNxgIKSirP:1␤␤»
15:58 rindolf joined #perl6
15:58 BenGoldberg Odd error message, that.
15:59 ^elyse^ joined #perl6
15:59 psch m: say A::B::C
15:59 camelia rakudo-moar 23ccdc: OUTPUT«Could not find symbol '&C'␤  in block <unit> at /tmp/SaBVCqy9xE:1␤␤Actually thrown at:␤  in block <unit> at /tmp/SaBVCqy9xE:1␤␤»
16:00 psch not sure if that should complain about every not-found level
16:00 psch or if it could, even
16:02 Akagi201 joined #perl6
16:03 tokuhirom_ joined #perl6
16:08 tokuhiro_ joined #perl6
16:13 Ven joined #perl6
16:18 rurban joined #perl6
16:26 Ven joined #perl6
16:30 moritz the error message would be better if it complained about the full name, IMHO
16:31 cxreg2 I've been thinking about http://blogs.perl.org/users/pawel_bbkr_pabian/2015/09/asynchronous-parallel-and-dead-my-perl-6-daily-bread.html.  Maybe you've already moved on from this issue, but might it not be possible to simply stop parallelizing and do work in serial when the threadpool is (nearly) exhausted?
16:32 cxreg2 seems like maybe not something every programmer should need to be aware of; at least then you just get slow instead of crashing
16:34 Hor|zon joined #perl6
16:36 ptarmigan999 joined #perl6
16:37 gtodd joined #perl6
16:37 cxreg I'm referring to the scheduling work performed by start/await, not something the program would do explicitly
16:37 Ven joined #perl6
16:38 ^elyse^ joined #perl6
16:39 ptarmigan999 Hi - I was just trying out the XML example from RosettaCode and it failed, I think because XML has added text nodes to @nodes. I was trying to restrict the nodes returned to just the XML::Element nodes.
16:40 ptarmigan999 The existing code used: say .<Name> for $xml.nodes.grep(*.name eq 'Student')
16:40 ptarmigan999 I've tried varlations like say .<Name> for $xml.nodes.grep((*.WHAT.perl eq 'XML::Element') and (*.name eq 'Student')) and
16:41 ptarmigan999 $xml.nodes.grep(*.WHAT.perl eq 'XML::Element').grep(.name eq 'Student') - with and without the '*' - what's the correct syntax to use?
16:42 colomon ptarmigan999: If you have two *s in whatever code, you’re declaring a block that takes two arguments.
16:43 colomon you could do it with two grep statements:  .grep(*.WHAT.perl eq 'XML::Element’).grep(*.name eq 'Student’))
16:43 colomon or you could rewrite it with brackets: .grep({ $_.WHAT.perl eq ‘XML::Element’ && $_.name eq ‘Student’)
16:44 colomon whoops, forgot closing bracket
16:44 colomon or you could rewrite it with brackets: .grep({ $_.WHAT.perl eq ‘XML::Element’ && $_.name eq ‘Student’})
16:45 ptarmigan999 Ah ok - I tried it with '*' instead and was getting 'Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?' :D
16:45 geekosaur would something like $^a work there also?
16:45 colomon hmmm, seems like a less than awesome error message.
16:46 colomon yes $^a would work, but it would also need {  }
16:46 colomon so there’s no real advantage to using $^a instead of $_ if you only want one arg
16:47 psch m: say ^10 .grep: (* %% 2 && * > 4)
16:47 camelia rakudo-moar 23ccdc: OUTPUT«(5 6 7 8 9)␤»
16:47 colomon (unless you also need $_ for something else in the block!)
16:47 psch m: say ^10 .grep: { $^a %% 2 && $a > 4}
16:47 camelia rakudo-moar 23ccdc: OUTPUT«(6 8)␤»
16:48 psch curious how it uses the second Whatever
16:48 colomon psch: think of the simpler  * + *
16:48 psch m: say (* + *)(2, -5)
16:48 camelia rakudo-moar 23ccdc: OUTPUT«-3␤»
16:48 psch vOv
16:48 psch stupid transitive property :)
16:48 colomon that said, I have no idea how (* %% 2 && * > 4) is working up there.
16:49 psch wait, that's not transitive, is it..?
16:49 psch no, it's cumutative..
16:49 colomon m: (^10).grep(*.say && *.say)
16:49 camelia rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/mYAs7o_UzQ␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/mYAs7o_UzQ:1␤------> 3(^10).grep(*.say && *.say7⏏5)␤    expecting any of:␤        infix␤        infix …»
16:49 timotimo m: say ^10.grep: (*.say && *.say)
16:49 camelia rakudo-moar 23ccdc: OUTPUT«Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at /tmp/e_AGy8uUAX:1␤    ------> 3say ^107⏏5.grep: (*.say && *.say)␤10␤0..^1␤»
16:49 timotimo m: say ^10 .grep: (*.say && *.say)
16:49 camelia rakudo-moar 23ccdc: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤(0 1 2 3 4 5 6 7 8 9)␤»
16:50 psch m: say (* / *)(0, 5)
16:50 timotimo m: ^10 .grep: (*.say && *.say)
16:50 camelia rakudo-moar 23ccdc: OUTPUT«0␤»
16:50 camelia rakudo-moar 23ccdc: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
16:50 colomon wait a minute...
16:51 colomon m: say (^10).grep(* + * > 5)
16:51 camelia rakudo-moar 23ccdc: OUTPUT«((4 5) (6 7) (8 9))␤»
16:51 colomon m: say (^10).grep(* + * > 9)
16:51 camelia rakudo-moar 23ccdc: OUTPUT«((6 7) (8 9))␤»
16:51 ptarmigan999 I tried: say .<Name> for $xml.nodes.grep(*.WHAT.perl eq 'XML::Element’).grep(*.name eq 'Student’) and got:Missing infix inside S at /disk/home/david/development/perl6/./xml_example.p6:17 ------> erl eq 'XML::Element’).grep(*.name eq 'S⏏tudent’)     expecting any of:         infix         infix stopper
16:51 psch ptarmigan999: that looks like a bad quote character
16:52 psch *.WHAT.perl eq 'XML::Element’
16:52 ptarmigan999 sorry - cut'n paste error
16:52 timotimo m: say 'Student’
16:52 camelia rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/p2U4MGUrsD␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/p2U4MGUrsD:1␤------> 3say 'Student’7⏏5<EOL>␤    expecting any of:␤        argument list␤        singl…»
16:52 timotimo m: say 'Student'
16:52 camelia rakudo-moar 23ccdc: OUTPUT«Student␤»
16:52 timotimo m: say ‘Student’
16:52 camelia rakudo-moar 23ccdc: OUTPUT«Student␤»
16:52 timotimo m: say ‚Student‘
16:52 camelia rakudo-moar 23ccdc: OUTPUT«Student␤»
16:52 timotimo the smartest of quotes on these students
16:53 pmurias_ joined #perl6
16:53 colomon ptarmigan999: cutting and pasting my code on here is dangerous, my IRC client loves to substitute the characters it thinks I wanted instead of what I actually typed.
16:53 timotimo that string started at 'XML::Element and went all the way to .name eq '
16:53 psch m: say uniname("‚")
16:53 camelia rakudo-moar 23ccdc: OUTPUT«SINGLE LOW-9 QUOTATION MARK␤»
16:53 psch m: say uniname(",")
16:53 camelia rakudo-moar 23ccdc: OUTPUT«COMMA␤»
16:53 psch they look the same here vOv
16:53 * psch might need a better font...
16:53 timotimo :D
16:53 ptarmigan999 corrected quotes and back to 'Bool as Matcher' error
16:55 timotimo oh!
16:55 timotimo *.WHAT doesn't work
16:55 timotimo you really want to just use "XML::Element" as the matcher
16:55 timotimo m: say *.WHAT
16:55 camelia rakudo-moar 23ccdc: OUTPUT«(Whatever)␤»
16:55 timotimo m: say (*.WHAT eq 'String')
16:55 camelia rakudo-moar 23ccdc: OUTPUT«Use of uninitialized value of type Whatever in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/C5Qw4JHLbO:1␤False␤»
16:55 colomon oh, sorry, I should have caught that
16:55 ptarmigan999 let me retype from scratch and double check
16:55 timotimo type checking is best done with ~~
16:55 psch m: say (5, "5", 10, "10").grep(Int).grep(* > 5)
16:55 camelia rakudo-moar 23ccdc: OUTPUT«(10)␤»
16:55 timotimo and grep does ~~ "under the hood" for you
16:55 colomon Think you want * ~~ XML::Element
16:56 timotimo colomon: that's the exact same as just XML::Element in this case
16:56 timotimo m: say (* ~~ Bool)
16:56 camelia rakudo-moar 23ccdc: OUTPUT«WhateverCode.new␤»
16:56 colomon timotimo: good point.  :)
16:56 timotimo m: say (True, False, "FileNotFound").grep(* ~~ Bool).
16:56 camelia rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_RhMv21qge␤Missing required term after infix␤at /tmp/_RhMv21qge:1␤------> 3 False, "FileNotFound").grep(* ~~ Bool).7⏏5<EOL>␤    expecting any of:␤        dotty method or postfix␤»
16:56 timotimo m: say (True, False, "FileNotFound").grep(* ~~ Bool)
16:56 camelia rakudo-moar 23ccdc: OUTPUT«(True False)␤»
16:56 timotimo m: say (True, False, "FileNotFound").grep(Bool)
16:56 camelia rakudo-moar 23ccdc: OUTPUT«(True False)␤»
16:57 psch hrm
16:58 psch so i added debug output to Ops.setobjsc to print the typeName for non-concrete objects during setting compilation
16:58 psch and apparently that gets called three times for Attribute
16:59 psch and 11 times for Attribute:D
16:59 psch but hey, it also gets called lots for e.g. Int
16:59 psch but it shouldn't get called for non-concrete objects at all, from what i remember jnthn++ saying on this
17:00 psch which i had some kind of actual, high-level understanding what SCs do and how they work, instead of just poking at things... :P
17:01 psch well, and low-level too of course
17:01 timotimo hm, could that be about "compile time evaluate" and WVals perhaps?
17:03 psch timotimo: maybe..? setobjsc gets called from HLL::World.add_object, which does get called in quite a few compile-time value-ish things in Perl6::World...
17:04 psch hm, maybe the isconcrete check doesn't actually do enough in setobjsc..?
17:04 psch i mean, Perl6::World.scalar_wrap adds the object to the SC and then binds a value
17:05 psch does that already make the Scalar concrete?
17:05 ptarmigan999 colomon/timotimo: thanks. ~~ XML::Element works :)
17:06 softmoth joined #perl6
17:07 leont I'm dealing with an exception from a promise that isn't pointing to a useful line
17:07 timotimo perhaps you want to decont before you isconcrete?
17:07 leont How do I get the information that I actually want?
17:07 leont As in, actual line number and more information
17:08 timotimo leont: sometimes running perl6 with --ll-exception gives you a bit more
17:08 leont Tried that already, it wan't helpful. It gave the $promise.result location instead of the actual source
17:10 timotimo oh, that means we're losing the original exception there?
17:10 timotimo that place would ideally have only a rethrow-like thing in there
17:11 leont I think so, I've seen this happen before
17:12 Akagi201 joined #perl6
17:12 leont Right now all I have to go on is "Too many positionals passed; expected 2 arguments but got 3", which is definitely not from that line
17:12 timotimo aye
17:13 timotimo as a work-around, you can put a CATCH { .say } into the start block
17:13 timotimo but i realize that sucks
17:19 leont Yeah that does help
17:21 timotimo oops. rebuilding nqp now even though the only changes were in js-related parts
17:24 psch timotimo: adding a decont gives me the same numbers
17:25 timotimo hum.
17:35 Hor|zon joined #perl6
17:38 Ven joined #perl6
17:40 tokuhirom_ joined #perl6
17:44 zakharyas joined #perl6
17:50 pmurias_ psch: what do you want to know about SCs?
17:51 pmurias psch: I reimplemented a lot of the serialization stuff for the js backend so I might be able to help
17:51 psch pmurias: that's a hard question...
17:51 psch pmurias: the background is that we have a problem on jvm, with repossession apparently
17:52 psch pmurias: for some reason, contrary to what moar does, the type object for Attribute on jvm gets repossessed to CORE.setting, from BOOTSTRAP.nqp
17:53 psch pmurias: so while trying to figure out why and how that happens i'm trying to learn about what an SC actually does and how it does that
17:54 psch pmurias: what i get from the jvm impl, any SC is mostly just a data holder for "where can i find this object"
17:54 Ven joined #perl6
17:55 pmurias once serialized the SC holds the state of a bunch of objects at the point of serialization
17:55 pmurias repossession allows changing the object and then storing it somewhere else
17:56 pmurias (I haven't yet reimplemented repossesion so I'm that familiar with the tiny details of that)
18:01 pmurias psch: repossesion happens when the object is change (the objects are transfered to the currently compiled sc)
18:01 pmurias psch: this can be disabled (which is done when doing stuff like setting temporary caches at stuff)
18:02 colomon CurtisOvidPoe: I just built panda without issue on OS X.
18:03 CurtisOvidPoe colomon: I’ve found that if fails if it’s
18:03 CurtisOvidPoe PERL5LIB=lib rakudobrew build-panda
18:03 pmurias psch: you could try hooking into repossesObject and printing when a type object for Attribute gets repossesed (and from which sc to which)
18:04 pmurias psch: in SerializationContext.java
18:04 colomon CurtisOvidPoe: ah.  I don’t think I have PERL5LIB set to anything
18:04 psch pmurias: but to check if i have an Attribute or not i need the TC, don't i?
18:04 CurtisOvidPoe Yeah, it’s a handy shortcut I use, but it bit me here.
18:05 psch (well, at least Ops.typeName needs the TC, and i don't know how to identify a specific type otherwise...)
18:05 mrsolo joined #perl6
18:06 kaare_ joined #perl6
18:07 Ven joined #perl6
18:08 pmurias psch: hook into scwbObject
18:08 pmurias it's the only place that calls repossesObject and there is a thread context there
18:08 psch pmurias: yeah, i did that a few days ago.  it doesn't show any calls for Attribute where isconcrete isn't 1
18:08 DrForr seen BooK
18:09 psch pmurias: which means there's no actual repossession of the Attribute type object happening, afaiu
18:10 pmurias the setobjsc op is called on the Attribute type object?
18:10 psch pmurias: yeah, that happens, but not only for Attribute but also for e.g. Int
18:10 tokuhiro_ joined #perl6
18:11 psch well, it happens for pretty much everything, from the looks of it...
18:12 psch i'll add printing the description there, that probably adds some information... :)
18:13 pmurias psch: it seems to be that if this is done on an object that is already part of an sc bad things will happen
18:14 Akagi201 joined #perl6
18:15 rbk_ joined #perl6
18:15 pmurias psch: and there is an add_object_if_no_sc in places where we aren't sure
18:15 pmurias (in Perl6::World)
18:22 diana_olhovik joined #perl6
18:25 psch pmurias: fwiw, the first time setobjsc gets called on Attribute it sets the SC to BOOTSTRAP, but there's two more calls that set it to CORE
18:25 gtodd joined #perl6
18:25 psch but as mentioned, similar things happen for pretty much every other type object
18:31 colomon Could not download module metadata: No such method 'host' for invocant of type 'HTTP::Request'
18:31 colomon in method update at /home/colomon/.rakudobrew/moar-nom/install/share/perl6/site/lib/Panda/Ecosystem.pm:110
18:31 colomon :
18:31 colomon :/
18:32 pmurias psch: how does the problem manifest (with the typeobject being "repossessed" manifest) itself when running Perl 6 code?
18:36 Hor|zon joined #perl6
18:38 pmurias .tell konobi I'll replace the build system for nqp-js with a saner one tommorrow
18:38 yoleaux pmurias: I'll pass your message to konobi.
18:38 gtodd joined #perl6
18:39 psch pmurias: https://github.com/perl6/nqp/blob/master/src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/P6OpaqueBaseInstance.java#L17 we have to compare STables here, instead of classHandle identity
18:39 psch pmurias: that line should just read "if (rd.classHandles[i] == classHandle) {", and that's what moar does
18:40 psch pmurias: but on jvm we get CORE on the LHS and BOOTSTRAP on the RHS when trying to instantiate an Attribute
18:40 psch for the SC that is
18:41 psch the SC mismatch goes away when "BEGIN Attribute.^compose" gets removed from Any-interable-methods.pm, but that's not a fix because we don't get the augment for Attribute (or something like that, i didn't quite follow jnthns explanation on that...)
18:43 pmurias psch: how can I reproduce the error?
18:44 psch pmurias: just remove ".st" in the linked line in nqp, build nqp, then build rakudo
18:44 psch pmurias: doing so will die with 'No such attribute "$!name" ...' during NativeCall.pm
18:47 gtodd joined #perl6
18:53 xfix joined #perl6
18:55 cognominal joined #perl6
18:56 dalek rakudo/nom: ebd36d9 | lizmat++ | src/core/Supply.pm:
18:56 dalek rakudo/nom: Emit status at end if status supply given
18:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ebd36d982d
18:58 Ven joined #perl6
19:04 llfourn joined #perl6
19:05 ugexe can you apply Actions to an existing Match?
19:13 virtualsue joined #perl6
19:15 Akagi201 joined #perl6
19:17 Ven joined #perl6
19:19 yuval_dsfdsgdf joined #perl6
19:26 Ven joined #perl6
19:35 moritz ugexe: you can call action methods manually
19:35 moritz $obj.method($/)
19:35 moritz and that method can call $/.made or $/.ast
19:36 moritz but there is no mechanism for retroactively calling all action methods
19:37 Hor|zon joined #perl6
19:37 lizmat m: await start -> $i { say "foo" }   # probably another error going into oblivion :-(
19:37 camelia rakudo-moar ebd36d: ( no output )
19:37 moritz though something like for $/.hash.keys -> $method { $actions."$method"($/) if $actions.^can($method) };  might do the trick
19:37 lizmat m: await start { say "foo" }
19:37 camelia rakudo-moar ebd36d: OUTPUT«foo␤»
19:42 virtualsue joined #perl6
19:42 dalek doc: 963bb01 | moritz++ | doc/Type/DateTime.pod:
19:42 dalek doc: Fix typo. Closes #168
19:42 dalek doc: review: https://github.com/perl6/doc/commit/963bb01294
19:45 dalek rakudo/nom: 77e76ae | lizmat++ | src/core/Promise.pm:
19:45 dalek rakudo/nom: Pass any extra parameters with Promise.start
19:45 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/77e76ae845
19:45 Ven joined #perl6
19:54 vendethiel joined #perl6
19:55 dalek perl6-examples: 1b1e29e | moritz++ | categories/games/wizard.pl:
19:55 dalek perl6-examples: Remove wizard.pl
19:55 dalek perl6-examples:
19:55 dalek perl6-examples: it does not work. And probably never did.
19:55 dalek perl6-examples: Closes #33, though probably not as intended
19:55 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/1b1e29ea15
20:02 dalek doc: 5e82274 | (Steve Mynott)++ | doc/Language/faq.pod:
20:02 dalek doc: fix some typos
20:02 dalek doc: review: https://github.com/perl6/doc/commit/5e822744d6
20:04 llfourn joined #perl6
20:06 adhoc joined #perl6
20:08 yuval_dsfdsgdf left #perl6
20:11 moritz wow, I still had .pir files in my checkout of DBIish
20:12 tadzik :)
20:12 tokuhiro_ joined #perl6
20:12 tadzik I like it when I have an old, ufo-generated Makefile and when I run it it says something like "pir target is not supported"
20:18 Akagi201 joined #perl6
20:20 moritz ok, API design question
20:21 moritz I've been thinking a bit about DBIish
20:21 moritz and the archaic way we still do a   while my @row = $sth.fetchrow { ... }
20:21 moritz so I thought instead it should look like
20:22 moritz for $sth.rows -> @row { }
20:22 moritz and possibly
20:22 moritz for $sth.rows(:hash) -> %row { }
20:22 lizmat moritz: did you consider a $sth.supply ?
20:23 moritz lizmat: no; I'm try to come up with a sane synchronous API first :-)
20:23 moritz *trying
20:23 lizmat afaik, db engines such as MySQL are capable of streaming result sets per record, which would match suppies :-)
20:23 lizmat ok
20:24 moritz so, if one only executes a query once, an even nicer API would be  for $dbh.select($sql, |@placeholders) -> $row { }
20:25 moritz the only thing that's stopping me right now is that statement handles already have a method "rows", which returns the number of affected rows (like, after an UPDATE)
20:25 nine Maybe "all" instead of "rows"?
20:26 lizmat perhaps https://metacpan.org/pod/DBIx::Simple can be of inspiration ?
20:26 Juerd Whoaaa
20:26 moritz nine: worth considering
20:26 Juerd I still have a highlight on that :)
20:26 nine In any case the only thing from crying out "great idea, just do it!" is that as lizmat++'s comment shows, there may be bigger steps to make
20:27 awwaiid http://thelackthereof.org/TLT/2015.10.18/My_First_Useful_Perl6_Grammar -- perl6 blog post
20:30 * flussence realises postgresql's NOTIFY statement is a perfect fit for p6 supplies... but that's jumping the gun a bit :)
20:33 moritz flussence: I just did a quick overview of the postgresql, mysql and sqlite3 C client APIs, and it seems that postgres' is the only one that does async
20:34 moritz flussence: ... though the docs on LISTEN and NOTIFY seem to be rather sparse :(
20:35 moritz it seems we'd have to pull for results in a thread
20:35 moritz threads and C libraries... I forsee a lot of fun
20:36 * moritz stays with the synchronous API
20:38 Hor|zon joined #perl6
20:40 firstdayonthejob joined #perl6
20:42 pink_mist moritz: I know that in the p5 world, Mojo::Pg uses postgresql asyncly ... I thought Mojo::mysql did too even ... and perl5 doesn't need threads to do it
20:43 btyler event loop based, yeah
20:43 flussence .oO( the gist I get from postgres' docs is that it's a threadsafe-if-you-really-really-need-it library, but it's saner to just open multiple DB connections for concurrency. I think that logic makes sense for most other databases too. )
20:47 * leont thinks lazy lists would make more sense to most people than supplies most of the time
20:47 boggard joined #perl6
20:47 leont (re databases)
20:51 kaare_ joined #perl6
20:52 flussence I might get crucified for saying this but... PHP PDO was a pretty nice API. It worked pretty similar to moritz' suggestions above (though waaaaay more verbose)
20:55 flussence (though I don't miss the horrible fetch-directly-into-object "feature")
21:05 bjz joined #perl6
21:07 AlexDaniel joined #perl6
21:09 pippo joined #perl6
21:11 pippo o/ #perl6
21:11 pippo m: my @a = ^3; say @a[0..1,2].perl; @a[0,1,2].perl;
21:11 camelia rakudo-moar 77e76a: OUTPUT«((0, 1), 2)␤»
21:11 pippo m: my @a = ^3; say @a[0..1,2].perl; say @a[0,1,2].perl;
21:11 camelia rakudo-moar 77e76a: OUTPUT«((0, 1), 2)␤(0, 1, 2)␤»
21:12 pippo ^^Is it correct to have them different?
21:13 bjz joined #perl6
21:14 pink_mist m: my @a = ^3; say @a[(0..1,2).flat].perl;
21:14 camelia rakudo-moar 77e76a: OUTPUT«(0, 1, 2)␤»
21:14 pink_mist if you want the flattened list, you need to be explicit
21:15 pippo pink_mist: is it something intended to be like that?
21:15 pink_mist afaik yes
21:16 pippo pink_mist: OK. thank you.
21:16 bjz joined #perl6
21:17 pippo m: my @a = ^3; say @a[|0..1,2].perl; say @a[0,1,2].perl;
21:17 camelia rakudo-moar 77e76a: OUTPUT«((1,), 2)␤(0, 1, 2)␤»
21:17 pippo m: my @a = ^3; say @a[|(0..1),2].perl; say @a[0,1,2].perl;
21:17 camelia rakudo-moar 77e76a: OUTPUT«(0, 1, 2)␤(0, 1, 2)␤»
21:17 pippo m: my @a = ^3; say @a[|^2,2].perl; say @a[0,1,2].perl;
21:17 camelia rakudo-moar 77e76a: OUTPUT«(0, 1, 2)␤(0, 1, 2)␤»
21:18 pippo :-|
21:18 pippo o/
21:18 pippo left #perl6
21:21 Akagi201 joined #perl6
21:34 gonz_ joined #perl6
21:36 bjz joined #perl6
21:37 dalek rakudo/nom: fc1ef69 | lizmat++ | src/core/Supply.pm:
21:37 dalek rakudo/nom: Implement Supply.throttle for Callables
21:37 dalek rakudo/nom:
21:37 dalek rakudo/nom: If the second positional parameter to Supply.throttle is a Callable,
21:37 dalek rakudo/nom: it is assumed to be a block to be executed asynchronously restrained
21:37 dalek rakudo/nom: to the limit given.  This basically reduces the asynchronous image
21:37 dalek rakudo/nom: resizer example in http://jnthn.net/papers/2014-yapceu-async.pdf to:
21:37 dalek rakudo/nom:
21:37 dalek rakudo/nom:   @worklist.Supply.throttle(PARALLEL_RESIZE,&resizer-one).wait
21:37 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fc1ef69660
21:39 Hor|zon joined #perl6
21:40 lizmat am I the only one who thinks coercing a Supply to a Promise, would yield a Promise that is kept when the Supply is done?
21:40 lizmat instead of a Promise that is kept for the next emitted values ?
21:40 lizmat *value
21:41 tokuhirom_ joined #perl6
21:50 leont Wait, what?
21:50 leont That doesn't sounds logical at all
21:50 lizmat .oO( I was already waiting for 10 mins)
21:51 lizmat what doesn't?  the current behaviour, or the proposed behaviour ?
21:55 _28_ria joined #perl6
21:56 geekosaur I can see uses for what you describe as the current case, but it sounds rather niche. Is there an existing way to get your proposed behavior?
21:56 lizmat Supply.wait
21:57 lizmat the thing is: that waits and *then* returns the result of an internal Promise
21:57 lizmat I was just thinking it would be nice to use "await" for Supplies as well
21:57 lizmat await $promise, $supply.Promise, etc...
21:58 lizmat and/or even have await() auto-coerce to Promise
22:05 llfourn joined #perl6
22:07 RabidGravy m: my $a = True; given "boo" { when "bar" { say "bar"; }; if !$a { when "boo" { say "boo" } } }; # am I relying on something I shouldn't here?
22:07 camelia rakudo-moar fc1ef6: ( no output )
22:09 RabidGravy or will the if under no circumstance change the topic for the inner whens?
22:14 tokuhiro_ joined #perl6
22:17 vike joined #perl6
22:24 Akagi201 joined #perl6
22:24 hartenfels RabidGravy if will only change your topic if you tell it to do so explicitly
22:24 hartenfels See my $a = True; given "boo" { when "bar" { say "bar"; }; if !$a { when "boo" { say  "boo" } } };
22:24 hartenfels Oops
22:25 hartenfels http://doc.perl6.org/language/control#if
22:26 Grrrr joined #perl6
22:26 hartenfels Disregard the code, that was the wrong paste buffer.
22:37 atweiden joined #perl6
22:37 atweiden joined #perl6
22:40 Hor|zon joined #perl6
22:40 atweiden with NativeCall, can a ulonglong return a negative number?
22:40 atweiden be*
22:42 atweiden i ask because it's happening here https://github.com/atweiden/digest-xxhash/blob/master/lib/Digest/xxHash.pm
22:42 pink_mist iirc I heard something about unsigned nativecall stuff not being implemented yet
22:43 pink_mist but I don't quite recall when or in what context
22:45 TEttinger joined #perl6
22:46 pink_mist a search through the last few weeks of the irc log would probably find it
23:02 AndyDee joined #perl6
23:12 tokuhirom_ joined #perl6
23:14 tokuhiro_ joined #perl6
23:14 dalek rakudo/nom: 3ac9491 | lizmat++ | docs/ChangeLog:
23:14 dalek rakudo/nom: Some more ChangeLog additions
23:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3ac94916ba
23:14 dalek rakudo/nom: 2819ea2 | lizmat++ | src/core/Supply.pm:
23:14 dalek rakudo/nom: Implement Supply.await
23:14 dalek rakudo/nom:
23:14 dalek rakudo/nom: Like Supply.wait, but instead returns the Promise, instead of blocking
23:14 dalek rakudo/nom: for the Promise to be kept/broken and then return the result.
23:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2819ea272d
23:14 dalek rakudo/nom: fae01fb | lizmat++ | src/core/asyncops.pm:
23:14 dalek rakudo/nom: await $supply works, can mix with Promise/Channel
23:14 dalek rakudo/nom:
23:14 dalek rakudo/nom: Because it will now call $supply.await.  This may need some further
23:14 dalek rakudo/nom: discussions.  To *me*, this feels like the natural thing, since
23:14 dalek rakudo/nom: Supplies have their handling normally somewhere else anyway.  If
23:14 dalek rakudo/nom: this is consensed to be a bad idea, then maybe it should not call
23:14 dalek rakudo/nom: await, but the Promise method instead.
23:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fae01fbd1a
23:15 dalek Heuristic branch merge: pushed 55 commits to rakudo/curli by lizmat
23:16 lizmat and on that note,I wish #perl6 a good night!
23:27 Akagi201 joined #perl6
23:34 timotimo huh, "await" as the method name seems strange to me
23:35 timotimo i'd rather expect .Promise or so?
23:39 masak morning, #perl6
23:40 * masak grins
23:41 Hor|zon joined #perl6
23:47 BenGoldberg joined #perl6
23:59 uucpp joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo