»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
grondilu do you think one day a private rocket will use Perl6 code on board? ;) 00:08
sorear depends on how you define "use" 00:18
for hard-real-time high-assurance avionics, there will likely always be better choices 00:19
grondilu at least for simulation, it will be cool to use a high level language such as Perl6. 00:21
use Rocket; my Rocket $falcon .= new; wait 9* 1min and $falcon.take-off; # :) 00:28
colomon grondilu: shoot, forgot about the launch and washed the dishes instead of watching! 00:48
cognominal r: say CORE.WHO.keys 02:44
p6eval rakudo 870d18: OUTPUT«&undefine &prefix:<temp> &prefix:<let> &INDIRECT_NAME_LOOKUP &REQUIRE_IMPORT &METAOP_ASSIGN &METAOP_TEST_ASSIGN:<//> &METAOP_TEST_ASSIGN:<||> &METAOP_TEST_ASSIGN:<&&> &METAOP_NEGATE &METAOP_REVERSE &METAOP_CROSS &METAOP_ZIP &METAOP_REDUCE_LEFT &METAOP_REDUCE_RIGHT …
cognominal typing it twice at the prompt on two different lines gives : Nominal type check failed for parameter '$got'; expected Any but got Perl6::Metamodel::ContainerDescriptor instead 02:47
moritz good morning 05:47
sorear o/ 05:54
moritz \o 05:59
jnthn morning o/ 06:04
sorear jnthn! 06:13
\o/
jnthn hi sorear :) 06:24
mathw good morning! 07:15
brrt morning 07:16
kresike good morning all you happy perl6 people 08:09
tadzik mornings 08:10
sorear o/ 08:13
brrt \o sorear 08:14
mathw o/ 08:36
cognominal_ r: my ($a, $b) = <1..3>; say $b 13:32
p6eval rakudo 870d18: OUTPUT«Nil␤»
cognominal_ r: my ($a, *, $b) = <1..3>; say $b 13:33
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤Malformed parameter␤at /tmp/36wzfNvY3y:1␤»
cognominal_ r: my ($a, $, $b) = <1..3>; say $b
p6eval rakudo 870d18: OUTPUT«Nil␤»
[Coke] r: my ($a, *, $b) = 1, 2, 3; say $b 13:33
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤Malformed parameter␤at /tmp/fbNSL0dXdM:1␤»
[Coke] r: my ($a, $b) = 1, 2, 3; say $b 13:34
p6eval rakudo 870d18: OUTPUT«2␤»
cognominal_ I expected a list context. For the $ versus *, I am not too sure if the doc is a fossil or if the implementation is wrong
masak the former, methinks. 13:36
phenny masak: 04 Oct 20:54Z <sorear> tell masak possible rakudobugs, "r: .++" and "r: $_.++"; STD is fine with both; are they known?
masak: 04 Oct 20:55Z <sorear> tell masak well, rakudobugs for sure, possibly *new*
moritz huh, it is a list context
erm wait, I might be looking at the wrong line of output right now 13:37
cognominal_ oops, I should have chosen betwen <1 2 3> and 1..3 # silly me
brainfart
[Coke] my ($a, $, $b) = (<1..3>); say $b; 13:38
r: my ($a, $, $b) = (<1..3>); say $b;
p6eval rakudo 870d18: OUTPUT«Nil␤»
[Coke] r: my ($a, $, $b) = <1..3>.list; say $b;
p6eval rakudo 870d18: OUTPUT«Nil␤»
masak sorear: I'm on vacation and not likely to submit rakudobugs this week ;) 13:39
cognominal_ funny how mind automatisms work, apparently I could not choose between the two, so I choosed both, which wrong :)
masak or even swap in my extensive knowledge about what's submitted and what isn't... :P
cognominal_ I should compile my errors, I will probably learn a lot about my thought processes when going wrong 13:41
S)2: Outside of declarative constructs you may use C<*> for a placeholder:
I don't see the benefit 13:42
diakopter hm, I wonder whether I have $work today 14:13
kresike bye folks 15:12
sirrobert hi p6 15:27
phenny sirrobert: 05 Oct 21:27Z <raiph> tell sirrobert expected Blah but got Blah: irclog.perlgeek.de/perl6/2012-03-01 discussion starts at 15:30
masak what does 5) mean under S05/Overview? could someone give an example? 15:55
PerlPilot masak: irclog.perlgeek.de/perl6/2010-05-05#i_2296683 might help :) 16:36
phenny PerlPilot: 28 Apr 13:49Z <tadzik> tell PerlPilot I've sent you a pull request for Benchmark.pm
PerlJam phenny: you have a long memory :) 16:37
tadzik wow :D 17:37
that was before I knew PerlJam is PerlPilot :) 17:38
[Coke] I am bemused that we are all hacking on #perl6, but still use IRC. 18:03
tadzik why is that surprising? 18:04
sorear masak: Nobody knows.
[Coke] irc is like the perl3 of chat. 18:05
doy what would you suggest as a replacement? 18:06
jnthn MSN Messenger!
PerlJam [Coke]: as soon as we get that telepathic link up and running, we can all join TIC (telepathic internet chat)
jnthn
.oO( The PHP of chat... )
[Coke] doy: my preference would be xmpp. 18:08
rjbs doesn't know of any xmpp clients half as useful as irssi. 18:09
(Not that I need a vote in this, since I only show up to tell Coke to play D&D or to ask very basic questions.)
[Coke] rjbs: dammit! I do want to play, really! 18:10
(that dammit was to me, not you!)
rjbs [Coke]: :-) Saturday!
[Coke] rjbs: ironically? I've been playing a lot of skyrim lately.
tadzik [Coke]: I guess the irc is just good enough, and xmpp doesn't really have any real advantage
[Coke] actually, I do play skyrim ironically. Just to be hip.
sirrobert does xmpp allow persistent channels? that can be joined without invite? 18:11
tadzik yes
sirrobert I didn't know that
tadzik one big cons: you need an xmpp account to join xmpp chat
sirrobert what's it called?
tadzik: ahh
tadzik I don't know if it's called anything
I guess it's just MUC
sirrobert just did a search for it but didn't know how to search for it =)
[Coke] tadzik: yah, that's not a con.
sirrobert xmpp channel
tadzik oh yes it is
"hey guys, move to this service. It serves the same purpose, but you need an account" 18:12
[Coke] for guests? sure. For you and I? no it isn't. But you can allow guests.
tadzik: I /already/ need an account to use freenode.
tadzik well, you get persistent identities on xmpp
doy rjbs: "bitlbee"
tadzik on irc we work around that, which is imperfect
[Coke] tadzik: which, IMO, is a big enough reason to switch. But I am clearly outvoted, so the discussion is moot. 18:13
doy [Coke]: you don't, really... it just whines at you a lot if you don't have one
(:
tadzik [Coke]: well, I'm quite a fan of xmpp myself
rjbs doy: Hm. I 've used that, but never for chat rooms on xmpp. Hm.
doy rjbs: i've never tried it with xmpp chat rooms, actually
but it works fine for normal xmpp messages
tadzik [Coke]: I guess the big win is that it's easier to bring people in to irc 18:14
just "hey, click here and you're online"
[Coke] tadzik: you can do the same with xmpp web chat, IIRC. 18:15
tadzik [Coke]: is it possible to communicate on xmpp without an account?
[Coke] tadzik: I believe so, yes.
tadzik curious :)
[Coke] let's assume it is: no one is switching, it's moot. :) 18:16
tadzik is that specified in some XEP?
[Coke] stops talking about it because it's just depressing.
tadzik now that you got me interested? You cruel person :)
tadzik goes to look at xmpp specs 18:17
[Coke] chuckles. 18:22
moritz somebody[tm] could write a Perl 6 wrapper around libpurple (the IM lib that pidgin and some other clients ues) 18:23
*use
tadzik hm 18:24
I used loudmouth for clients I wrote, but it is absolutely horrible :)
or maybe just horribly undermaintained 18:25
moritz I've used none of those directly myself, from the usage patterns I just assumed that libpurple was a quasi-standard
tadzik I think telepathy is now a go-to thing 18:26
but maybe not :)
timotimo_ you can communicate on xmpp without accounts. it's how zeroconf chatting works 18:28
tadzik cool
do you have any technical links I could read?
timotimo_ but i don't think you can get onto the federated network like that
xmpp.org/extensions/xep-0174.html 18:29
tadzik oh, nice
[Coke] timotimo++ 18:40
it has been a LONG time since I've read any xeps.
flussence found this sub-thread interesting, wondering how it'd go in p6; www.reddit.com/r/programming/commen...?context=2 18:43
(and then I invariably ended up wondering what the heck andthen/orelse are used for...)
arnsholt How attached can I expect people to be to S21 (Calling foreign code)?
flussence arnsholt: meh, I've rewritten my code entirely once already, don't care :) 18:44
PerlJam arnsholt: Why do you ask?
sirrobert fluessence: a tabular return is appropriate there. P6 may have some more terse syntax, though 18:45
arnsholt I was going to spec the interface provided by NativeCall
jnthn arnsholt: Go for it, imho
flussence after actually looking at S21, +1 18:46
arnsholt Cool
PerlJam arnsholt: what they said :)
jnthn S21 is...basically empty
arnsholt I think I'll kill most of the stuff that's there, and relegate Perl 5 interop to a "how do we want this to work?" section
[Coke] jnthn: minor ping on nqp#59 18:55
brrt p6: sub foo(|@args) { say @args.elems }; foo(1,2,3) 19:05
p6eval rakudo 870d18: OUTPUT«Obsolete use of | or \ with sigil on param @args␤Nominal type check failed for parameter '@args'; expected Positional but got Capture instead␤ in sub foo at /tmp/O9vIfrbjoT:1␤ in block at /tmp/O9vIfrbjoT:1␤␤»
..niecza v22-7-g7df6137: OUTPUT«Potential difficulties:␤ Unsupported use of | with sigil; nowadays please use | without sigil at /tmp/siNhJ8TWqb line 1:␤------> sub foo(|@args⏏) { say @args.elems }; foo(1,2,3)␤␤3␤»
brrt p6: sub foo(|args) { say |args.elems }; foo(1,2,3)
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Unable to resolve method Capture in type Int␤ at /tmp/QyvKey6_jK line 1 (foo @ 5) ␤ at /tmp/QyvKey6_jK line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting li… 19:06
..rakudo 870d18: OUTPUT«3␤»
brrt how does this work?
also
p6: sub foo(|args) { say |args.elems }; foo(1, (2, 3), 4) 19:07
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Unable to resolve method Capture in type Int␤ at /tmp/W4WMGkEMDr line 1 (foo @ 5) ␤ at /tmp/W4WMGkEMDr line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting li…
..rakudo 870d18: OUTPUT«3␤»
sirrobert sub foo (@args) { say @args }; foo(|@args);
r: sub foo (@args) { say @args }; foo(|@args);
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤Variable @args is not declared␤at /tmp/gTChAFUuwY:1␤»
brrt in short
sirrobert r: sub foo (@args) { say @args }; my @args = 1,2,3; foo(|@args);
p6eval rakudo 870d18: OUTPUT«Nominal type check failed for parameter '@args'; expected Positional but got Int instead␤ in sub foo at /tmp/JQFsT8Ry9n:1␤ in block at /tmp/JQFsT8Ry9n:1␤␤»
brrt does perl 6 do callee side argument flattening
sirrobert yeah, you flatten when you call
not in the method sig (I'm pretty sure)
brrt yeah, thats caller side
usually 19:08
i'm wondering about callee-side
sirrobert ohh
sorry, dunno
brrt believes it is possible, and it has quite large implications 19:09
sirrobert r: sub test ($foo, |@bar) { say $foo; say @bar.perl }; test(1,2,3,4); 19:10
p6eval rakudo 870d18: OUTPUT«Obsolete use of | or \ with sigil on param @bar␤Nominal type check failed for parameter '@bar'; expected Positional but got Capture instead␤ in sub test at /tmp/y0Vhb0RrTd:1␤ in block at /tmp/y0Vhb0RrTd:1␤␤»
sirrobert r: sub test ($foo, *@bar) { say $foo; say @bar.perl }; test(1,2,3,4); 19:11
p6eval rakudo 870d18: OUTPUT«1␤Array.new(2, 3, 4)␤»
sirrobert Is that what you wanted?
brrt i knew that was possible :-) i'm wondering about the following case
r: sub text
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤Missing block␤at /tmp/CF3GOj6Zvl:1␤»
brrt r: sub test($foo, *@bar) { say $foo; say @bar.perl }; test(1, 2, (3, 4)) 19:12
p6eval rakudo 870d18: OUTPUT«1␤Array.new(2, 3, 4)␤»
brrt damn you, perl6
sirrobert I know what you mean:
brrt back to the drawing board, it is
sirrobert r: sub test($foo, *@bar) { say $foo; say @bar.perl }; test(1, 2, [3, 4])
p6eval rakudo 870d18: OUTPUT«1␤Array.new(2, [3, 4])␤»
sirrobert right? 19:13
you want to flatten that?
brrt yes
or, more properly
i want to know if perl6 will /allow/ flattening it
and, considering the 2, (3, 4) example, i'm guessing that it is
jnthn r: sub test($foo, *@bar) { say $foo; say @bar.perl }; test(1, 2, (3, 4)) 19:14
p6eval rakudo 870d18: OUTPUT«1␤Array.new(2, 3, 4)␤»
jnthn r: sub test($foo, **@bar) { say $foo; say @bar.perl }; test(1, 2, (3, 4))
p6eval rakudo 870d18: OUTPUT«1␤LoL.new(2, $(3, 4))␤»
sirrobert brrt, I think you have to flatten on the caller side for that. 19:14
jnthn Dunno if that's what you're looking for
brrt yeah, pretty much
jnthn: this means that a callee must be able to flatten the LoL of the caller 19:15
which is a Problem if you wish to implement it 19:16
jnthn doesn't quite see the problem.
brrt great, then you might enlighten me :-) 19:17
jnthn Or vice versa ;)
sirrobert heh
brrt ok, my problem, or challenge, is this
jnthn A LoL preserves parcel structure.
A normal *@foo flattens any flattening things that are passed. 19:18
brrt (keep going please :-))
i wish to design and implement a bytecode that is high-level enough to implement many languages simultaneously and interoperably
i.e., i want to replace parrot
jnthn Note that there's a difference between 19:19
r: sub foo(*@a) { say @a.elems }; my @bar = 1,2,3; foo(@bar)
p6eval rakudo 870d18: OUTPUT«3␤»
jnthn r: sub foo(*@a) { say @a.elems }; foo([1,2,3]) 19:19
p6eval rakudo 870d18: OUTPUT«1␤» 19:20
jnthn The [...] array constructor gives an item
r: sub foo(*@a) { say @a.elems }; my @bar = 1,2,3; foo($@bar) # also
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤Invalid hard reference syntax at line 2, near "@bar) # al"␤»
jnthn er
r: sub foo(*@a) { say @a.elems }; my @bar = 1,2,3; foo($(@bar)) # also
p6eval rakudo 870d18: OUTPUT«1␤»
jnthn More generally, things know if they will flatten or they are meant to be single items and that lives on with them when they are passed. 19:21
(finished now, ask questions if you have 'em :)) 19:22
brrt yes, thanks :-)
ehm, my point was, in general
i had imagined a scheme where things that you want to flatten would provide an iterator 19:23
brrt i.e., a flattened hash would give an iterator for pairs 19:23
a flattened array would give an iterator for its items 19:24
however
if you can have callee-side flattening, this scheme fails
because my intention was to have the interpreter /not/ know which items can flatten 19:25
jnthn If I was building Parrot's calling conventions again, I'd have the flatten thing just set a bit somewhere and leave the callee to figure out what to do
brrt yeah, thats my back-to-the-drawing board plan 19:26
jnthn Rakudo has a custom signature binder, fwiw.
It kinda needs it.
Binding Perl 6 signatures can lead to recursive calls into the binder, for example. 19:27
arnsholt Regarding specs: are there any conventions for including speculations/marginalia into the text?
jnthn arnsholt: I've seen things like (Conjectural: blah blah)
arnsholt I'll go with that for the moment then. Some more experienced spec wrangler can fix it if it's too bad =) 19:28
sirrobert what's the best way to do a method factory? e.g. class A { for <a b c> -> $name { method $name () {...} } }; 19:29
brrt jnthn: if you could read this: github.com/bdw/parakeet/blob/maste...entions.md 19:30
and then tell me where i'm wrong
i'd be delighted
(although you have given me a pretty good idea)
jnthn sirrobert: You should probably do that at BEGIN time 19:31
sirrobert jnthn: hmm... ok
jnthn And use the MOP I guess
r: class A { BEGIN { for <a b c> -> $m { A.HOW.add_method(A, $m, method () { "method $m" }) } } }; say A.a; say A.c; 19:32
p6eval rakudo 870d18: OUTPUT«method a␤method c␤»
jnthn hah, nailed it first time :) 19:33
sirrobert heh nice
thanks
What does BEGIN { ... }mean inside a class declaration?
jnthn Same as it means anywhere else 19:35
"Run this right now"
colomon has a grammar trace which has been running for three hours now...
jnthn o.O 19:36
sirrobert jnthn: ah.. I interpreted it as a different meaning in p5
jnthn cognominal: Is it actually tracing?
colomon jnthn: yes, and my names not cognominal. ;)
jnthn sirrobert: The thing to understand about classes is that as the parser runs over them, it makes a bunch of method calls.
colomon: oops :)
colomon: OK. This is Grammar::Tracer? :) 19:37
colomon jnthn: yes
jnthn It's not hung or messed up?
sirrobert jnthn: ok, will think about that.
jnthn 3 hours is...crazy long.
colomon it's never stopped printing things out. I think it might be in an endless loop of some sort
jnthn Yeah
I mean, it carries overhead compared to the normal un-traced parse but...
...that sounds excessive. 19:38
sirrobert This also works. Why would it be undesirable?
colomon it never came back with a result in a non-traced run, which is why I switched over to traced.
sirrobert r: class A { }; for <a b c> -> $m { A.HOW.add_method(A, $m, method () { "method $m" }) }; say A.a; say A.c;
p6eval rakudo 870d18: OUTPUT«method a␤method c␤»
colomon jnthn: I kind of had a (late) birthday party after I started it, so I haven't been watching it very carefully. It hasn't repeated itself in the last four minutes.... 19:39
jnthn colomon: OK. Maybe tracing really *is* that slow. 19:41
colomon jnthn: it is parsing a 1.3 meg STEP file, so it is doing quite a lot of work. (Just thought to look, and it is 4x longer than the next longest STEP file I've tried to parse, so maybe it's not too surprising it's slow.) 19:43
brrt also, isn't a Pair surprisingly like a cons? 19:46
colomon brrt: ;) 19:49
brrt by the way... is it ever the intention we can 'flatten' an infinite list? 19:50
i.e., what happens now 19:51
r: sub foo(*@args) { say @args[0]; }; my @a = 1..Inf; foo(@a); 19:52
p6eval rakudo 870d18: OUTPUT«1␤»
brrt ... what happens to me now
jnthn But we don't flatten there really 19:53
@args is an Array that contains @a and @a contains the Range and is flattening, so when you ask for @args[0] it asks for @a[0] which produces the first value from the range 19:54
But that's nothing to do with calling conventions.
Well, the creation of the outer Array for @args is I guess
brrt basically 19:55
you're saying the callee makes a flattening array and therefore has to figure it out
jnthn Well, the important flattening thing here is the @a 19:56
brrt i guess that makes sense 19:59
se
sirrobert how can I tell if two data structures match deeply?
jnthn sirrobert: Did you try eqv? 20:00
sirrobert no ... I've never used eqv yet =)
trying now
jnthn OK, it may be what you want :)
sirrobert jnthn: yep, apparently it is =) 20:00
jnthn \o/ 20:01
brrt the funny thing is
jnthn colomon: It occurs to me I can probably make Grammar::Tracer perform a little better.
brrt p6 binding is not even that hard
its just hard if you make cheap assumptions about it
r: sub foo($x, $y, $z) { say $x.perl; say $y.perl; say $z;perl }; foo(1,(2,3),4) 20:02
p6eval rakudo 870d18: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&perl' called (line 1)␤»
brrt r: sub foo($x, $y, $z) { say $x.perl; say $y.perl; say $z.perl }; foo(1,(2,3),4)
p6eval rakudo 870d18: OUTPUT«1␤$(2, 3)␤4␤»
brrt $(2, 3) is a literal parcel? 20:03
jnthn It's a parcel in item context. 20:03
(2, 3) # would flatten
$(2, 3) # like (2, 3).item
colomon jnthn: ooooo 20:04
jnthn Actually $(2, 3) compiles to (2, 3).item
colomon jnthn: still not repeating itself, BTW.
jnthn I'm getting kinda tired for today, but I'll see if I can look at it tomorrow or so
colomon jnthn: but the bad news is the file I really want to process is 12 megs, so if things are really this slow on a 1.3 meg file, I may be in trouble here. 20:05
jnthn colomon: You need to process it with tracing?
colomon: Grammar::Tracer slows down grammar execution quite significantly. 20:06
brrt jnthn: thanks a lot 20:07
jnthn I wrote it with "OK, I'm building a grammar and it doesn't work, let me work out where" in mind.
colomon jnthn: no, I just need to process it. But I'm doing the trace because the 1.3 meg file was so slow I thought it was in an infinite loop the tracer would help me find. If instead it's really just that slow, then I've got big issues with running a 12 meg file.
jnthn colomon: 3 hours sounds quite crazy. I mean, we chew through all 400 KB of CORE.setting - including building the AST - in not incredibly long. 20:09
jnthn Not with tracing, but still... 20:09
brrt there is a factor of 30 difference only or so 20:11
jnthn colomon: It's not backtracking in some place, is it? 20:12
colomon: As in, it's all rule/token and not regex?
colomon jnthn: all rule/token 20:15
colomon jnthn: I may just not have been showing enough patience, I just tried again (no trace, that's still running on a different machine) and it parsed the file in question in 3 minutes 47 seconds. :) 20:20
arnsholt perl6-language is the list for all things spec, right? 20:23
sorear ya 20:24
arnsholt signs up 20:25
bbkr_ star: use JSON::Tiny; use JSON::RPC::Client; try { CATCH { JSON::RPC::ParseError.new( data => ~$! ).throw };from-json( q|{"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz]| ) } 20:33
p6eval star 2012.07: OUTPUT«use of uninitialized value of type Any in string context in block <anon> at /tmp/r2pmhDBl2E:1␤␤Parse error (-32700): ""␤»
jnthn bbkr_: Inside CATCH, the current exception is in $_ 20:34
bbkr_ do we have newest star available? code above SegFaults on 2012.09 on my machine
jnthn (thus why it can be smart-matched on
jnthn wonders whihc star is running there 20:35
star: say %*PERL<version>
p6eval star 2012.07: OUTPUT«postcircumfix:<{ }> not defined for type Failure␤ in method gist at src/gen/CORE.setting:9574␤ in sub say at src/gen/CORE.setting:6980␤ in block <anon> at /tmp/zgCUo4q9jU:1␤␤»
jnthn star: say $*PERL 20:35
p6eval star 2012.07: OUTPUT«("name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2012.07", "release-number" => "", "build-date" => "2012-07-28T09:39:00Z", "codename" => ""}).hash␤»
jnthn ah
bbkr_ jnthn: I know, this is done on purpose (SegFault should not happen no matter how badly logic is broken)
jnthn bbkr_: Indeed. 20:36
bbkr_: Please file a ticket; golfing welcome if possible.
bbkr_ jnthn: I will after I isolate the root of the problem as much as possible. 20:37
jnthn bbkr_: Thanks.
When I get chance, I'll try and get it reproduced here under the debugger.
bbkr_ confirmation from someone running 2012.09 is still welcome, I'm not sure if it's Rakudo or OS fault 20:38
brrt bbkr_: can you run it in gdb?
bbkr_ brrt, I'll try after I isolate the case a bit more 20:40
rakudo: try { CATCH { ~$! }; die } # shortest form that segfaults on my machine 20:41
p6eval rakudo 870d18: OUTPUT«(signal SEGV)»
bbkr_ rakudo: say $*PERL
p6eval rakudo 870d18: OUTPUT«("name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2012.09.1-19-g870d189", "release-number" => "", "build-date" => "2012-10-07T20:14:14Z", "codename" => ""}).hash␤»
jnthn eek 20:42
rakudo: try { CATCH { say $! }; die }
p6eval rakudo 870d18: OUTPUT«Mu()␤␤ in block at /tmp/PvCL0g0K2j:1␤␤»
jnthn rakudo: try { CATCH { say pir::typeof__SP($!) }; die }
p6eval rakudo 870d18: OUTPUT«Null PMC access in name()␤ in block at /tmp/z1hRUMISze:1␤ in block at /tmp/z1hRUMISze:1␤␤»
jnthn yowser
bbkr_ ? 20:43
jnthn Yeah, that's bad.
colomon jnthn: I just gave up on the long trace when I realized it was still only a third of the way through the file.
jnthn colomon: OK, so the tracer really is slow indeed. :)
colomon: I'll see if I can't speed it up a bit :)
colomon jnthn++ 20:44
brrt jnthn, bbkr_: works for me in gdb, although i have an oldish version 20:45
jnthn Yeah, I'm thinking it's a regression that's snuck in and didn't get caught by spectest.
brrt oh, wait, stringifying gives a segfault
bbkr_ RT #115184 20:46
jnthn How old is your oldish?
brrt in Rakudo_cont_decontainerize
jnthn bbkr_: Thanks
brrt 2012-07-359
old
cointainer.c, line 20 20:47
gdb is awesome
colomon jnthn: yow, top says the 12 meg file has used up 4.5 gigs of memory so far in parsing.
brrt anywhere i can post a backtrace? 20:49
jnthn gist?
brrt ok, data and _metadata of our pmc are null
jnthn I'm guessing it's a PMCNULL 20:50
brrt probably 20:51
sorear colomon: p6 parsers are slowww
brrt basically, it derefs the data
colomon sorear: it seems like it's the memory usage rather than the raw speed which is getting me... 20:52
brrt i can't really figure out what opcodes cause it 20:53
bbkr_ rakudo: say try { 666; CATCH { }; } # does this follow a spec? IMO place of phaser definition should be irrelevant to block return value. 20:56
p6eval rakudo 870d18: OUTPUT«Nil␤»
brrt gist of backstrace 21:01
also
gist.github.com/3854954
Mu() is PMCNULL?
jnthn No
brrt it /appears/ to be so 21:02
jnthn I think something somewhere is transforming it
brrt added the pmc dump 21:03
to the gist
jnthn oh, it blows up trying to do a multi-dispatch
Probably to prefix:<~>
brrt off 21:13
jnthn sleeps & 21:15
colomon oh, the good news here is I successfully read a 4 meg file in 18.5 minutes 21:21
colomon wonders how long Niecza will take... 21:22
sorear slurp() should be decently fast since it's not looping at the p6 level :D 21:26
diakopter :D 21:30
diakopter wonders if there's a smiley for tongue-in-cheek
bbkr_ :􏿽xDF 21:31
diakopter not in my font
bbkr_ (german double s) 21:32
bbkr_ is phaser definition considered "a statement" considering a fact that it's tied to execution phase of a block rather than to position in this block? 21:34
bbkr_ rakudo: try { CATCH { }; die; }; say "alive" 21:43
p6eval rakudo 870d18: OUTPUT«␤ in block at /tmp/SogYHm1UM4:1␤␤»
bbkr_ hm, why is catched exception still causing code to die? 21:44
sorear because you didn't catch the exception. 21:48
inside of a CATCH behaves as a given-block
if the exception is not matched by any when, it is not caughrt 21:49
r: try { CATCH { default { say $_ } }; die; }; say "alive"
p6eval rakudo 870d18: OUTPUT«␤ in block at /tmp/NN9cdx7k3H:1␤␤alive␤»
bbkr_ r: try {CATCH { return 1;}; die; }; say "alive"; # then why this example works? 21:57
p6eval rakudo 870d18: OUTPUT«alive␤»
bbkr_ r: try {CATCH { 1;}; die; }; say "alive"; # and this does not, despite the fact that implicit block return value should behave in the same way in both cases? 21:58
p6eval rakudo 870d18: OUTPUT«␤ in block at /tmp/_lAUdcPMDl:1␤␤»
sorear bbkr_: because "return" isn't the same as implicit block return. 21:59
TimToady but there's no 'sub' there in either case 22:00
TimToady np: try {CATCH { return 1;}; die; }; say "alive"; 22:01
TimToady n: try {CATCH { return 1;}; die; }; say "alive"; 22:01
p6eval niecza v22-7-g7df6137: OUTPUT«alive␤»
TimToady n: try {CATCH { 1;}; die; }; say "alive";
p6eval niecza v22-7-g7df6137: OUTPUT«alive␤»
sorear n still does not do lexical returns
bbkr_ niecza bug?
TimToady there's nothing to return to, if CATCH is parsing as a block rather than a sub 22:02
and I'd tend to argue that phasers should be considered blocks rather than subs 22:03
bbkr_ so we have discrepancies between R and N here on "CATCH {1;}" case, which one behaves correctly? 22:04
sorear no, bbkr, the discrepancy is with "try" 22:05
diakopter rn: try {CATCH { 1; CATCH { say 55 }; die 4; }; die; }; say "alive";
sorear in niecza, "try" eats uncaught exceptions
always
p6eval rakudo 870d18: OUTPUT«(timeout)55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤55␤5
..niecza v22-7-g7df6137: OUTPUT«55␤alive␤»
diakopter 0_0 22:05
sorear diakopter: dying in a catch block is a bad idea 22:06
diakopter :)
diakopter still. why does it recurse 22:07
bbkr_ rephrasing the question: should try{} consume uncaught exception or not?
doy why is dying in a catch block a bad idea?
TimToady well, more like CATCH in a CATCH is a bad idea; the spec handles dying in a CATCH block
diakopter also, how can the inner CATCH go with the outer try, when there's no inner try 22:08
diakopter rn: try { try { try { die 66 } } }; say $! 22:09
p6eval niecza v22-7-g7df6137: OUTPUT«66␤»
..rakudo 870d18: OUTPUT«Any()␤»
sorear doy: because the exception hasn't really been handled at that point, CATCH blocks are closer to filters than real exception handlers
doy: the stack isn't unwound until the catch block returns 22:10
spider-mario I just discovered that perl5 actually supports string interpolation of arbitrary expressions
diakopter so, $! isn't lexical to the inner try in niecza, but it is in rakudo; which is right
spider-mario except for nested double quotes appearently
$ "${\('a' . 'b')}"
ab
a little more verbose than perl6’s {}, but still 22:11
TimToady @{['a' . 'b']} is usual formulation, if list context doesn't get in your way
spider-mario oh, I see 22:12
thanks
diakopter rn: CATCH { BEGIN { say $! } }; 22:13
p6eval rakudo 870d18: OUTPUT«Mu()␤»
..niecza v22-7-g7df6137: OUTPUT«Any()␤»
diakopter rn: say $!
p6eval rakudo 870d18, niecza v22-7-g7df6137: OUTPUT«Any()␤»
spider-mario it certainly doesn’t matter but ${} seems faster 22:14
Rate @ $
@ 1096074/s -- -81%
$ 5892226/s 438% --
but, hey, it’s string formatting after all. :p 22:15
it’s not like the user will notice, and it’s the expression inside that matter most anyway, I guess
matters* 22:16
diakopter wth:
rn: CATCH { say 66 }; die 4
p6eval niecza v22-7-g7df6137: OUTPUT«66␤Unhandled exception: 4␤ at /home/p6eval/niecza/lib/CORE.setting line 1437 (die @ 5) ␤ at /tmp/3QHNBoQizv line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4199 (module-…
..rakudo 870d18: OUTPUT«4␤ in block at /tmp/JRnkKpmCzM:1␤␤»
diakopter rn: sub a() { CATCH { say 66 }; die 4 }; try { a }
p6eval rakudo 870d18, niecza v22-7-g7df6137: OUTPUT«66␤»
cognominal r: for CORE.WHO.keys.sort { try { $_=eval $_; say $_.perl if $_ ~~ Code }}
p6eval rakudo 870d18: OUTPUT«(timeout)sub ANON_ENUM(*@args) { ... }␤sub AUTOTHREAD(&call, *@pos, *%named) { ... }␤sub AUTOTHREAD_METHOD($name, *@pos, *%named) { ... }␤sub COMP_EXCEPTION() { ... }␤sub DIVIDE_NUMBERS(Int:D \nu, Int:D \de, $t1, $t2) { ... }␤sub DUMP() { ... }␤sub DYNAMIC(\name) {… 22:17
cognominal a nice way to list subs in the CORE
diakopter aha! : 22:18
rn: my $a; try { $a = sub { CATCH { say 66 }; die 4 } }; $a()
p6eval rakudo 870d18: OUTPUT«66␤4␤ in sub at /tmp/k15G15jPxa:1␤ in block at /tmp/k15G15jPxa:1␤␤» 22:19
..niecza v22-7-g7df6137: OUTPUT«66␤Unhandled exception: 4␤ at /home/p6eval/niecza/lib/CORE.setting line 1437 (die @ 5) ␤ at /tmp/l91QU6Y8l_ line 1 (ANON @ 5) ␤ at /tmp/l91QU6Y8l_ line 1 (mainline @ 10) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/n…
cognominal the try is necessary because of some stubbing
diakopter niecza dies 4; rakudo says 66 22:19
sorear: I have no clue which is right
oh wait.
they both do both.
<-- needs more coffee
cognominal sub incore($type) { for CORE.WHO.keys { try { $_=eval $_; say $_.perl if $_ ~~ Code and $_.signature.params>>.type >>~~>> $type; } } } ; incore(Version) 22:20
diakopter wait.
diakopter why do they both do both? does it catch it or not? 22:21
cognominal it should print core subs with an argument which match a $type, here Version, but somehow its list everything :(
diakopter why does it die 4 if it says 66
sorear diakopter: it doesn't catch.
diakopter how does it print 66 22:21
sorear it enters the CATCH block, but you don't have anything in there to actually catch the exception. 22:22
sorear exceptions are caught by when statements inside CATCH blocks 22:22
diakopter oh ...
cognominal ho, an array of boolean is not a boolean! 22:24
bbkr_ TimToady: speaking of phasers - should phaser definition affect return value of a block like in "say try { 123; CATCH{} }" example? Spec says that in this case "the return value of a block is the value of its final statement" while phaser position cannot be described as "final" because it is executed in certain phase, not at the end of the block (in this case). 22:25
spider-mario what d’you think it is? fortran? J? :)
cognominal r: sub incore($type) { for CORE.WHO.keys { try { $_=eval $_; say $_.perl if $_ ~~ Code and [&] $_.signature.params>>.type >>~~>> $type; } } } ; incore(Version) 22:27
p6eval rakudo 870d18: OUTPUT«(timeout)sub term:<time>() { ... }␤sub term:<now>() { ... }␤»
cognominal weird 22:28
sorear bbkr_: the phaser is syntactically a statement and is treated as 'Nil;' for most purposes 22:29
bbkr_ sorear: thanks, I was not sure if "statement" in this part of spec refers to syntax or something being executed 22:32
diakopter rn: CATCH { 4 } while 0 { say 5 }; say "alive" 22:33
p6eval niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/15hPT7beWC line 1:␤------> CATCH { 4 }⏏ while 0 { say 5 }; say "alive"␤␤Parse failed␤␤» 22:34
..rakudo 870d18: OUTPUT«alive␤»
diakopter how could it parse that
bbkr_ will try { "some sleep".get() } # good night 22:36
diakopter rn: say try { say 5; return try { 4 } }; say "alive" 22:57
p6eval niecza v22-7-g7df6137: OUTPUT«5␤Unhandled exception: Illegal control operator: return␤ at /tmp/VknWX79dZh line 1 (ANON @ 9) ␤ at /tmp/VknWX79dZh line 1 (mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4199 (…
..rakudo 870d18: OUTPUT«5␤»
diakopter rn: say try { die try { 4 } }; say "alive" 23:00
p6eval rakudo 870d18: OUTPUT«4␤ in block at /tmp/9TsxcR3LUH:1␤␤alive␤»
..niecza v22-7-g7df6137: OUTPUT«Any()␤alive␤»
diakopter why doesn't rakudo catch it 23:01
I mean.
why does niecza catch it
I mean. one of those. 23:02
sorear diakopter: "try" in niecza always catches, whether or not the CATCH does anything 23:03
diakopter oh. does rakudo do the wrong thing?
sorear *shrug* 23:04
diakopter r: eval 'say ' ~ 'try ' x 900 ~ '66' 23:11
p6eval rakudo 870d18: OUTPUT«(timeout)» 23:12
diakopter n: eval 'say ' ~ 'try ' x 900 ~ '66'
p6eval niecza v22-7-g7df6137: OUTPUT«66␤»
diakopter n: eval 'say ' ~ 'try ' x 3000 ~ '66' 23:13
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
diakopter so rakudo takes more than 10 ms per try 23:14
sorear diakopter: I think that you're seeing quadratic behavior 23:14
r: eval 'try 66; ' x 900 23:15
p6eval rakudo 870d18: OUTPUT«(timeout)»
sorear r: eval 'try { 66 }; ' x 900
p6eval rakudo 870d18: OUTPUT«(timeout)»
sorear huh
sorear n: eval 'try { 66 }; ' x 3000 23:15
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)» 23:16
sorear maybe not.
diakopter niecza times out at at least 1750
n: eval 'say ' ~ 'try ' x 1750 ~ '66'
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
diakopter trying to bisect
like I did with rakudo 23:17
sorear n: eval 'say ' ~ 'try ' x 50 ~ '66'; say times[0]
p6eval niecza v22-7-g7df6137: OUTPUT«66␤1.180073␤»
sorear n: eval 'say ' ~ 'try ' x 500 ~ '66'; say times[0]
p6eval niecza v22-7-g7df6137: OUTPUT«66␤2.316144␤»
sorear n: eval 'say ' ~ 'try ' x 1500 ~ '66'; say times[0] 23:18
p6eval niecza v22-7-g7df6137: OUTPUT«66␤8.848553␤»
diakopter hard to say due to startup time
oh wait, what's times
sorear n: say (2.316 - 1.180) / 450; say (8.848 - 1.180) / 1450
p6eval niecza v22-7-g7df6137: OUTPUT«0.0025244444444444446␤0.0052882758620689651␤»
sorear perldoc -f times 23:19
times[0] is noncumulative user time
diakopter rn: sub a() { eval 'return ' x 2000 ~ '5' }; say a 23:26
p6eval rakudo 870d18, niecza v22-7-g7df6137: OUTPUT«(timeout)» 23:27
diakopter sorear: is there a way to measure niecza's time to lookup a unicode property like alpha 23:29
diakopter or rakudo's for that matter 23:31
sorear diakopter: depends a bit on what you mean I guess 23:33
diakopter how long would it take to do a million
sorear when you do <:alpha> in niecza it embeds an inversion list into the regex
diakopter what's an inversion list 23:34
sorear actually it's a sorted list of intervals 23:34
does binary search to find the nearest interval, then checks membership
diakopter what's the golfedest way to check alpha on an alpha char 23:37
in a regex let's say
diakopter n: my $a = 'a'x 50000; say times[0]; $a ~~ /<alpha>*/; say times[0] 23:39
p6eval niecza v22-7-g7df6137: OUTPUT«10.148634␤10.24064␤» 23:39
diakopter hm, is <alpha> the right thing
I always forget the syntax 23:40
sorear <alpha> works but <:alpha> will be faster 23:41
diakopter n: my $a = 'a'x 50000; say times[0]; $a ~~ /<:Letter>*/; say times[0] 23:45
p6eval niecza v22-7-g7df6137: OUTPUT«10.196637␤10.212638␤»
diakopter I can't construct large strings fast enough to fit within p6eval's timeout 23:47
sorear n: 'a' x 50000 23:48
p6eval niecza v22-7-g7df6137: ( no output )
sorear n: say ('a' xx 50000).join
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
sorear n: say [~] 'a' xx 50000
p6eval niecza v22-7-g7df6137: OUTPUT«aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…
diakopter ahhhh neat 23:49
sorear [~] is using an internal StringBuilder
I think x is using the stupid quadratic algo
diakopter n: my $a = [~] 'a' xx 100000; say times[0]; $a ~~ /<:Letter>*/; say times[0] 23:50
p6eval niecza v22-7-g7df6137: OUTPUT«7.860491␤7.952497␤»