Camelia, the Perl 6 bug

IRC log for #perl6, 2013-09-17

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | full mode

All times shown according to UTC.

Time Nick Message
04:22 johnny5_ so someone with some Perl5 experience what can we do to help with Perl6?
04:25 moritz hi johnny5_. You could learn Perl 6, and port some Perl 5 modules to Perl 6
04:29 perigrin or write new ones that don't have the baggage of the perl5 ones.
07:37 FROGGS jnthn: btw, I think you are the best Kursledare I ever had... I just know one teacher of my electrical engineering apprenticeship who could explain stuff that well
10:06 hoelzro fun fact: ConfigureJVM.pl --prefix=$HOME/jakudo doesn't configure the build probably if the prefix doesn't exist
10:06 * hoelzro adds it to personal todo list
11:09 hoelzro what's the standard for adding tests to rakudo? any bug, or only serious ones?
11:09 hoelzro I believe I found a bug in JVM rakudo
11:09 jnthn omg A BUG?!
11:34 moritz http://blogs.perl.org/users/damien​_dams_krotkine/2013/09/p5-mop.html
12:06 masak I think the submatch problem on Rakudo/JVM has been identified before.
12:06 masak not sure if it was RT'd.
12:34 grondilu Ukkonen's algorithm for suffix trees in Perl 6.  Translated from C++.  https://gist.github.com/grondilu/6593733
12:38 timotimo huh, what are the =begin validation and =end validation for?
12:41 grondilu timotimo: that code doesn't work yet, so I commented it.
12:43 grondilu it does give the correct edges with the typical example banana$, so I thought it was worth publishing.
13:31 hoelzro can someone do me a favor and look at my single commit on https://github.com/hoelzro/rakudo?
13:39 pmurias jnthn: why does my $foo;if $foo<a><b><c> {};say("didn't die"); work?
13:40 timotimo because there's a candidate for postcircumfix:<{ }> for undefined LHS
13:40 * jnthn suspects pmurias means "in NQP"
13:41 jnthn I think there's two pieces. One is that we emit a QAST::VarWithFallback that massages a null into an NQPMu.
13:41 jnthn The second piece is that the at_pos and at_key ops on a type object hand back null instead of throwing.
13:42 jnthn uh, atpos and atkey are the op names...
14:01 diakopter can a p6 module/extension load a new trait?  (I'm imagining "is persistent", which would be an extension to "is memoized" or whatever it's called), where the compiler's smart enough to persist (accurately) caches of invocation args/results to disk)
14:02 moritz diakopter: yes. For example NativeCall.pm6 export the 'is native' trait.
14:10 yoleaux 14:06Z <diakopter> jnthn: 100 gc runs in total run time 280ms, including 4 threads allocating 1e6 each
14:10 yoleaux 14:08Z <diakopter> jnthn: that's, like, far less than 1ms per gc run
14:10 jnthn I'm guessing those mostly are throwing away dead things...
14:10 diakopter yes, tiny alive heaps
14:11 jnthn In realistic workloads I'd suspect a slightly higher survivor ratio, but yeah, Moar's nursery GC is optimized for death.
14:44 moritz hoelzro: fwiw I'm not sure that's the right approach
14:44 moritz hoelzro: configuring and building shouldn't require write priviliges outside the build dir
14:46 moritz rather use File::Spec->rel2abs
14:46 moritz Configure.pl uses abs_path, which is a synonym for realpath
14:46 moritz so it too needs fixing
14:54 GlitchMr Just wondering, how do I specify list with at least one arguments in sub MAIN?
14:54 moritz GlitchMr: *@a where @a   maybe
14:55 moritz maybe '@a where so @a'
14:55 moritz or *@a [$, *@]
14:56 hoelzro it *would* be nice to be able to override the MAIN helper stuff from a P6 program
15:00 jnthn You can override the USAGE message, no?
15:01 hoelzro I was thinking more like overriding the automatic @*ARGV processing
15:05 doy http://paste.tozt.net/2013-09-17vofIScs2
15:06 doy why does adding a BUILD submethod to Foo affect whether Bar's attributes are initialized?
15:06 moritz it shouldn't; looks like a rakudobug to me
15:09 moritz r: class A { submethod f() { say 42 } }; class B is A { }; B.f()
15:09 camelia rakudo 223075: OUTPUT«No such method 'f' for invocant of type 'B'␤  in block  at /tmp/UMK_u2mzec:1␤␤»
15:10 jnthn I'm afraid it's much more subtle than that.
15:10 jnthn submethod BUILD { say self }
15:10 jnthn When you do "say self" you touch the two attribute slots when introspecting.
15:11 jnthn That in turn vivifies the containers inside of them, which is what has to happen if you are going to have $!foo = ...; work.
15:11 TimToady_ arguably foo should not know about bar yet
15:12 TimToady_ also arguably the program is erroneous for assuming the object is all created
15:13 TimToady_ do we have any way of referring to the subpart of the object that has been constructed so far?
15:13 jnthn Not really.
15:14 TimToady_ well, if you happen to notice a way to get it for free at some point, lemme know
15:15 TimToady_ I think it's my second speculative notion: erroneous to refer to the entire object
15:15 TimToady_ so more in the category of "Doctor it hurts..."
15:18 doy PerlJam: well, it just seems odd that it would be allowed to both set a default and define a BUILD method without getting a warning or something
15:19 jnthn doy: If you don't touch an attribute in your BUILD, the default is applied.
15:19 jnthn doy: the problem is you did "say self", which touches all the attributes.
15:19 * TimToady still wonders if the default should just be attached to the FETCH, so that you can initialize with +=, for instance
15:20 TimToady has $.foo = 42; submethod BUILD () { $!foo += 1 };  # that sort of thing
15:21 TimToady not sure it works right for natives though
15:21 masak IO::Path in the setting contains 'has Str $.path', but then 'method path(IO::Path:D:) { self; }' -- IMO it shouldn't do both. opinions?
15:22 TimToady that seems a bit confused, yes
15:23 * masak prepares a patch
15:25 TimToady does the 'touch' mechanism extend properly to natives currently?
15:26 * TimToady doesn't actually know how rakudo does it...
15:28 jnthn TimToady: We do it by using a NULL in the object body to indicate "untouched", and the first touch vivifies the Scalar container.
15:28 TimToady so it probably all needs a rethink anyway...
15:29 TimToady of course, for natives, you could probably just statically initalize the chunk of memory more efficiently
15:30 jnthn Of course, since we normally get zeroe'd memory, only floating point things need fiddling with to make them NaN.
15:31 TimToady just thinking if you had a template, you could poke 42's and such into it as well
15:31 TimToady then it's just a memcpy
15:31 TimToady (before BUILD)
15:32 jnthn That still doesn't free us from needing some flags somewhere for initialized.
15:33 jnthn (for natives)
15:35 jnthn We can probably convey enough to the REPR about this to let it be smart...
15:35 TimToady but you could know enough at compile time to optimize the statics into the initial memcpy
15:35 jnthn (only have the flags for the non-static case)
15:35 jnthn Right, that's do-able.
15:36 jnthn I'd really like working with natives to not bring about pain :)
15:36 jnthn (compared to not using them)
15:40 jnthn http://6guts.wordpress.com/2013/09/17/materi​al-from-the-rakudo-and-nqp-internals-course/
15:50 daxim excellent read, jnthn++
15:50 masak jnthn++
15:54 daxim tell the decision makers a thank you from me for releasing the materials
15:54 JimmyZ lizmat++, jnthn++
15:55 colomon jnthn++ lizmat++
15:56 FROGGS stitching++ (needs a bit improvement though): http://i.imgur.com/FwjxCI0.jpg?1
16:00 * TimToady appriciates that FROGGS++ has preserved various subtle asymmetries
16:16 dalek nqp: c3bcf9e | (Pawel Murias)++ | t/nqp/81-radix.t:
16:16 dalek nqp: Add test for nqpp::radix.
16:29 masak r: my @names = <jnthn lizmat moritz>; my %h = ($_ => [] for @names); say %h.perl
16:29 camelia rakudo 223075: OUTPUT«("jnthn" => [], "lizmat" => [], "moritz" => []).hash␤»
16:30 masak quick poll: how would all y'all write the second statement above?
16:30 masak X=> doesn't really apply, and .map felt too unwieldy.
16:30 jnthn r: my %h = <jnthn lizmat moritz> Z=> [] xx *; say %h.perl
16:31 masak yeahbut.
16:31 hoelzro the GitHub guy came through!
16:49 arnsholt masak: Any particular reason your toolchain is latex -> dvips -> ps2pdf rather than just pdflatex?
16:49 masak arnsholt: jnthn's (Wintel) setup didn't like pdflatex, so we had to detour.
17:10 masak we also accept both issues and pull requests for that particular course, should the need arise.
17:21 moritz r: sub MAIN(Bool :h(:$help)!) { }
17:21 camelia rakudo 223075: OUTPUT«Usage:␤  /tmp/qKcVhe1EPD -h|--help ␤»
17:26 flussence one thing I've noticed the default USAGE lacks: it doesn't show subset type names or stuff like that. Not a big problem but it'd be nice...
17:52 tadzik I need to finish my PHP6 compiler on some free evening :)
18:08 GlitchMr <26flussence> one thing I've noticed the default USAGE lacks: it doesn't show subset type names or stuff like that. Not a big problem but it'd be nice...
18:08 GlitchMr Parsing where expression would be insane.
18:08 GlitchMr Especially to show in something like USAGE.
18:10 flussence I'm not asking it to parse the where expression, just to recognise there's a named subset type and use that...
18:50 itz_ these slides are excellent!
19:15 GlitchMr These slides make me want to implement some programming language in NQP. It sounds fun.
19:15 hoelzro it was =)
19:15 masak GlitchMr: if you do, make sure you also blog about how easy it is to get going.
19:25 GlitchMr From what I read, NQP looks like great framework to make programming languages, not just Perl 6.
19:26 masak GlitchMr: to implement compilers, to be exact.
19:26 TimToady GlitchMr: there's a reason for that :)
19:35 lizmat r: my @a; say @a.exists(-1)  # shouldn't this fail with "cannot have a negative index" ?
19:35 camelia rakudo 223075: OUTPUT«False␤»
19:35 lizmat r: my @a; say @a[-1]:exists  # like this ?
19:35 camelia rakudo 223075: OUTPUT«Cannot use negative index -1 on Array␤  in method gist at src/gen/CORE.setting:12023␤  in method gist at src/gen/CORE.setting:953␤  in sub say at src/gen/CORE.setting:12923␤  in block  at /tmp/nKTQwMv3aa:1␤␤»
19:36 lizmat (at least for arrays without explicit shapes)
19:40 masak lizmat: arguably, yes.
19:41 masak lizmat: does it fail any spectests to make it fail? if not, go for it.
19:43 GlitchMr Just wondering, how well does NQP support Unicode (without Perl 6)?
19:44 diakopter GlitchMr: I get unicode errors often with nqp on parrot.
19:46 GlitchMr Can I for example define grammar where identifiers are unicode letters?
19:46 lizmat GlitchMr: afaik, yes
20:08 hoelzro I wish that Perl 6 supported fork() =(
20:11 diakopter it does though, with NativeCall
20:21 * dylanwh has the sudden desire to invoke fork() from a jvm process.
20:31 Tene Oh, actually I don't think fork() will do the right thing with the other threads.
20:32 Tene "The  child  process  is  created  with  a single thread—the one that called fork()."
20:33 Tene I think JVM usually uses multiple threads for every process?
20:34 jnthn aye, it runs GC in a different thread, for example
20:34 jnthn "dude, where's my GC?!"
20:35 Tene Oops. :)
20:36 Tene I remember trying to analyze a problem a friend was having with jruby via strace; I think there were ~170 threads, just in 'hello world'.
21:22 dalek nqp: 47299be | coke++ | docs/ops.markdown:
21:22 dalek nqp: add overview/section headings
21:22 dalek nqp: Add section headings analagous to jnthn++'s presentation
21:33 jnthn [Coke]: Trouble is, on Parrot not everything is a 6model object
21:33 jnthn [Coke]: There's not really canonical ones, though on JVM and Moar impls you can nqp::bootint() to get a basic int boxing type, for example
21:43 timotimo the --target=ast of a pir op is utterly unhelpful
21:43 timotimo how do i properly build a QAST::VM with a pirop and some children nodes? >:(
21:48 jnthn timotimo: QAST::VM.new( :pirop('foo__IS'), QAST::SVal.new( :value('beeftuit') ) )
21:49 dalek nqp: 8f7b9f4 | coke++ | docs/ops.markdown:
21:49 dalek nqp: Add arithmetic opcodes
21:50 [Coke] how is this looking: https://github.com/perl6/nqp/​blob/master/docs/ops.markdown ?
21:51 masak [Coke]: nice.
22:04 timotimo if there's a lowercase letter in the op i'm trying to use, do i have to $qastcomp.coerce?
22:08 jnthn yeah, or as_post it with the appropriate :want
22:10 timotimo QAST::Operations doesn't mention want anywhere
22:12 dalek nqp: a8eef0c | coke++ | docs/ops.markdown:
22:12 dalek nqp: more accurately use int, not Int
22:12 dalek nqp: update to add _I variants.
22:12 dalek nqp: code-ify op variants
23:49 [Coke] 19:38 < [Coke]> So, _I's should not be documented as taking Ints. better
23:49 [Coke] shorthand: Any?
23:49 [Coke] 19:43 < [Coke]> where is nqp::ln defined for the jvm?
23:49 [Coke] 19:44 < [Coke]> oh. that's where. (it's NYI!)
23:49 [Coke] 19:47  * [Coke] opens a ticket for it, in case someone wants that before he
23:49 [Coke] loops back.
23:49 * [Coke] goes with "Any" for now as the Int replacement.

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | full mode

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs