»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by masak on 12 May 2015. |
|||
00:02
firstdayonthejob joined
|
|||
[Coke] | konobi: no clue, sorry | 00:05 | |
00:10
firstdayonthejob left
00:12
rurban joined
00:13
tokuhirom_ joined
00:17
tokuhirom_ left
00:18
Hor|zon joined
00:19
[Sno] left
00:20
[Sno] joined
00:23
Hor|zon left
00:28
testing joined
00:29
testing is now known as Guest77431,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:41
bjz left,
bjz joined
|
|||
psch | konobi: i'd look in Makefile-JS.in first | 00:43 | |
konobi: at least from how the other backends build, the gen-* usually just does stuff slightly beyond concatenation | |||
konobi: although -js might of course do things differently and pmurias is definitely the person to ask... :) | 00:44 | ||
(of course it also depends on which part of the build you want to affect...) | |||
konobi | psch: i think it's that gen script that generates the Makefile-JS.in | 00:45 | |
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 | |
konobi: github.com/perl6/nqp/blob/master/t...file-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
|
|||
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 | |
00:50
weihan joined
|
|||
psch | konobi: from the looks of it, gen-js-makefile.nqp writes the Makefile used to build nqp-js | 00:51 | |
00:52
Peter_R left
|
|||
psch | although i don't see a reference to Makefile-JS.in | 00:52 | |
00:53
weihan left
|
|||
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 | |
00:55
weihan joined
|
|||
psch | s/_fill/_file/ | 00:55 | |
psch .oO( we do have a quite interesting build system... ) | |||
00:55
llfourn left
00:56
weihan left
00:58
weihan joined
00:59
weihan left,
vendethiel left
01:02
weihan joined
|
|||
dalek | kudo/nom: 5cd7ef0 | TimToady++ | src/Perl6/ (2 files): make with/without topicalize properly |
01:05 | |
TimToady | finally... | ||
konobi | psch: >.< | 01:08 | |
01:10
tokuhiro_ joined
01:14
tokuhiro_ left
|
|||
dalek | ast: b26e8b3 | TimToady++ | S04-statements/with.t: unfudge with topicalization |
01:16 | |
01:18
cognominal left
01:19
bjz_ joined,
Hor|zon joined
|
|||
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:19 | |
01:20
bjz left
01:24
Hor|zon left
01:25
Jaglor joined
|
|||
konobi | psch: just trying to work it out | 01:30 | |
01:36
leont left
01:45
BenGoldberg left,
ilbot3 left
01:46
ilbot3 joined
01:55
araujo_ joined
01:56
araujo left
|
|||
dalek | osystem: cf85616 | (Fayland Lam)++ | META.list: Add Gravatar::URL to ecosystem See github.com/fayland/perl6-Gravatar-URL |
02:05 | |
02:06
llfourn joined
02:14
noganex_ joined
02:17
noganex left
02:20
rurban left,
Hor|zon joined
02:25
Hor|zon left
02:30
tokuhirom_ joined
02:34
tokuhirom_ left
02:36
Sgeo__ left
02:37
Sgeo joined
02:38
llfourn left
|
|||
lichtkind | good night | 02:42 | |
02:48
ngie joined
|
|||
dalek | kudo-star-daily: bfd9d62 | coke++ | log/ (9 files): today (automated commit) |
02:52 | |
kudo-star-daily: 5a1ca12 | coke++ | log/ (8 files): today (automated commit) |
|||
rl6-roast-data: 6639af4 | coke++ | / (9 files): today (automated commit) |
|||
kudo/nom: 4f2ee3d | TimToady++ | src/Perl6/ (2 files): fix topicalization of without as well |
02:53 | ||
ast: 47f8eb0 | TimToady++ | S04-statements/with.t: test with/without much more thoroughly |
|||
02:54
Suzeanne joined,
weihan left
02:57
eliasr left
|
|||
dalek | ast: df29028 | TimToady++ | S04-statements/unless.t: test that 'unless true' returns Slip |
02:59 | |
03:00
xxx left,
tokuhiro_ joined
03:01
lichtkind left,
ingy left
03:03
tokuhirom_ joined,
xxx joined,
xxx is now known as Guest36282
03:04
tokuhiro_ left
03:09
ngie left
03:12
Suzeanne left
03:17
kid51 left
03:21
Hor|zon joined
03:26
Hor|zon left
03:29
llfourn joined
03:37
Jaglor left
03:43
tokuhirom_ left
03:45
aborazmeh left
03:54
Brynn joined
03:56
weihan joined
03:57
Brynn left
04:06
tokuhiro_ joined
04:10
tokuhiro_ left
04:22
Hor|zon joined
|
|||
llfourn | my perl6 REPL is no longer working nicely with ← giving me ^[[D | 04:27 | |
after rebuilding -- how2fix? | |||
04:27
Hor|zon left
|
|||
llfourn | ^^ dw I fixed it :) | 04:28 | |
04:29
Suzeanne joined
04:33
khw left
|
|||
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:41 | |
masak | m: sub foo($n) { $n == 2 ?? Empty !! $n }; say (1, 2, 3).map(&foo) | 04:43 | |
camelia | rakudo-moar 4f2ee3: OUTPUT«(1 3)» | ||
masak | m: sub foo($n) { $n == 2 ?? Slip.new !! $n }; say (1, 2, 3).map(&foo) | ||
camelia | rakudo-moar 4f2ee3: OUTPUT«(1 3)» | ||
masak | is there any detectable difference between Empty and Slip.new ? | ||
llfourn | konobi: I was just talking about the inbuilt Perl 6 REPL.... I just needed to reinstall Linenoise. blessed looks cool though :) | 04:44 | |
konobi | yeah, but blessed it all native... also doesn't even need readline | 04:45 | |
llfourn | konobi: You use it with Perl6 somehow | 04:47 | |
? | |||
konobi | nope, just worked with it in the early days | ||
um... blessed that is | |||
though I also worked with perl6 back in the early days too ^_^ | 04:48 | ||
masak | :) | ||
llfourn | I see :) | ||
masak | how early are the early days, OOC? | ||
04:51
araujo_ left
|
|||
konobi | masak: good ol' pugs era | 04:51 | |
btw... how self-contained is moarvm? | 04:53 | ||
04:54
baest_ joined
04:55
ollej_ joined
04:56
nyar1ath0tep joined
04:57
psch_ joined,
ashleydev joined,
jojotus_ joined,
riatre_ joined,
boegel|quassel joined,
xenu_ joined
04:58
grondilu_ joined,
erdic_ joined,
atta_ joined
|
|||
konobi | jnthn: ping! | 04:59 | |
05:00
kst` joined,
nyar1ath0tep left,
masak_ joined
05:01
masak_ is now known as masak_grr,
Hotkeys_ joined
05:02
hobbified joined,
ilbot3 left,
[Tux] left,
gensym left,
grondilu left,
boegel left,
Gardner left,
preyalone left,
revdiablo left,
baest left,
atta left,
Hotkeys left,
jojotus left,
lsm-desktop left,
kipd left,
SmokeMachine_ left,
erdic left,
avuserow1 left,
Debolaz left,
zemmihates left,
Spot__ left,
xenu left,
dylanwh_ left,
ashleyde1 left,
psch left,
ugexe left,
riatre left,
Fluor left,
ollej left,
masak left,
hobbs left,
kst left,
erdic_ is now known as erdic
05:03
gensym_ joined,
gensym_ is now known as gensym,
revdiablo joined
|
|||
masak_grr | ah, Pugs. | 05:04 | |
05:05
Gardner joined
|
|||
masak_grr | I wonder how path Perl 6 would have taken if not for Pugs. | 05:05 | |
konobi | masak_grr: it was a lot of fun at the time... but it was parrot timelines that turned me off, for sure. | ||
masak_grr: the current "perl6 1.0" release is moarvm based, right? | 05:08 | ||
05:08
SuzieQueue joined,
lsm-desktop joined,
Fluor joined,
araujo joined,
araujo left,
araujo joined,
[Tux] joined
05:09
ingy joined,
tokuhirom_ joined,
mrsolo left,
dylanwh_ joined
05:10
ugexe joined,
Debolaz joined,
avuserow1 joined
05:11
ilbot3 joined
05:12
Suzeanne left,
kipd joined,
SmokeMachine_ joined
05:14
preyalone joined
05:15
Spot__ joined,
zemmihates joined
|
|||
TimToady | konobi: jnthn++ is off on his honeymoon | 05:16 | |
konobi | TimToady: oh wow... nice! if there's someone worthy of having a nice time off, mr worthington is definitely up there. | 05:17 | |
TimToady: how's things? excited to finally release before christmas? =0) | |||
TimToady | it...please me :) | 05:21 | |
*pleases | |||
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» | ||
TimToady | but I found a bug... | ||
konobi | TimToady: <3 | ||
05:23
Hor|zon joined
|
|||
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... | ||
but it's nice to officially be in beta state now | |||
konobi | =0) | ||
so it's moarvm based now, right? parrot is still off in the sidelines? | 05:25 | ||
TimToady | yes, moarvm is the main effort, but looks like jvm is sticking close too | 05:26 | |
parrot...not so much | |||
and there's a js backend coming along too | |||
konobi | TimToady: have a look at the vmkit stuff that's available for llvm at all? | ||
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. | ||
TimToady | ok, pmurias++ is the one working on it mostly | ||
05:27
Hor|zon left
|
|||
TimToady | he might well be glad of some assistance | 05:28 | |
now, to figure out this bug... | 05:30 | ||
konobi | TimToady: rgr! old belfast.pm folk to the rescue! | 05:31 | |
05:34
masak_grr is now known as masak
|
|||
masak | konobi: yay, JS backend! \o/ | 05:35 | |
I still belive that one will be a game-changer in unknowable ways. | 05:36 | ||
(simply because JavaScript is eating everything and things will only survive long-term to the extent they compile down JavaScript) | |||
konobi | masak: ruh-roh | ||
masak | down to* | ||
konobi | masak: oh hey... masak! how's it going! | 05:37 | |
masak | :D | ||
konobi | now I clock ^_^ | ||
masak | well, hey. :) yet another survivor from back in the Pugs days. :) | ||
konobi: you may be doing nodejs for your sins -- I'm doing Perl 6 macros in Rakudo for my sins ;) | 05:38 | ||
TimToady: speaking of which, I have a question for you about unquotes. | 05:39 | ||
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. | ||
masak | konobi: sounds... rather nice, actually. I mean, node seems very interesting. and v8, too. | ||
konobi: I'm very into JS these days, though not node in particular. just, you know, the whole thing. | |||
I definitely should do more server-side things. | 05:41 | ||
and build/toolchain things | |||
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) | ||
masak | huh, Perl 6 mentioned in news.ycombinator.com/item?id=10404720 -- a thread about Ravi, a typed Lua | ||
konobi: kudos :) | |||
llfourn: depends what you mean. | |||
05:42
jojotus_ is now known as jojotus
|
|||
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 | |||
masak | m: class A { has $.x; method foo { say($.x) } }; class B { has $.x }; A.^find_method("foo")(B.new(:x("OH HAI"))) | ||
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» | ||
masak | hm :) | ||
m: class A { has $.x; method foo { say($.x) } }; class B is A { has $.x }; A.^find_method("foo")(B.new(:x("OH HAI"))) | |||
camelia | rakudo-moar 4f2ee3: OUTPUT«OH HAI» | ||
masak | so, that works :) | 05:44 | |
it's a kind of "tie a self" thing, if you will | |||
konobi | masak: any idea how independent moarvm is at all? | ||
llfourn | masak: But can you return a code object with the self tied into it without calling it | ||
konobi | masak: ie: could it be easily bundled in a statically linked fashion? | 05:45 | |
masak | llfourn: just put it in a lambda, I guess? | 05:46 | |
konobi: dunno -- maybe ask #moarvm? | |||
konobi | also... how useful is moarvm by itself o.O | ||
masak | & | ||
konobi | masak: freenode? | ||
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 | |
I mean $method.() I don't know what "install" is there | |||
developer.mozilla.org/en-US/docs/W...ction/bind <= that is what I meant | 05:55 | ||
but I guess lambdas are much less cumbersome in p6 v JS so not super necessary | 05:57 | ||
dalek | kudo/nom: ef77bd7 | TimToady++ | src/Perl6/Grammar.nqp: 'else' needs $/ update to see $<sym>[-1] |
06:02 | |
ast: e8bc45e | TimToady++ | S04-statements/with.t: test mixed if/with/else usage |
|||
TimToady | masak: I presume a statement resembling $::("OUTER::x") = "OH HAI"; would work | 06:04 | |
06:07
tokuhiro_ joined
|
|||
konobi | TimToady: is there any dtrace in the implementation currently? | 06:10 | |
06:12
tokuhiro_ left
|
|||
TimToady | wha? dtrace is more like a kernel level thing, afaik | 06:12 | |
konobi | nope | 06:14 | |
it's a utility you can use from kernel the whole way up through userland | |||
TimToady | then I don't understand "in the implementation" | 06:15 | |
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:16 | |
llfourn | perl5 doc for dtrace: perldoc.perl.org/perldtrace.html | 06:17 | |
TimToady | feel free to hack something in :) | ||
TimToady is just the language designer... | |||
konobi | llfourn: that's a little differnt too | 06:18 | |
brb... lemme bug the dtrace guy | |||
06:24
Hor|zon joined
06:29
bjz_ left,
Hor|zon left
|
|||
masak | TimToady: I realize I didn't constrain my question enough -- you're not allowed to modify the existing $x :) | 06:29 | |
TimToady: what I'm after is -- is there any way for an unquote to create a new variable? | |||
in the *current* scope | 06:30 | ||
06:31
domidumont joined
|
|||
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:31 | |
06:32
boegel|quassel left
|
|||
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 | |
06:33
boegel joined
06:35
domidumont left
06:37
domidumont joined
06:40
bjz joined
06:43
softmoth left
06:44
pmurias joined
|
|||
pmurias | konobi: hi | 06:44 | |
konobi: tools/build/gen-js-makefile.nqp is the thing that needs to be updated | 06:45 | ||
06:50
llfourn left
|
|||
masak | what's the idiomatic way in Perl 6 to say "$x and $y are of exactly the same type" ? | 07:00 | |
$x.WHAT === $y.WHAT ? | |||
07:02
karim joined
|
|||
karim | I want my class to be able to parse itself from json, something like | 07:03 | |
class C1 { | |||
method parse-from-json($json) { | |||
} | |||
} | |||
1) How can I make that method static so I'll be able to call it on the class level? | |||
2) how to return "self" being an instance of C1 from "parse-from-json"? | |||
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!» | ||
masak | that's your first question, I guess. by default, methods can be called both on the class and on instances. | 07:05 | |
m: class C1 { has $.json; method parse-from-json($json) { self.bless(:$json) } }; C1.parse-from-json('{}').json | 07:06 | ||
camelia | ( no output ) | ||
masak | m: class C1 { has $.json; method parse-from-json($json) { self.bless(:$json) } }; say C1.parse-from-json('{}').json | ||
camelia | rakudo-moar ef77bd: OUTPUT«{}» | ||
07:06
karim left
|
|||
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:06 | |
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:09 | |
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 | |
ShimmerFairy: which part of S12 were you reading? :) | |||
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 | |
masak: ^^^ that one :) | |||
masak | I'd say those two parts are in opposition. | 07:15 | |
(and that Rakudo is currently implementing the one I dug up.) | |||
ShimmerFairy | For the record, the part I read is newer by about a year :P (2011 compared to 2010) | 07:16 | |
masak | yes, I suspected that. | 07:17 | |
but the newer part is still conjectural, and unimplemented. | |||
07:21
bjz left
07:23
bjz joined,
ifim left
07:25
Hor|zon joined
07:30
Hor|zon left
07:32
kaare_ joined
07:35
rurban joined
|
|||
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:39 | |
07:44
kanishka joined,
kanishka left
07:50
llfourn joined
07:55
RabidGravy joined,
CIAvash joined
08:05
firstdayonthejob joined
08:09
darutoko joined,
tokuhiro_ joined
08:14
tokuhiro_ left
08:26
Hor|zon joined
08:31
Hor|zon left
|
|||
FROGGS | yay, I finally seem to have a proper fix for subst-in-a-loop | 08:34 | |
it took three evenings :S | |||
08:38
margeas joined
08:43
s_kilk joined
|
|||
moritz | that's the nature of some bug fixes | 08:44 | |
dalek | osystem: 7c1cb44 | (Shane Kilkelly)++ | META.list: Add Config::Clever to ecosystem See github.com/ShaneKilkelly/perl6-config-clever |
08:48 | |
osystem: d32e392 | RabidGravy++ | META.list: Merge pull request #80 from ShaneKilkelly/master Add Config::Clever to ecosystem |
|||
08:49
Ven joined
08:50
vendethiel joined
08:51
Ven left
09:02
kjs_ joined
|
|||
[Tux] | test 50000 37.913 37.801 | 09:05 | |
test-t 50000 39.782 39.669 | |||
09:21
szabgab joined
09:22
Zoffix joined
|
|||
Zoffix | .botsnack | 09:22 | |
yoleaux | :D | ||
synbot6 | om nom nom | ||
yoleaux | 14 Oct 2015 18:15Z <azawawi> Zoffix: it was the HTTP code 303 after all that caused the hanging. Now it is working :) | ||
14 Oct 2015 21:48Z <ZoffixMobile> Zoffix: check out github.com/tony-o/perl6-hiker when you're sober | |||
15 Oct 2015 15:53Z <tony-o_> Zoffix: the other thing to check out, one step more removed from hiker is HTTP::Server::Router - github.com/tony-o/perl6-http-server-router | |||
09:23
s_kilk left
|
|||
szabgab | p6: say 1+int rand*6 | 09:23 | |
camelia | rakudo-moar ef77bd: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfileTwo terms in a rowat /tmp/tmpfile:1------> 3say 1+int7⏏5 rand*6 expecting any of: infix infix stopper postfix statement end statemen…» | ||
szabgab | p6: say 1+int(rand*6) | ||
camelia | rakudo-moar ef77bd: OUTPUT«Cannot invoke this object in block <unit> at /tmp/tmpfile:1» | ||
szabgab | p6: rand*6 | ||
camelia | rakudo-moar ef77bd: OUTPUT«WARNINGS:Useless use of "*" in expression "rand*6" in sink context (line 1)» | ||
szabgab | p6: 6*rand | ||
camelia | rakudo-moar ef77bd: OUTPUT«WARNINGS:Useless use of "*" in expression "6*rand" in sink context (line 1)» | ||
szabgab | p6: say 6*rand | ||
camelia | rakudo-moar ef77bd: OUTPUT«0.687734836974753» | ||
09:23
bjz left
|
|||
szabgab | p6: say int(6*rand) | 09:24 | |
camelia | rakudo-moar ef77bd: OUTPUT«Cannot invoke this object in block <unit> at /tmp/tmpfile:1» | ||
moritz | m: say (6*rand).Int | 09:25 | |
camelia | rakudo-moar ef77bd: OUTPUT«4» | ||
moritz | m: say (^6).pick | ||
camelia | rakudo-moar ef77bd: OUTPUT«5» | ||
RabidGravy | I was just going to suggest that | ||
moritz | szabgab: .pick on a Range is the idiomatic way to generate a random integer in p6 | 09:26 | |
szabgab | p6: (1..6).pick | ||
camelia | ( no output ) | ||
szabgab | p6: say (1..6).pick | ||
camelia | rakudo-moar ef77bd: OUTPUT«6» | ||
moritz | m: .say for (1..6).roll(10) | ||
camelia | rakudo-moar ef77bd: OUTPUT«1644454211» | ||
moritz | or .roll, for that matter | ||
szabgab | moritz: thanks, it would be nice to mention this on doc.perl6.org/routine/rand | 09:27 | |
p6: say (1..6).roll | |||
camelia | rakudo-moar ef77bd: OUTPUT«1» | ||
szabgab | p6: say (1..6).roll | ||
camelia | rakudo-moar ef77bd: OUTPUT«5» | ||
09:27
Hor|zon joined
|
|||
RabidGravy | It's mentioned somewhere in the docs, but can't remember where | 09:28 | |
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. gist.github.com/Ovid/8d3085d466110d78aeda | ||
Running “rakudobrew build moar” works just fine, however. | 09:30 | ||
RabidGravy | that's curious | 09:31 | |
09:31
^elyse^ joined
09:32
Hor|zon left
|
|||
CurtisOvidPoe | Running it through the debugger now. Last time I tried I got stuck and didn’t have the time to finish. | 09:32 | |
Zoffix | Weird: "Perl v6.0.0 required--this is only v5.20.2" seems it's using perl instead of perl6 | 09:33 | |
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. | ||
RabidGravy | I seem to recall something like this from ages ago | ||
CurtisOvidPoe | RabidGravy: on my brand, spanking new MacBook, it’s a fresh install. | ||
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 | ||
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:38 | |
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:39 | |
Zoffix | \o/ | 09:40 | |
moritz | along with some more permissions regarding teams in that org | ||
masak | got it. thanks. | 09:41 | |
szabgab | could you please review: perl6maven.com/number-guessing-game ? | 09:48 | |
Zoffix | CurtisOvidPoe, is your PROVE_COMMAND env var set to anything? | 09:49 | |
CurtisOvidPoe | Nope. | ||
Still digging in :) | |||
Zoffix | :) | ||
09:49
FROGGS_ joined
09:50
bjz joined
09:51
FROGGS left
09:57
rindolf joined
|
|||
Zoffix | I've reached a dead end here: github.com/tadzik/panda/blob/maste...ter.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:00 | |
10:01
ggoebel left
|
|||
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:04 | |
But I’m guessing you know that :) | 10:05 | ||
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
|
|||
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
|
|||
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:12 | |
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. | ||
ShimmerFairy: the intent was noble: prevent excessive knowledge of truly private things | 10:14 | ||
10:14
szabgab left
|
|||
masak | the eventual fallout was twofold: disallow .new/.bless from installing values in private attrs, and disallow .perl from showing them | 10:15 | |
m: class C { has $!x = 42 }; say C.new.perl | |||
camelia | rakudo-moar ef77bd: OUTPUT«C.new» | ||
10:15
tokuhiro_ left
|
|||
masak | :( | 10:15 | |
I'm not so sure those decisions were correct anymore. | |||
.perl is a debugging tool, a way to say "OK, just show me what's inside" | |||
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. | ||
masak | it's not necessarily a tool that needs to play by encapsulation rules | ||
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 | kudo/nom: 32d7b08 | FROGGS++ | src/ (2 files): fix usage of match variable in replacement part of substitution $_ ~~ s[(.)] = "$0" compiled to $_.subst{-mutate} before. This was problematic in so far that the $0 in the string were interpolated before the match (.) happened. The we compile to a method call to .match and APPLY-MATCHES separately, which gives us the opportunity to set $/ before interpolating the match result in the right hand side. |
||
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:17 | |
masak | well, yes | 10:18 | |
but those things are for "normal" use of a class | |||
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" | ||
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. | ||
So are there any known bugs regarding the shell() command on OS X? | 10:20 | ||
RabidGravy | .tell szabgab you might find something like gist.github.com/jonathanstowe/c569...f13cb43abd is even more idiomatic | ||
yoleaux | RabidGravy: I'll pass your message to szabgab. | ||
RabidGravy | .tell szabgab but otherwise yeah great :) | 10:21 | |
yoleaux | RabidGravy: I'll pass your message to szabgab. | ||
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» | ||
masak | ShimmerFairy: I don't see that as a problem, as long as the default accessor method does the right thing. | ||
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:23 | |
10:25
bjz_ joined
10:27
bjz left
|
|||
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 | |
10:28
Hor|zon joined
|
|||
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:29 | |
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 | |
(because the distinction "has an auto-generated accessor" isn't a very meaningful one) | |||
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 | |
(and now I also wonder what the distinction ends up being like in other languages :P) | |||
masak | that's what I'm saying. | ||
it was a noble goal, but it doesn't really make sense to exclude accessor-less attributes. | 10:33 | ||
10:33
Hor|zon left
|
|||
CurtisOvidPoe | I asume we can’t actually run the shell() command with p6? I’d try, but it seems rude :) | 10:35 | |
moritz | CurtisOvidPoe: you may try; just don't do something fatal with it, in case it works | 10:37 | |
m: shell("echo foo") | |||
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» | ||
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: gist.github.com/Ovid/fe4fb45360d32369cf67 | ||
(Along with the code to invoke it. I can’t see what I did wrong) | 10:40 | ||
Hmm, should have been .chars, but that doesn’t impact it. | 10:41 | ||
RabidGravy | CurtisOvidPoe, need an :out on the shell() | 10:42 | |
llfourn | perl6 -e 'shell("ls -l /")' by itself prints stuff out o.O | 10:44 | |
10:44
^elyse^ left
|
|||
RabidGravy | yeah, but without the :out adverb it doesn't capture it hence the .out is just a type object | 10:45 | |
CurtisOvidPoe | Cheers! | ||
llfourn | so it is simply outputting to stdout by default? | ||
RabidGravy | it's not capturing so the output of the command is just going to where it would go | ||
llfourn | orite | 10:46 | |
CurtisOvidPoe | I feel like such a complete n00b :) | 10:47 | |
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. | ||
Does anyone here have an OS X box on which they have successfully done ‘rakudobrew install panda’? | 10:58 | ||
RabidGravy | sorry | ||
10:58
CIAvash left
10:59
CIAvash joined
11:00
Nickmob joined
11:01
Nickmob left
|
|||
llfourn | CurtisOvidPoe: yes, but months ago | 11:01 | |
for me it's rakudobrew build-panda | 11:02 | ||
11:03
Kogurr left
11:07
^elyse^ joined
11:09
virtualsue joined
|
|||
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:12 | |
RabidGravy | weird | 11:15 | |
CurtisOvidPoe | I’ll figure it out now, but I have a couple of other things I need to resolve first. | ||
In short: this is great news :) | 11:16 | ||
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 | ||
11:18
bjz joined
|
|||
moritz | m: say Num.^can('sqrt').^name | 11:19 | |
camelia | rakudo-moar 32d7b0: OUTPUT«List» | ||
11:19
bjz_ left
|
|||
moritz | m: say Num.^can('sqrt')[0] does role { method flurb() { } }; | 11:19 | |
camelia | rakudo-moar 32d7b0: OUTPUT«sqrt» | ||
moritz | RabidGravy: something like this? | 11:20 | |
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:21 | |
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 | ||
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:23 | |
moritz | what difference does early versus late make? | 11:24 | |
llfourn | RabidGravy: Maybe custom metaclass and override: docs.perl6.org/type/Metamodel::Attr..._attribute | 11:25 | |
11:26
kjs_ left
|
|||
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:27 | |
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» | ||
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
|
|||
moritz | RabidGravy: fwiw if you supply your own accessor, none will be generated | 11:29 | |
11:29
CIAvash left
|
|||
RabidGravy | yeah, but doesn't make such a nice interface | 11:30 | |
dalek | atures: 0286bce | (Zoffix Znet)++ | template.html: Fix markup error |
||
Zoffix | Oh god >_< | 11:31 | |
moritz | RabidGravy: I don't think we're quite on the same wavelength here | ||
Zoffix | So much for --patch when you still commit with your 'add --all' alias | ||
moritz | Zoffix: get rid of that alias, I'd say :-) | 11:32 | |
Zoffix | :) | ||
11:33
Hor|zon left
|
|||
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 | |
11:37
diana_olhovik_ joined
11:45
kjs_ joined
11:48
kjs_ left
|
|||
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 :( | ||
17 Oct 2015 17:45Z <jnthn> nine: Maybe not creating fresh Scalar containers or so | |||
camelia | rakudo-moar 32d7b0: OUTPUT«list» | ||
..rakudo-jvm 32d7b0: OUTPUT«left» | |||
11:52
BenGoldberg joined,
Ven joined
11:53
Ven left,
Ven_ joined
11:54
virtualsue left,
xfix joined
11:55
spider-mario joined
12:02
karim joined
|
|||
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:03 | |
12:04
^elyse^ left
12:06
ngie joined
12:07
^elyse^ joined
12:08
kid51 joined,
diana_olhovik_ left
12:09
telex left
12:10
azawawi joined
|
|||
azawawi | hi #perl6 | 12:10 | |
12:10
telex joined
|
|||
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. | ||
azawawi | github.com/azawawi/perl6-selenium-...es/ex01.p6 # Automated UI test: Searching using google for "Perl 6\n" keyword :) | 12:12 | |
Zoffix | azawawi, neat. What User-Agent does it report to Google? | 12:17 | |
('cause I know google blocks Perl 5's LWP, for example) | 12:18 | ||
dalek | ast: f665268 | FROGGS++ | S04-statements/for.t: unfudge/add tests for capture in subst in loop |
||
azawawi | Zoffix: well im not setting a user agent atm | ||
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 :) | ||
Zoffix | \o/ | ||
12:21
vendethiel left
|
|||
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:21 | |
class C1 { method m1() { ....; return self(1, 2, 3); } } | 12:22 | ||
llfourn | karim: self.new? | ||
karim | thx | ||
azawawi | Zoffix: then create a good documentation website like this one selenium-python.readthedocs.org/en/...arted.html | ||
llfourn | karim: my pleasure :) | ||
12:23
karim left,
leont joined
|
|||
Zoffix | azawawi, nice. That'll be a useful module. | 12:23 | |
azawawi | yup | ||
12:24
AlexDaniel left
|
|||
azawawi | Zoffix: your github ticket is really useful. We need more documentation. That's what drew me into Perl in the first place. | 12:25 | |
Zoffix: doc.perl6.org is useful but lacks organization to a newbie imho | 12:26 | ||
Zoffix | It lacks a more powerful search too. | ||
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:27 | |
saying infix, postfix to someone new to Perl is like saying to him/her go away :) | 12:28 | ||
i.e. doc.perl6.org/routine.html | 12:29 | ||
12:29
Ven_ left
12:30
karim joined,
Hor|zon joined
|
|||
azawawi | comparing selenium-python.readthedocs.org/en/...arted.html to 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. | ||
dalek | atures: fd38b65 | (Zoffix Znet)++ | template.html: Fix incorrect overflow on mobile (Closes #4). Fix missing footnotes (Closes #3) pos:abs; on footnotes without a near parent causes them to invisibly overflow past .table-responsive |
||
FROGGS_ | azawawi: please file a doc issue | 12:32 | |
azawawi | karim: return is optional | ||
karim | and how about ";" ? | ||
llfourn | azawawi: We do need a more general tutorial and to make tutorials more visually seperate. | ||
azawawi | llfourn: true | 12:33 | |
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; | ||
camelia | rakudo-moar 32d7b0: OUTPUT«Nil» | ||
azawawi | m: sub foo { return }; say foo.perl; | ||
camelia | rakudo-moar 32d7b0: OUTPUT«Nil» | ||
llfourn | karim: return isn't documented properly anywhere afaik sorry! | ||
azawawi | m: sub foo { 1 }; say foo.perl; | ||
camelia | rakudo-moar 32d7b0: OUTPUT«1» | ||
azawawi | m: sub foo { ; }; say foo.perl; | 12:35 | |
camelia | rakudo-moar 32d7b0: OUTPUT«Nil» | ||
Zoffix | FWIW: I was responding to "<karim> and how about ";" ?" :) | ||
12:35
Hor|zon left
|
|||
llfourn | Zoffix: ah. Yeah I guess wtf is ';' is a question a lot of newbies will have. | 12:36 | |
this is where a general intro tutorial would be good | |||
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
|
|||
Zoffix | karim, depends on whether it's last. if it's not last, then it's not optional. | 12:37 | |
12:37
TEttinger left
|
|||
karim | ok | 12:38 | |
12:38
karim left
|
|||
dalek | atures: 4cc9f61 | (Zoffix Znet)++ | template.html: Remove debugging markup |
12:39 | |
azawawi | how can i embed github markdown in pod6 blocks? | 12:47 | |
rationale: markdown is way easier to work with than pod6 | 12:49 | ||
pink_mist disagrees with that rationale, but don't let that get in the way of you trying =) | 12:50 | ||
12:50
vendethiel joined
|
|||
moritz | azawawi: indent it 4 spaces | 12:52 | |
azawawi tries it | 12:53 | ||
vendethiel | FROGGS_++ | 12:54 | |
12:55
spider-mario left
12:56
xenu_ is now known as xenu
|
|||
azawawi | moritz: but why 4 spaces btw? | 12:57 | |
12:57
cognominal joined
|
|||
pink_mist | isn't that the standard markdown indenation style? | 12:58 | |
moritz | azawawi: that way it doesn't get falsly parsed as pod | ||
the beauty is that you can use *any* markup in pod6 if you indent it | 12:59 | ||
Zoffix | 0.o | ||
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:00 | |
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. | ||
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. | ||
RabidGravy: yes, but not spelled 'markdown', that's a reserved block name :) | |||
moritz | RabidGravy: sure, but no renderer currently does anything with that block | ||
RabidGravy | well, surely if people want to use it then they should consider making a renderer ;-) | 13:04 | |
pmurias | masak: re hiding private attributes from perl, how can you get them for debugging? | 13:08 | |
moritz | pmurias: through the MOP | ||
doc.perl6.org/type/Attribute#method_get_value | 13:09 | ||
13:09
adhoc left
|
|||
pmurias | seems really inconvenient | 13:09 | |
what was the reason for hidding the from .perl? | |||
moritz | it's *private* | 13:10 | |
azawawi | m: constant NUMPAD_0 = "\x01A"; | ||
camelia | ( no output ) | ||
moritz | private attributes aren't inistialized by the default constructor | ||
azawawi | m: constant NUMPAD-0 = "\x01A"; | ||
camelia | rakudo-moar 32d7b0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/85iGiBeUADMissing initializer on constant declarationat /tmp/85iGiBeUAD:1------> 3constant NUMPAD7⏏5-0 = "\x01A";» | ||
moritz | so including it in .perl output doesn't make sense, because you can't use it recreate the value | ||
azawawi | NUMPAD-0 is not a valid kebab case constant identifier? | 13:11 | |
moritz | azawawi: no | ||
because 0 isn't an identifier | |||
azawawi | i see | ||
dalek | c: 3f80b9a | moritz++ | doc/Type/Attribute.pod: Fix a usage example |
||
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 | ||
dalek | c: 774d9bd | moritz++ | doc/Type/Attribute.pod: fix another Usage example |
13:13 | |
ShimmerFairy | moritz: but what is the difference between public and private attributes? Just sugar for an accessor method. | ||
13:13
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
zakharyas joined
|
|||
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 | ||
azawawi: Perl 6 identifiers follow rules, just like identifiers in any sane language. Of course this has implications. | 13:14 | ||
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:15 | |
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 | |
camelia | rakudo-moar 32d7b0: OUTPUT«Method 'get_value' not found for invocant of class 'Foo' in block <unit> at /tmp/PUtL2yxMNb:1» | ||
moritz | ShimmerFairy: what for? for avoiding private attributes leaking out | ||
Zoffix | How do I fix this error? | ||
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 | ||
RabidGravy | azawawi, from Perl 5 things you have watch for is e.g. print time-rand | ||
moritz | Zoffix: get_value is a method of the Attribute class | ||
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 | ||
moritz | Zoffix: which you can get via introspection | 13:17 | |
ShimmerFairy: it has the distinction, and it's not arbitrary | |||
Zoffix | alright. | ||
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) | ||
masak | m: sub foo { Empty }; say foo().perl | 13:18 | |
camelia | rakudo-moar 32d7b0: OUTPUT«()» | ||
moritz | ShimmerFairy: which is the very definition of "private" | ||
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 | ||
moritz | ShimmerFairy: well, that quote isn't entirely accurate | ||
ShimmerFairy: and it's not arbitrary, because those restrictions cause an outsider to never see a private attribute | 13:19 | ||
ShimmerFairy: which is what makes them *private* | |||
ShimmerFairy: what would you consider private? | |||
"the amount of money I have on the bank is private, but if you call .perl on the bank account, you see it anway"? | |||
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 | ||
ShimmerFairy: which I'm trying to tell you | |||
ShimmerFairy: a public attribute is a private attribute + accessor + META DATA THAT MARKS IT AS PUBLIC | |||
and it's that meta data that makes .perl and .new respond to them | |||
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" | ||
pmurias | s/.foo/.foo and the/ | ||
ShimmerFairy: it's not necessary | |||
moritz | ShimmerFairy: it is necesary | ||
ShimmerFairy: otherwise, privates would leak out | 13:22 | ||
you'd have to overwrite your own .perl and .new just to prevent privates from leaking out | |||
which wouldn't make them very private | |||
is that really that hard to understand? | |||
pmurias | moritz: .perl is just for debugging | ||
moritz | pmurias: no | ||
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. | ||
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 | ||
moritz | ShimmerFairy: and you haven't yet presented a coherent design where that could be true, and privates wouldn't accidentally leak out | ||
pmurias | ShimmerFairy: we could only have private attributes but it would be bloody annoying to write the getters | ||
13:24
eliasr joined
|
|||
moritz | pmurias: .perl is specified to round-trip under EVAL, not be useful for debugging | 13:24 | |
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? | ||
moritz | pmurias: serialization | ||
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 :) | ||
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:26
BenGoldberg left
|
|||
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?) | ||
moritz | ShimmerFairy: if it respects all attributes, then those attributes aren't really private | ||
ShimmerFairy: which *directly* contradicts your "all attributes are private" approach | 13:28 | ||
pmurias: no; but there are many use cases where you don't have to | 13:29 | ||
azawawi | moritz: i see. thanks :) | ||
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" | ||
moritz | ShimmerFairy: ok, so then how would you make language-agnostic private attributes with your proposal? | ||
ShimmerFairy: attributes that the outside never sees? | |||
azawawi | moritz: solved it by moving it into a hash github.com/azawawi/perl6-selenium-...r/Keys.pm6 :) | 13:30 | |
moritz | azawawi: looks like a sensible choice :-) | 13:31 | |
13:31
_28_ria left
|
|||
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 | |
13:31
Hor|zon joined,
ngie left
|
|||
llfourn | moritz: do you coulnt setting the value of a private attribute at object contruction time to be seeing it? | 13:31 | |
13:31
rindolf left
|
|||
llfourn | count* | 13:32 | |
moritz | ShimmerFairy: if the behavior of private attributes isn't useful to you, just use public attributes | ||
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. | ||
moritz | llfourn: of course | ||
ShimmerFairy: there are solutions to that in current Perl 6 too | |||
llfourn | mortiz: ok just checking as I think this is the crux of your disagreement | ||
13:33
_28_ria joined
|
|||
RabidGravy | ShimmerFairy, in that case I'd consider making a BUILD that pretended to do that | 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. | ||
moritz | llfourn: if the outside can interact with it by default, it's not private. It's quite easy, IMHO :-) | ||
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 | |||
llfourn | mortiz: being able to set it at object contruction time and then never set or get it again.... some might consider that private? | ||
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 :) | ||
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. | ||
moritz | colomon: thanks, that's a nice way to put it | ||
RabidGravy | :) | ||
13:35
Alina-malina left
|
|||
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:35 | |
13:36
Hor|zon left
|
|||
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 | |
:) | |||
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" | ||
Or rather 'rwp' would be more appropriate: read only to the outside / read-write inside. | 13:38 | ||
13:38
ecocode joined
|
|||
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. | ||
which is pretty trivial to do by hand for each such attribute. | |||
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? | ||
llfourn | ShimmerFairy: so what you want is an attribute that is available to bless and default new but has no accessors? | ||
RabidGravy | *I'm* not asking for anything, I'm suggesting how one would achieve that without changing Perl | ||
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. | ||
colomon | RabidGravy: sorry, meant ShimmerFairy | ||
RabidGravy | :) | ||
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 | |
13:40
abaugher joined
|
|||
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 | ||
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 | ||
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 :) | ||
moritz | ShimmerFairy: but Perl 6 isn't a more secure environment | ||
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? | ||
moritz | private attributes can *never* be a security feature within the same process | ||
ShimmerFairy: because I want to avoid things becoming API that aren't meant to be API | 13:44 | ||
ShimmerFairy: it's the difference between avoiding leaks to avoid environmental pollution, and avoiding leaks as a security feature | |||
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 | ||
moritz | ShimmerFairy: I've never today talked about security before | ||
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 | ||
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 | :) | ||
moritz | RabidGravy: I asked for an example use case because I thought the discussion was going nowhere | ||
RabidGravy: and so far got only one constructed, unapplicable example | |||
13:49
azawawi left
|
|||
llfourn enjoyed the discussion and understood both sides | 13:49 | ||
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 | |
so now I'm looking for other people's use cases | |||
13:50
SqrtNegInf joined
|
|||
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 | |
which is why I hardly ever use them | |||
13:56
kjs_ left
|
|||
llfourn | something like class A { has $!a is contructor-param; } so $!a could be set by bless would be nice. | 13:56 | |
RabidGravy | which could be done with a user supplied role and a trait | 13:57 | |
llfourn | RabidGravy: yep probs best to test out the idea in that respect at least | 13:58 | |
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; } | ||
like in Moose with lazy => 1 | |||
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/jAIrABouZTVirtual call $.a may not be used on partially constructed objectsat /tmp/jAIrABouZT:1------> 3s A { has $.a = 'default'; has $.b = $.a7⏏5; }; say A.new.b expecting any of: …» | ||
moritz | m: class A { has $.a = 'default'; has $.b = self.a; }; say A.new.b | ||
camelia | rakudo-moar 32d7b0: OUTPUT«default» | ||
14:02
aborazmeh left
|
|||
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» | ||
llfourn | mortiz: awesome :) | ||
llfourn goes to document this feature | |||
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 :-) | ||
RabidGravy: it has worked for years, though it used to work with $.a syntax instead of self.a | 14:04 | ||
14:04
ecocode left
|
|||
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
|
|||
dalek | ast: da8c0ee | usev6++ | S11-modules/require.t: Add "use lib '.';" for test that needs it |
14:08 | |
llfourn | moritz: is it meant to work wtih $.a? | 14:11 | |
dalek | kudo/nom: 23ccdc2 | lizmat++ | src/core/Supply.pm: Fix an omission in emission tracking |
||
pink_mist | lizmat++ I bet you enjoyed writing that commit message :P | 14:12 | |
lizmat | :-) yes I did :-) | ||
RabidGravy | the VW commit | ||
lizmat | been binge watching Bones to get in the mood | ||
RabidGravy: yes, and that :-) | |||
afk again& | 14:13 | ||
dalek | ast: 85edc25 | usev6++ | S32-num/power.t: (Re-)fudge test for big exponent on rakudo.moar test was unfudged with b0f743e59e but is failing for a while now |
14:18 | |
grondilu_ | m: say &[>+<] | 14:20 | |
camelia | rakudo-moar 32d7b0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Jy9OiphBYbUnable to parse expression in infix noun; couldn't find final ']' at /tmp/Jy9OiphBYb:1------> 3say &[>7⏏5+<]» | ||
grondilu_ was wondering what is this equiv('>+<') mentioned above | 14:21 | ||
14:22
grondilu_ is now known as grondilu,
Akagi201 joined
14:23
grondilu left,
grondilu joined,
b2gills left
14:24
Sgeo left,
Sgeo joined
|
|||
dalek | c: 9793f64 | (Lloyd Fournier)++ | doc/Language/objects.pod: mixed in a self into the attribute default example |
14:31 | |
14:32
kjs_ left,
Hor|zon joined,
pmurias_ joined
14:34
Ven_ joined
|
|||
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…» | ||
masak | m: say Array.^roles | ||
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
Ven_ left
|
|||
masak | is that... intentional? | 14:34 | |
14:35
Ven_ joined,
pmurias left
14:36
Alina-malina joined,
vendethiel left,
Hor|zon left
14:38
khw joined
|
|||
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…» | ||
nine | masak: I guess it's the same for all abstract roles | ||
m: say role Foo { method foo { ... } } | |||
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_…» | ||
masak | nine: something feels wrong about that, though. | 14:41 | |
nine: I wasn't asking for an implementation of the role, just for its name. | |||
nine: what's the idiomatic way to ask for the roles implemented by Array? :) | |||
psch_ | it feels consistent but useless, yes | 14:42 | |
14:42
psch_ is now known as psch
|
|||
nine | masak: you sure? roles returns the type objects for the roles, not only their names | 14:42 | |
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. | ||
nine | So yes, consistent, but certainly useless :) | ||
m: my $iterable = Iterable; say $iterable.^name; | |||
camelia | rakudo-moar 32d7b0: OUTPUT«Iterable» | ||
nine | masak: you can ;) | 14:44 | |
psch | m: say Array.^roles>>.^name | ||
camelia | rakudo-moar 32d7b0: OUTPUT«List» | ||
masak | meh. | ||
nine | So it's just gist that could be improved | ||
masak | yeah | ||
m: Iterable.gist | |||
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…» | ||
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 | ||
masak | I think #perl6 has had this discussion before :) | ||
and I don't have a good answer either, I just thinks it's not optimal the way it is | |||
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 | ||
Zoffix | \o | ||
colomon | masak: where are you? | ||
nine | Good night masak | ||
colomon: on .cn time | |||
colomon | yow. | 14:47 | |
awwaiid | gist.github.com/awwaiid/f537ccf5d25cf4ad7cf7 -- EVAL w/ context not affecting callframe() example | 14:48 | |
14:50
Ven_ left
|
|||
CurtisOvidPoe | This concurrent Perl 6 code appears to be blocking. Can someone help me understand what I did wrong? gist.github.com/Ovid/06ac6e9e0187e84a9589 | 14:51 | |
timotimo | CurtisOvidPoe: you're waiting for both the timeout *and* the get requests to complete | 14:53 | |
"allof" seems to be the wrong combiner in the last line | |||
CurtisOvidPoe | Rerunning now with ‘anyof’ | 14:54 | |
timotimo | you probably have to anyof(timeout, allof(results)) | ||
14:54
Ven_ joined,
larion joined
|
|||
RabidGravy | yeah | 14:55 | |
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? | ||
timotimo | RabidGravy: isn't that exactly what i suggested? | 14:57 | |
CurtisOvidPoe | Also, changing that last line to “await @promises” blocks and prints nothing. | ||
RabidGravy | timotimo, oh so it was, distracted | ||
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 | |
like, is the LWP::Simple.get call taking forever for some reason? | |||
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? | ||
definitely weird. | 15:00 | ||
CurtisOvidPoe | It appears that not a single one is returning after the .get | ||
timotimo | thenperhaps LWP::Simple has a problem with parallelism | ||
can you try HTTP::UserAgent instead? | |||
i think it also has a submodule that you can use that'll give you the exact same API as LWP::Simple | 15:01 | ||
15:02
Akagi201 left
|
|||
CurtisOvidPoe | Reducing this down to fetching a single URL (and thus creating only one promise), also fails. | 15:02 | |
15:03
kjs_ joined,
tokuhirom_ left
|
|||
timotimo | that'? kind of bad | 15:03 | |
15:03
larion left,
larion joined
15:04
larion left,
larion joined
|
|||
nine | timotimo: have you had a look at p6for already? Is it useful to you? | 15:04 | |
CurtisOvidPoe | Just running this hangs on my box: perl6 -e 'use LWP::Simple;await start { LWP::Simple.get("www.rakudo.org/") }' | 15:05 | |
timotimo | i've had a brief look and it looks helpful indeed :) | ||
nine | timotimo: yeah! | ||
timotimo | it also brought up the ol' problem of "what to optimize in what order" | ||
15:06
Ven_ left
15:09
b2gills joined
15:10
Ven joined
|
|||
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("www.rakudo.org/").content }' | 15:13 | |
timotimo | well, god damn it. | 15:14 | |
CurtisOvidPoe | I know. | ||
timotimo | hm | ||
15:14
bjz left
|
|||
timotimo | we could try setting a scheduler up that ignores multi-threading | 15:14 | |
as in: | |||
m: my $*SCHEDULER = CurrentThreadScheduler.new(); await start { say "hi" }; | |||
camelia | rakudo-moar 23ccdc: OUTPUT«hi» | ||
CurtisOvidPoe | Nope. Now it’s hanging in the debugger. | 15:16 | |
timotimo | o_O | ||
why would it do that >:( | |||
CurtisOvidPoe is confused | |||
timotimo | what about without debugger? | ||
RabidGravy too, most of the time | |||
15:16
BenGoldberg joined
15:18
bjz joined
|
|||
CurtisOvidPoe | I meant the REPL, sorry. | 15:18 | |
timotimo | oh | ||
CurtisOvidPoe | And now it *works* in the REPL. WTF??? | ||
timotimo | wellllll.... | 15:19 | |
it could very well be because it tries to print the value of the last statement? | |||
15:19
pmurias_ is now known as pmurias
|
|||
timotimo | if not, the REPL has had weirdness issues in the past, for example before the commit that made the := operator work | 15:20 | |
15:21
s_kilk joined
|
|||
CurtisOvidPoe | Hmm, this might be reproducible. Hold on. | 15:22 | |
Got it, but it’s a weird bug … gist.github.com/Ovid/4cb42aefd126fde16000 | 15:24 | ||
You have to call $ua.get() at least once before the await start {} and it works | |||
timotimo | :o | ||
CurtisOvidPoe | Can someone else reproduce the error on their box? | 15:25 | |
15:25
diana_olhovik_ joined
|
|||
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 :( | ||
CurtisOvidPoe | So how do I properly submit a rakudobug? | ||
timotimo | just a mail to [email@hidden.address] | 15:26 | |
CurtisOvidPoe | Thanks for trying, llfourn | ||
llfourn | You also put [BUG] in the title to [email@hidden.address] I think | ||
RabidGravy | CurtisOvidPoe, is that the same for both LWP::Simple *and* HTTP::UserAgent | 15:27 | |
CurtisOvidPoe | Yes. | ||
Wondering if it’s socket related? | |||
RabidGravy | yeah possibly some evil interation between the event loop and libuv's socket thingies | 15:28 | |
ugexe | but the socket isn't created until the `get` is called | 15:29 | |
15:30
bjz_ joined,
Peter_R joined
|
|||
CurtisOvidPoe | rakudobug filed. | 15:30 | |
RabidGravy | yeah, but if there is some thread context thing in the socket implementation | ||
15:31
bjz left
|
|||
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
|
|||
CurtisOvidPoe | Cheers, RabidGravy. | 15:33 | |
rt.perl.org/Ticket/Display.html?id...d8068e1539 | |||
ugexe | never leaves the Planned state | ||
15:33
gtodd left
15:34
^elyse^ left
15:36
Guest77431 left
|
|||
Zoffix | CurtisOvidPoe, if you're just looking for some UA, HTTP::Tinyish seems to work: github.com/shoichikaji/perl6-HTTP-Tinyish/ | 15:36 | |
2.6s (though that's mostly startup and not get): fpaste.scsys.co.uk/500400 | |||
RabidGravy | I guess they are all similarly afflicted | ||
ooh | 15:37 | ||
Zoffix | Oh. I think this one just shells out to `curl' | 15:38 | |
15:38
Hor|zon left
|
|||
ugexe | yep | 15:38 | |
CurtisOvidPoe | On the plus side, every time I update a Perl 6 talk, I get fewer errors in Perl 6 :) | ||
timotimo | i'm getting kind of nervous about our lack for advanced sockety stuff and being so close to christmas | 15:39 | |
udp sockets, for example | |||
RabidGravy | and/or local sockets | 15:40 | |
CurtisOvidPoe | Just drop it from the spec ;) | ||
timotimo | just let people build that with NativeCall? :) | ||
RabidGravy | I've toyed with that idea | ||
CurtisOvidPoe waits for all the NativeCall concurrency bugs ... | |||
timotimo | someone already did that thing, RabidGravy | ||
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 | ||
RabidGravy | the libshout native binding works fine in a concurrent kind of thing | ||
15:41
xfix left
15:43
Ven left
15:44
Ven joined
|
|||
timotimo | i don't think nativecall has big problems with concurrency | 15:45 | |
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 | ||
timotimo | but ideally, our synchronous I/O would bypass libuv completely | ||
15:47
vendethiel joined
|
|||
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 | |
which is just ugh | |||
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 | ||
as in, moar builds a thread dedicated to doing all its async dispatching when the first async i/o thing appears | 15:51 | ||
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:1Actually thrown at: in block <unit> at /tmp/lNxgIKSirP:1» | ||
15:58
rindolf joined
|
|||
BenGoldberg | Odd error message, that. | 15:58 | |
15:59
^elyse^ joined
|
|||
psch | m: say A::B::C | 15:59 | |
camelia | rakudo-moar 23ccdc: OUTPUT«Could not find symbol '&C' in block <unit> at /tmp/SaBVCqy9xE:1Actually thrown at: in block <unit> at /tmp/SaBVCqy9xE:1» | ||
psch | not sure if that should complain about every not-found level | 16:00 | |
or if it could, even | |||
16:02
s_kilk left,
Akagi201 joined
16:03
riatre_ is now known as riatre,
tokuhirom_ joined
16:05
Ven left
16:08
tokuhirom_ left,
tokuhiro_ joined
16:13
Ven joined,
tokuhiro_ left
16:15
Akagi201 left
16:16
rurban left
16:18
rurban joined
16:21
Ven left
16:24
weihan left,
Zoffix left
16:25
^elyse^ left
16:26
Ven joined
|
|||
moritz | the error message would be better if it complained about the full name, IMHO | 16:30 | |
cxreg2 | I've been thinking about blogs.perl.org/users/pawel_bbkr_pab...read.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:31 | |
seems like maybe not something every programmer should need to be aware of; at least then you just get slow instead of crashing | 16:32 | ||
16:34
Hor|zon joined,
cxreg2 is now known as cxreg
16:35
Ven left
16:36
ptarmigan999 joined
16:37
gtodd joined
|
|||
cxreg | I'm referring to the scheduling work performed by start/await, not something the program would do explicitly | 16:37 | |
16:37
Ven joined
16:38
^elyse^ joined
16:39
Hor|zon left
|
|||
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:39 | |
The existing code used: say .<Name> for $xml.nodes.grep(*.name eq 'Student') | 16:40 | ||
I've tried varlations like say .<Name> for $xml.nodes.grep((*.WHAT.perl eq 'XML::Element') and (*.name eq 'Student')) and | |||
$xml.nodes.grep(*.WHAT.perl eq 'XML::Element').grep(.name eq 'Student') - with and without the '*' - what's the correct syntax to use? | 16:41 | ||
colomon | ptarmigan999: If you have two *s in whatever code, you’re declaring a block that takes two arguments. | 16:42 | |
you could do it with two grep statements: .grep(*.WHAT.perl eq 'XML::Element’).grep(*.name eq 'Student’)) | 16:43 | ||
or you could rewrite it with brackets: .grep({ $_.WHAT.perl eq ‘XML::Element’ && $_.name eq ‘Student’) | |||
whoops, forgot closing bracket | 16:44 | ||
or you could rewrite it with brackets: .grep({ $_.WHAT.perl eq ‘XML::Element’ && $_.name eq ‘Student’}) | |||
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? | ||
colomon | hmmm, seems like a less than awesome error message. | ||
yes $^a would work, but it would also need { } | 16:46 | ||
so there’s no real advantage to using $^a instead of $_ if you only want one arg | |||
16:46
gtodd left
|
|||
psch | m: say ^10 .grep: (* %% 2 && * > 4) | 16:47 | |
camelia | rakudo-moar 23ccdc: OUTPUT«(5 6 7 8 9)» | ||
colomon | (unless you also need $_ for something else in the block!) | ||
psch | m: say ^10 .grep: { $^a %% 2 && $a > 4} | ||
camelia | rakudo-moar 23ccdc: OUTPUT«(6 8)» | ||
psch | curious how it uses the second Whatever | 16:48 | |
colomon | psch: think of the simpler * + * | ||
psch | m: say (* + *)(2, -5) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«-3» | ||
psch | vOv | ||
stupid transitive property :) | |||
colomon | that said, I have no idea how (* %% 2 && * > 4) is working up there. | ||
psch | wait, that's not transitive, is it..? | 16:49 | |
no, it's cumutative.. | |||
colomon | m: (^10).grep(*.say && *.say) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/mYAs7o_UzQUnable 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 …» | ||
timotimo | m: say ^10.grep: (*.say && *.say) | ||
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)100..^1» | ||
timotimo | m: say ^10 .grep: (*.say && *.say) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«0123456789(0 1 2 3 4 5 6 7 8 9)» | ||
psch | m: say (* / *)(0, 5) | 16:50 | |
timotimo | m: ^10 .grep: (*.say && *.say) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«0» | ||
rakudo-moar 23ccdc: OUTPUT«0123456789» | |||
colomon | wait a minute... | ||
m: say (^10).grep(* + * > 5) | 16:51 | ||
camelia | rakudo-moar 23ccdc: OUTPUT«((4 5) (6 7) (8 9))» | ||
colomon | m: say (^10).grep(* + * > 9) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«((6 7) (8 9))» | ||
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 | ||
psch | ptarmigan999: that looks like a bad quote character | ||
*.WHAT.perl eq 'XML::Element’ | 16:52 | ||
ptarmigan999 | sorry - cut'n paste error | ||
timotimo | m: say 'Student’ | ||
camelia | rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/p2U4MGUrsDUnable 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…» | ||
timotimo | m: say 'Student' | ||
camelia | rakudo-moar 23ccdc: OUTPUT«Student» | ||
timotimo | m: say ‘Student’ | ||
camelia | rakudo-moar 23ccdc: OUTPUT«Student» | ||
timotimo | m: say ‚Student‘ | ||
camelia | rakudo-moar 23ccdc: OUTPUT«Student» | ||
timotimo | the smartest of quotes on these students | ||
16:53
pmurias_ joined
|
|||
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 ' | ||
psch | m: say uniname("‚") | ||
camelia | rakudo-moar 23ccdc: OUTPUT«SINGLE LOW-9 QUOTATION MARK» | ||
psch | m: say uniname(",") | ||
camelia | rakudo-moar 23ccdc: OUTPUT«COMMA» | ||
psch | they look the same here vOv | ||
psch might need a better font... | |||
timotimo | :D | ||
ptarmigan999 | corrected quotes and back to 'Bool as Matcher' error | ||
timotimo | oh! | 16:55 | |
*.WHAT doesn't work | |||
you really want to just use "XML::Element" as the matcher | |||
m: say *.WHAT | |||
camelia | rakudo-moar 23ccdc: OUTPUT«(Whatever)» | ||
timotimo | m: say (*.WHAT eq 'String') | ||
camelia | rakudo-moar 23ccdc: OUTPUT«Use of uninitialized value of type Whatever in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/C5Qw4JHLbO:1False» | ||
colomon | oh, sorry, I should have caught that | ||
ptarmigan999 | let me retype from scratch and double check | ||
timotimo | type checking is best done with ~~ | ||
psch | m: say (5, "5", 10, "10").grep(Int).grep(* > 5) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«(10)» | ||
timotimo | and grep does ~~ "under the hood" for you | ||
colomon | Think you want * ~~ XML::Element | ||
16:56
pmurias left
|
|||
timotimo | colomon: that's the exact same as just XML::Element in this case | 16:56 | |
m: say (* ~~ Bool) | |||
camelia | rakudo-moar 23ccdc: OUTPUT«WhateverCode.new» | ||
colomon | timotimo: good point. :) | ||
timotimo | m: say (True, False, "FileNotFound").grep(* ~~ Bool). | ||
camelia | rakudo-moar 23ccdc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_RhMv21qgeMissing required term after infixat /tmp/_RhMv21qge:1------> 3 False, "FileNotFound").grep(* ~~ Bool).7⏏5<EOL> expecting any of: dotty method or postfix» | ||
timotimo | m: say (True, False, "FileNotFound").grep(* ~~ Bool) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«(True False)» | ||
timotimo | m: say (True, False, "FileNotFound").grep(Bool) | ||
camelia | rakudo-moar 23ccdc: OUTPUT«(True False)» | ||
psch | hrm | 16:57 | |
so i added debug output to Ops.setobjsc to print the typeName for non-concrete objects during setting compilation | 16:58 | ||
and apparently that gets called three times for Attribute | |||
and 11 times for Attribute:D | 16:59 | ||
but hey, it also gets called lots for e.g. Int | |||
but it shouldn't get called for non-concrete objects at all, from what i remember jnthn++ saying on this | |||
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:00 | ||
well, and low-level too of course | 17:01 | ||
timotimo | hm, could that be about "compile time evaluate" and WVals perhaps? | ||
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:03 | |
hm, maybe the isconcrete check doesn't actually do enough in setobjsc..? | 17:04 | ||
i mean, Perl6::World.scalar_wrap adds the object to the SC and then binds a value | |||
does that already make the Scalar concrete? | 17:05 | ||
ptarmigan999 | colomon/timotimo: thanks. ~~ XML::Element works :) | ||
17:06
cognominal left,
softmoth joined
|
|||
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? | ||
leont | How do I get the information that I actually want? | ||
17:07
llfourn left
|
|||
leont | As in, actual line number and more information | 17:07 | |
timotimo | leont: sometimes running perl6 with --ll-exception gives you a bit more | 17:08 | |
17:08
ptarmigan999 left
|
|||
leont | Tried that already, it wan't helpful. It gave the $promise.result location instead of the actual source | 17:08 | |
timotimo | oh, that means we're losing the original exception there? | 17:10 | |
that place would ideally have only a rethrow-like thing in there | |||
leont | I think so, I've seen this happen before | 17:11 | |
17:12
Akagi201 joined
|
|||
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 | ||
as a work-around, you can put a CATCH { .say } into the start block | 17:13 | ||
but i realize that sucks | |||
17:18
Akagi201 left
|
|||
leont | Yeah that does help | 17:19 | |
timotimo | oops. rebuilding nqp now even though the only changes were in js-related parts | 17:21 | |
psch | timotimo: adding a decont gives me the same numbers | 17:24 | |
17:24
firstdayonthejob left
|
|||
timotimo | hum. | 17:25 | |
17:35
Hor|zon joined
17:37
Ven left
17:38
Ven joined,
softmoth left
17:39
Hor|zon left,
zakharyas left
17:40
tokuhirom_ joined
17:44
zakharyas joined,
tokuhirom_ left
17:49
kaare_ left
|
|||
pmurias_ | psch: what do you want to know about SCs? | 17:50 | |
17:50
pmurias_ is now known as pmurias,
Ven left
|
|||
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... | ||
pmurias: the background is that we have a problem on jvm, with repossession apparently | |||
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:52 | ||
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:53 | ||
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 | ||
17:54
Ven joined
|
|||
pmurias | once serialized the SC holds the state of a bunch of objects at the point of serialization | 17:55 | |
repossession allows changing the object and then storing it somewhere else | |||
(I haven't yet reimplemented repossesion so I'm that familiar with the tiny details of that) | 17:56 | ||
psch: repossesion happens when the object is change (the objects are transfered to the currently compiled sc) | 18:01 | ||
psch: this can be disabled (which is done when doing stuff like setting temporary caches at stuff) | |||
colomon | CurtisOvidPoe: I just built panda without issue on OS X. | 18:02 | |
CurtisOvidPoe | colomon: I’ve found that if fails if it’s | 18:03 | |
18:03
margeas left
|
|||
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) | ||
psch: in SerializationContext.java | 18:04 | ||
colomon | CurtisOvidPoe: ah. I don’t think I have PERL5LIB set to anything | ||
psch | pmurias: but to check if i have an Attribute or not i need the TC, don't i? | ||
CurtisOvidPoe | Yeah, it’s a handy shortcut I use, but it bit me here. | ||
psch | (well, at least Ops.typeName needs the TC, and i don't know how to identify a specific type otherwise...) | 18:05 | |
18:05
mrsolo joined
18:06
Ven left,
kaare_ joined
18:07
eliasr left,
Ven joined
|
|||
pmurias | psch: hook into scwbObject | 18:08 | |
it's the only place that calls repossesObject and there is a thread context there | |||
psch | pmurias: yeah, i did that a few days ago. it doesn't show any calls for Attribute where isconcrete isn't 1 | ||
DrForr | seen BooK | ||
psch | pmurias: which means there's no actual repossession of the Attribute type object happening, afaiu | 18:09 | |
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
|
|||
psch | well, it happens for pretty much everything, from the looks of it... | 18:11 | |
18:11
diana_olhovik_ left
|
|||
psch | i'll add printing the description there, that probably adds some information... :) | 18:12 | |
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:13 | |
18:14
Akagi201 joined
18:15
rbk_ joined
|
|||
pmurias | psch: and there is an add_object_if_no_sc in places where we aren't sure | 18:15 | |
(in Perl6::World) | |||
18:15
tokuhiro_ left,
rbk_ left
18:18
Ven left
18:19
Akagi201 left
18:22
diana_olhovik joined
|
|||
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 | |
18:25
gtodd joined
|
|||
psch | but as mentioned, similar things happen for pretty much every other type object | 18:25 | |
18:27
diana_olhovik left
|
|||
colomon | Could not download module metadata: No such method 'host' for invocant of type 'HTTP::Request' | 18:31 | |
in method update at /home/colomon/.rakudobrew/moar-nom/install/share/perl6/site/lib/Panda/Ecosystem.pm:110 | |||
: | |||
18:31
gtodd left
|
|||
colomon | :/ | 18:31 | |
pmurias | psch: how does the problem manifest (with the typeobject being "repossessed" manifest) itself when running Perl 6 code? | 18:32 | |
18:36
Hor|zon joined
|
|||
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
|
|||
psch | pmurias: github.com/perl6/nqp/blob/master/s...e.java#L17 we have to compare STables here, instead of classHandle identity | 18:39 | |
pmurias: that line should just read "if (rd.classHandles[i] == classHandle) {", and that's what moar does | |||
pmurias: but on jvm we get CORE on the LHS and BOOTSTRAP on the RHS when trying to instantiate an Attribute | 18:40 | ||
for the SC that is | |||
18:41
Hor|zon left
|
|||
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:41 | |
pmurias | psch: how can I reproduce the error? | 18:43 | |
psch | pmurias: just remove ".st" in the linked line in nqp, build nqp, then build rakudo | 18:44 | |
pmurias: doing so will die with 'No such attribute "$!name" ...' during NativeCall.pm | |||
18:46
gtodd left
18:47
gtodd joined
18:48
gtodd left
18:52
vendethiel left
18:53
xfix joined
18:55
cognominal joined
|
|||
dalek | kudo/nom: ebd36d9 | lizmat++ | src/core/Supply.pm: Emit status at end if status supply given |
18:56 | |
18:58
Ven joined
19:04
llfourn joined
|
|||
ugexe | can you apply Actions to an existing Match? | 19:05 | |
19:06
Ven left
19:09
llfourn left
19:13
virtualsue joined,
gonz_ left
19:15
Akagi201 joined
19:17
Ven joined
19:19
yuval_dsfdsgdf joined
19:21
Ven left
19:22
Akagi201 left,
domidumont left
19:26
Ven joined
19:34
virtualsue left
|
|||
moritz | ugexe: you can call action methods manually | 19:35 | |
$obj.method($/) | |||
and that method can call $/.made or $/.ast | |||
but there is no mechanism for retroactively calling all action methods | 19:36 | ||
19:36
Ven left
19:37
Hor|zon joined
|
|||
lizmat | m: await start -> $i { say "foo" } # probably another error going into oblivion :-( | 19:37 | |
camelia | ( no output ) | ||
moritz | though something like for $/.hash.keys -> $method { $actions."$method"($/) if $actions.^can($method) }; might do the trick | ||
lizmat | m: await start { say "foo" } | ||
camelia | rakudo-moar ebd36d: OUTPUT«foo» | ||
19:41
Hor|zon left
19:42
virtualsue joined
|
|||
dalek | c: 963bb01 | moritz++ | doc/Type/DateTime.pod: Fix typo. Closes #168 |
19:42 | |
19:43
kjs_ left
|
|||
dalek | kudo/nom: 77e76ae | lizmat++ | src/core/Promise.pm: Pass any extra parameters with Promise.start |
19:45 | |
19:45
Ven joined
19:51
Ven left
19:54
vendethiel joined
|
|||
dalek | pan style="color: #395be5">perl6-examples: 1b1e29e | moritz++ | categories/games/wizard.pl: Remove wizard.pl it does not work. And probably never did. Closes #33, though probably not as intended |
19:55 | |
c: 5e82274 | (Steve Mynott)++ | doc/Language/faq.pod: fix some typos |
20:02 | ||
20:04
llfourn joined,
BenGoldberg left
20:06
adhoc joined
20:07
zakharyas left
20:08
yuval_dsfdsgdf left
20:09
llfourn left
|
|||
moritz | wow, I still had .pir files in my checkout of DBIish | 20:11 | |
tadzik | :) | 20:12 | |
20:12
tokuhiro_ joined
|
|||
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:12 | |
20:16
tokuhiro_ left
20:18
Akagi201 joined
20:20
darutoko left
|
|||
moritz | ok, API design question | 20:20 | |
I've been thinking a bit about DBIish | 20:21 | ||
and the archaic way we still do a while my @row = $sth.fetchrow { ... } | |||
so I thought instead it should look like | |||
for $sth.rows -> @row { } | 20:22 | ||
and possibly | |||
for $sth.rows(:hash) -> %row { } | |||
lizmat | moritz: did you consider a $sth.supply ? | ||
moritz | lizmat: no; I'm try to come up with a sane synchronous API first :-) | 20:23 | |
*trying | |||
lizmat | afaik, db engines such as MySQL are capable of streaming result sets per record, which would match suppies :-) | ||
ok | |||
moritz | so, if one only executes a query once, an even nicer API would be for $dbh.select($sql, |@placeholders) -> $row { } | 20:24 | |
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:25
Akagi201 left
|
|||
lizmat | perhaps metacpan.org/pod/DBIx::Simple can be of inspiration ? | 20:26 | |
Juerd | Whoaaa | ||
moritz | nine: worth considering | ||
Juerd | I still have a highlight on that :) | ||
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 | ||
awwaiid | thelackthereof.org/TLT/2015.10.18/M...l6_Grammar -- perl6 blog post | 20:27 | |
flussence realises postgresql's NOTIFY statement is a perfect fit for p6 supplies... but that's jumping the gun a bit :) | 20:30 | ||
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:33 | |
flussence: ... though the docs on LISTEN and NOTIFY seem to be rather sparse :( | 20:34 | ||
it seems we'd have to pull for results in a thread | 20:35 | ||
threads and C libraries... I forsee a lot of fun | |||
moritz stays with the synchronous API | 20:36 | ||
20:38
Hor|zon joined
20:40
firstdayonthejob joined
|
|||
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:42 | |
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:43
xfix left,
Hor|zon left
20:44
FireFly left
20:45
bjz_ left
20:46
boggard left
|
|||
leont thinks lazy lists would make more sense to most people than supplies most of the time | 20:47 | ||
20:47
boggard joined
|
|||
leont | (re databases) | 20:47 | |
20:51
kaare_ left,
kaare_ joined
|
|||
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:52 | |
(though I don't miss the horrible fetch-directly-into-object "feature") | 20:55 | ||
20:56
kaare_ left
21:05
bjz joined
21:07
AlexDaniel joined
21:09
pippo joined
|
|||
pippo | o/ #perl6 | 21:11 | |
21:11
bjz left
|
|||
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)» | ||
pippo | m: my @a = ^3; say @a[0..1,2].perl; say @a[0,1,2].perl; | ||
camelia | rakudo-moar 77e76a: OUTPUT«((0, 1), 2)(0, 1, 2)» | ||
pippo | ^^Is it correct to have them different? | 21:12 | |
21:13
bjz joined
|
|||
pink_mist | m: my @a = ^3; say @a[(0..1,2).flat].perl; | 21:14 | |
camelia | rakudo-moar 77e76a: OUTPUT«(0, 1, 2)» | ||
pink_mist | if you want the flattened list, you need to be explicit | ||
pippo | pink_mist: is it something intended to be like that? | 21:15 | |
pink_mist | afaik yes | ||
pippo | pink_mist: OK. thank you. | 21:16 | |
21:16
bjz left,
bjz joined
|
|||
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)» | ||
pippo | m: my @a = ^3; say @a[|(0..1),2].perl; say @a[0,1,2].perl; | ||
camelia | rakudo-moar 77e76a: OUTPUT«(0, 1, 2)(0, 1, 2)» | ||
pippo | m: my @a = ^3; say @a[|^2,2].perl; say @a[0,1,2].perl; | ||
camelia | rakudo-moar 77e76a: OUTPUT«(0, 1, 2)(0, 1, 2)» | ||
pippo | :-| | 21:18 | |
o/ | |||
21:18
pippo left
21:21
Akagi201 joined
21:26
aindilis left
21:28
Akagi201 left,
bjz left
21:34
gonz_ joined
21:36
bjz joined
21:37
bjz left
|
|||
dalek | kudo/nom: fc1ef69 | lizmat++ | src/core/Supply.pm: Implement Supply.throttle for Callables If the second positional parameter to Supply.throttle is a Callable, it is assumed to be a block to be executed asynchronously restrained to the limit given. This basically reduces the asynchronous image resizer example in jnthn.net/papers/2014-yapceu-async.pdf to: @worklist.Supply.throttle(PARALLEL_RESIZE,&resizer-one).wait |
21:37 | |
21:39
Hor|zon joined
|
|||
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 | |
instead of a Promise that is kept for the next emitted values ? | |||
*value | |||
21:41
tokuhirom_ joined
21:44
Hor|zon left
21:46
tokuhirom_ left
|
|||
leont | Wait, what? | 21:50 | |
That doesn't sounds logical at all | |||
lizmat | .oO( I was already waiting for 10 mins) |
||
what doesn't? the current behaviour, or the proposed behaviour ? | 21:51 | ||
21:51
vendethiel left
21:52
_28_ria left
21:55
_28_ria joined
|
|||
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 | ||
the thing is: that waits and *then* returns the result of an internal Promise | 21:57 | ||
I was just thinking it would be nice to use "await" for Supplies as well | |||
await $promise, $supply.Promise, etc... | |||
and/or even have await() auto-coerce to Promise | 21:58 | ||
22:00
pmurias left
22:05
llfourn joined
22:06
^elyse^ left,
virtualsue left
|
|||
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 | ( no output ) | ||
RabidGravy | or will the if under no circumstance change the topic for the inner whens? | 22:09 | |
22:10
rindolf left
22:11
llfourn left
22:14
tokuhiro_ joined
22:15
vike left
22:17
vike joined
22:18
tokuhiro_ left
22:21
Grrrr left
22:24
Akagi201 joined
|
|||
hartenfels | RabidGravy if will only change your topic if you tell it to do so explicitly | 22:24 | |
See my $a = True; given "boo" { when "bar" { say "bar"; }; if !$a { when "boo" { say "boo" } } }; | |||
22:24
rurban left
|
|||
hartenfels | Oops | 22:24 | |
doc.perl6.org/language/control#if | 22:25 | ||
22:26
Grrrr joined
|
|||
hartenfels | Disregard the code, that was the wrong paste buffer. | 22:26 | |
22:27
RabidGravy left
22:31
Akagi201 left
22:37
atweiden joined,
atweiden left,
atweiden joined
22:40
Hor|zon joined
|
|||
atweiden | with NativeCall, can a ulonglong return a negative number? | 22:40 | |
be* | |||
i ask because it's happening here github.com/atweiden/digest-xxhash/.../xxHash.pm | 22:42 | ||
pink_mist | iirc I heard something about unsigned nativecall stuff not being implemented yet | ||
but I don't quite recall when or in what context | 22:43 | ||
22:45
TEttinger joined,
Hor|zon left
|
|||
pink_mist | a search through the last few weeks of the irc log would probably find it | 22:46 | |
23:02
AndyDee joined
23:03
firstdayonthejob left
23:12
tokuhirom_ joined
23:14
tokuhiro_ joined
|
|||
dalek | kudo/nom: 3ac9491 | lizmat++ | docs/ChangeLog: Some more ChangeLog additions |
23:14 | |
kudo/nom: 2819ea2 | lizmat++ | src/core/Supply.pm: Implement Supply.await Like Supply.wait, but instead returns the Promise, instead of blocking for the Promise to be kept/broken and then return the result. |
|||
kudo/nom: fae01fb | lizmat++ | src/core/asyncops.pm: await $supply works, can mix with Promise/Channel Because it will now call $supply.await. This may need some further discussions. To *me*, this feels like the natural thing, since Supplies have their handling normally somewhere else anyway. If this is consensed to be a bad idea, then maybe it should not call await, but the Promise method instead. |
|||
Heuristic branch merge: pushed 55 commits to rakudo/curli by lizmat | 23:15 | ||
lizmat | and on that note,I wish #perl6 a good night! | 23:16 | |
23:16
tokuhirom_ left
23:19
tokuhiro_ left
23:27
Akagi201 joined
23:34
Akagi201 left
|
|||
timotimo | huh, "await" as the method name seems strange to me | 23:34 | |
i'd rather expect .Promise or so? | 23:35 | ||
masak | morning, #perl6 | 23:39 | |
masak grins | 23:40 | ||
23:41
Hor|zon joined
23:46
Hor|zon left
23:47
BenGoldberg joined
23:48
captain-adequate left
23:53
[Sno] left
23:59
uucpp joined
|