Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-07-16

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:13 [Coke] ok. crontab problem with running pugs: i run it from the command line, it fails almost nothing. from cron, several hundred more.
00:14 [Coke] ... oh, wait, my test to duplicate crontab's environment have duplicated the problem. score.
00:15 [Coke] now I just need to figure out which env var is to blame. ;)
00:15 moritz binary search over 'em?
00:23 [Coke] argh. now it's not duplicated. arglebargle.
00:26 [Coke] is there anything cron changes other than env vars?
00:26 cognominal joined #perl6
00:29 moritz I don't think so
00:29 moritz I wouldn't know what else *could* be different
00:32 [Coke] shell, mebbe.
00:33 moritz right
00:38 * [Coke] goes bugeyed.
01:07 ingy joined #perl6
01:13 raiph joined #perl6
01:14 raiph "can you give some elements of P6 that you find "lispish"?"
01:14 raiph http://www.reddit.com/r/perl/comments/wkk15/lisp_has_all_the_visual_appeal_of_oatmeal_with/c5eb5i2
01:29 Coleoid joined #perl6
01:39 godfrey999 joined #perl6
01:43 am0c_ joined #perl6
01:50 zhutingting joined #perl6
01:52 * [Coke] should probably change this gist to a git project.
02:18 lue Does anybody else get a bus error (or know how to fix it) when running nqp (toqast branch) outside the nqp repo?
02:22 * lue guesses a bad sector in /usr/local land
02:23 geekosaur that should show up in syslog
02:26 lue I know dmesg confirms that my HDD is old :)    /me wonders if he ever set up metalog
02:39 orafu joined #perl6
02:45 colomon sorear: ping?
02:51 colomon Unsupported use of | with sigil; nowadays please use | without sigil at /Users/colomon/tools/niecza/t/spec/packages/Test/Util.pm line 7:
02:51 colomon ------> [32mproto sub is_run(|$[33m�[31m) is export { * }[0m
02:57 thou joined #perl6
03:20 prettyrobots joined #perl6
03:25 zhutingting joined #perl6
03:27 * colomon thinks he may have finally sorted out his mono difficulties.
03:27 colomon \
03:31 kaare_ joined #perl6
03:57 dalek roast: 094220d | (Solomon Foster)++ | S02-types/array.t:
03:57 dalek roast: Fudge for niecza and whine somewhat about the test.
03:57 dalek roast: review: https://github.com/perl6/roast/commit/094220d501
04:42 dalek roast: e311f17 | coke++ | S (4 files):
04:42 dalek roast: pugs fudge
04:42 dalek roast: review: https://github.com/perl6/roast/commit/e311f17379
04:59 dalek roast: 63da604 | coke++ | S0 (3 files):
04:59 dalek roast: pugs fudge
04:59 dalek roast: review: https://github.com/perl6/roast/commit/63da6044ea
05:17 kaleem joined #perl6
05:40 PZt joined #perl6
05:55 am0c_ joined #perl6
05:59 kresike joined #perl6
05:59 kresike good morning all you happy perl6 people
06:16 fridim_ joined #perl6
06:17 tadzik oh hello kresike
06:17 tadzik did you wake up earlier today, or am I late for work already? :)
06:18 kresike hello tadzik
06:18 kresike yes, I'm an early bird today
06:23 [Coke] must...sleep.
06:24 tadzik [Coke]: http://goo.gl/bqCc5
06:25 nodmonkey joined #perl6
06:29 thou r: say 'foo'.Int // 0;
06:30 p6eval rakudo ee86a5: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏foo' (indicated by ⏏)␤  in method Int at src/gen/CORE.setting:9556␤  in method Int at src/gen/CORE.setting:3485␤  in block <anon> at /tmp/URGRBor_BY:1␤␤»
06:30 thou r: say +'foo' // 0;
06:30 p6eval rakudo ee86a5: OUTPUT«0␤»
06:30 thou ?
06:51 GlitchMr joined #perl6
06:53 * [Coke] fixes pugs's testing borkedness.
06:58 [Coke] should bring pugs up from 33% to nearly 40% again.
07:00 [Coke] moritz: missing a LANG.
07:09 wtw joined #perl6
07:17 bbkr good morning
07:17 bbkr how to write tests for LTA error messages like this one: https://github.com/perl6/roast/blob/094220d50153c285c15fb3fa47b0b63e95bd6b5a/S02-types/array.t#L338 to avoid conflicts with other implementations?
07:24 moritz the first step is to determine what the proper error message would be
07:24 moritz then define an exception class for it
07:24 brrt joined #perl6
07:24 moritz and then use throws_like from Test::Util
07:24 moritz the current tests are certainly wrong
07:26 moritz my class X::Index is Exception { has $.aggregate; has $.index; method message() { "Cannot index {$.aggregate.^name} with $.index" } }
07:27 moritz or so
07:28 bbkr every error should throw some kind of exception?
07:29 moritz some should fail(), some should throw exceptions
07:29 moritz I'm not quite sure when to do what, but it's usually OK to start with die()
07:30 moritz and yes, all errors (except internal errors) should end up being of a proper exception class
07:30 prettyrobots joined #perl6
07:30 bbkr this example above throws X:AdHoc - is is something temporary (that should not be put in test)?
07:31 moritz X::AdHoc is what you get when the throwing location doesn't pass an Exception to &die
07:31 moritz so, not something you should test for in this context
07:31 moritz (and the error message is certainly wrong)
07:32 moritz probaly needs an  if nqp::isnanorinf($index) { ... }   check at some point
07:34 bbkr I'm restoring ticket and removing this test then. Sorry about trouble niecza guys.
07:35 moritz (allowing proper tests for such conditions is the reason I did the whole typed exception stunt. It's still hairy)
07:39 dalek roast: 202d250 | (Pawel Pabian)++ | S02-types/array.t:
07:39 dalek roast: removed inappropriate Rakudo-specific test
07:39 dalek roast: review: https://github.com/perl6/roast/commit/202d250dc3
07:39 hoelzro does NativeCall only use *.bundle on OS X?
07:40 bbkr moritz: exception thing makes perfect sense in multi-implementation-world
07:40 geekosaur why would it use it elsewhere?  os x and nextstep are the only oses that use *.bundle
07:41 bbkr hoelzro: yes, there is issue filled about it - https://github.com/jnthn/zavolaj/issues/7
07:41 hoelzro geekosaur: what I mean is will it also use *.dylib
07:41 hoelzro bbkr: thanks
07:42 masak goede morgen, #perl6
07:42 bbkr hoelzro: if you want to use dylib you have to hardcode like here: https://github.com/bbkr/GeoIPerl6/blob/master/lib/GeoIP.pm#L7
07:44 hoelzro unfortunately, it's DBIish that's doing the native stuff, not me =(
07:45 bbkr moritz: how about Failures - will they be also replaced by exceptions so I should avoid writing tests like: https://github.com/perl6/roast/commit/c1c897cf4fd6dcaf483d93e5a597548d0e6fd94b ?
07:45 fhelmberger joined #perl6
07:47 moritz bbkr: not replaced
07:47 moritz bbkr: but you can write something like
07:48 moritz throws_ok 'use fatal; "foo".substr(4)', X::Str::Substr::EOS;   or so
07:49 moritz or you can get at the failure's exception with .exception
07:50 bbkr Test::Util is not included in Rakudo yet?
07:50 tadzik r: use Test; "foo".substr(4); say "alive"; { use fatal; throws_ok { "foo".substr(4) }, X::Str::Substr::EOS; }; say "alive2"
07:50 p6eval rakudo ee86a5: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&throws_ok' called (line 1)␤»
07:50 tadzik r: use Test; "foo".substr(4); say "alive"; { use fatal; dies_ok { "foo".substr(4) }; }; say "alive2"
07:50 p6eval rakudo ee86a5: OUTPUT«alive␤ok 1 - ␤alive2␤»
07:50 moritz throws_ok comes from Test::Util
07:51 moritz and, my example was assuming that such an exception is actually failed/thrown
07:52 bbkr r: use Test::Util;
07:52 p6eval rakudo ee86a5: OUTPUT«===SORRY!===␤Could not find Test::Util in any of: /home/p6eval/.perl6/lib, /home/p6eval/nom-inst2/lib/parrot/4.5.0-devel/languages/perl6/lib␤»
07:52 jnthn morning, #perl6
07:52 tadzik morning jnthn
07:53 masak jnthn! \o/
07:53 jnthn masak!
07:53 jnthn tadzik!
07:53 masak we meet again.
07:54 jnthn Geeez, why is my internets so slow...
07:54 jnthn Oh, uploading 2 gig file...
07:54 masak that might be it.
07:54 jnthn Thought that might get done overnight. :)
07:54 moritz \o jnthn, masak, tadzik, *
07:55 * masak .oO( why does tadzik get an infinity of greetings? ) :)
07:55 bbkr doing: try {"foo".substr(4) }; ok $! ~~ X::Str::Substr::EOS; will breake whole test for niecza because such package is not registered there :(
07:56 masak thou: las link in july-9 post corrected. thank you for spotting that.
07:56 masak last*
07:56 moritz bbkr: currently it'll also break rakudo
07:56 moritz bbkr: but that's what fudging is for
07:57 snearch joined #perl6
07:57 thou good. there was one other similar (a post missing link to the corresponding code). ah, yes, july 7th (when you were tired).
07:58 thou masak: ^
07:58 masak oh!
07:58 moritz r: Inf.Int; say 'alive'
07:58 p6eval rakudo ee86a5: OUTPUT«alive␤»
07:59 moritz r: 1.list[Inf]
07:59 p6eval rakudo ee86a5: OUTPUT«Cannot coerce Inf to an Int␤  in method Numeric at src/gen/CORE.setting:9558␤  in sub infix:<+> at src/gen/CORE.setting:2466␤  in method exists at src/gen/CORE.setting:5317␤  in method at_pos at src/gen/CORE.setting:5297␤  in method postcircumfix:<[ ]> at src/gen/C…
07:59 bbkr moritz: thanks. I will replace literal error message comparing to X:: checks in my latest roast commits
07:59 moritz r: [1][Inf]
07:59 p6eval rakudo ee86a5: OUTPUT«This type cannot unbox to a native integer␤  in method at_pos at src/gen/CORE.setting:5730␤  in method postcircumfix:<[ ]> at src/gen/CORE.setting:1214␤  in block <anon> at /tmp/lqwhuQ6zVQ:1␤␤»
07:59 moritz bbkr: ok, great
07:59 moritz bbkr++
07:59 moritz bbkr: adding typed exceptions for stuff in the setting isn't very hard
08:01 moritz oh, we already have an X::OutOfRange
08:02 moritz so we can use that for substr
08:16 dakkar joined #perl6
08:19 masak lol, I blogged! http://strangelyconsistent.org/blog/july-15-2012-things-which-can-be-carried-around
08:23 daxim joined #perl6
08:26 dalek rakudo/nom: 65e2aae | moritz++ | src/core/Str.pm:
08:26 dalek rakudo/nom: start to &fail typed exceptions from Str.substr
08:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/65e2aae1c0
08:36 moritz masak++
08:41 masak re-doing this game this way is so much fun that I submitted a 20-minute YAPC::EU talk proposal about it :)
08:47 tadzik oh yay!
08:48 dalek rakudo/nom: 1fe39c7 | moritz++ | src/core/Str.pm:
08:48 dalek rakudo/nom: another typed failure from Str.substr
08:48 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1fe39c7f4f
08:48 moritz bbkr: substr should now fail with X::OutOfRange when any of the arguments are wrong
08:53 bbkr1 joined #perl6
08:55 lumi_ r: class A { my $b = 10; method inc { $A::b++ }; method get { $A::b }; }; my A $a .= new; $a.inc; say $a.get
08:55 p6eval rakudo ee86a5: OUTPUT«1␤»
08:56 moritz wtf? one can refer to a 'my'-variable with $A::b?
08:56 lumi_ moritz: No, but that's what the test in https://github.com/perl6/roast/commit/0577148dedabe886cbd06f7941298a697f8dd247 claims, and it's broken
08:56 moritz oh. broken test is broken.
08:57 moritz so it autovivifies a A::<$b>
08:57 lumi_ Maybe it was removed? I was backlogging
08:59 lumi_ No, it's still there
09:01 jerome joined #perl6
09:02 lumi_ n: class A { my $b = 10; method inc { $A::b++ }; method get { $A::b }; }; my A $a .= new; $a.inc; say $a.get
09:02 p6eval niecza v19-13-g442e075: OUTPUT«Potential difficulties:â�¤  $b is declared but not used at /tmp/4PRDlDufNB line 1:â�¤------> [32mclass A { my [33mâ��[31m$b = 10; method inc { $A::b++ }; method [0mâ�¤â�¤1â�¤Â»
09:04 wtw joined #perl6
09:06 lumi_ Any idea how that test can be improved?
09:07 lumi_ I guess remove the 'my'-variable
09:07 bbkr1 RT 74412 market this behavior as testneeded
09:07 phenny bbkr1: 01 Mar 23:00Z <benabik> tell bbkr1 Try `git clean -xdf` in your NQP directory.  This will remove any files not under version control, and seemed to let dyncall build properly for me.
09:07 bbkr1 oh, message from the past :)
09:08 lumi_ bbkr1: Yes, but "no longer sure" as mentioned there, it doesn't actually access the lexical
09:08 moritz bbkr: "testneeded" means "we need a test that the code in the ticket behaves as it should", so first we must be clear on how it should behave
09:08 moritz but it's ok, we can extend/fix the test
09:10 bbkr1 sorry about that. I understood Coke's message "Closable with tests." as "this is desired behavior that should be tested"
09:11 moritz I have a fix for the test locally
09:12 moritz just need to recompile rakudo to test it :(
09:13 tokuhiro_ joined #perl6
09:23 bbkr1 moritz: how about testing https://github.com/perl6/roast/commit/868d0c645fdacd32673e66dec66e384dbc9d70fa to avoid comparing error message? I cannot do "throws_ok { say and die 3 }" as it fails in compile time.
09:24 bbkr1 and - what seems logical - compile time errors do not have corresponding exceptions, have they?
09:27 hoelzro I should be able to assign anything that "does Associative" to a %-variable, right?
09:38 kaleem joined #perl6
09:52 moritz bbkr1: they have
09:52 moritz r: try eval '$x'; say $!.WHAT
09:52 p6eval rakudo 1fe39c: OUTPUT«X::Undeclared()␤»
09:52 Khisanth joined #perl6
09:56 dalek roast: 175f5e9 | moritz++ | S02-packages/package-lookup.t:
09:56 dalek roast: fix tests for lookup of our-variables in a class
09:56 dalek roast: review: https://github.com/perl6/roast/commit/175f5e9d35
09:56 hoelzro this code *should* work, right?
09:56 hoelzro https://gist.github.com/3121878
09:56 moritz hoelzro: bind, not assign
09:56 hoelzro or am I missing something obvious?
09:56 hoelzro ?
09:56 moritz hoelzro: hash assignment is coercive
09:57 moritz my %environment := RobTest.new();
09:57 hoelzro ok
09:57 hoelzro that's...interesting.
09:57 hoelzro can I do that in a hash constructor? something like my %params = :environment(RobTest.new);
09:58 moritz that places a pair with key 'environment' and value RobTest.new into %params
09:59 moritz not sure if that's what you want
09:59 hoelzro well, I'm passing %params to new of a class
09:59 hoelzro a class that has an attribute: has %.environment;
09:59 hoelzro right now, it's complaining about odd number of elements
09:59 moritz hm
10:00 moritz r: class A { has %.h }; class B does Associative { }; say A.new(h => B.new.new).perl
10:00 p6eval rakudo 1fe39c: OUTPUT«Odd number of elements found where hash expected␤  in method STORE at src/gen/CORE.setting:6110␤  in block <anon> at src/gen/CORE.setting:636␤  in method BUILDALL at src/gen/CORE.setting:620␤  in method bless at src/gen/CORE.setting:610␤  in method new at src/gen/C…
10:00 moritz I guess it should work, but we'd have to ask jnthn++
10:01 moritz oh
10:01 hoelzro moritz: btw, which synopsis covers :=?
10:01 moritz but if you then use  %.h inside the class, it might call the .hash method
10:01 moritz so it's safer to use a scalar attribute
10:01 moritz hoelzro: S03 iirc
10:01 hoelzro =(
10:04 jnthn Doing Associatve doesn't imply anything about flattening in hash context. It just means you support at_key.
10:04 jnthn Well, or that you claim to.
10:04 jnthn r: class B does Associative { }; my %h = B.new
10:04 p6eval rakudo 1fe39c: OUTPUT«Odd number of elements found where hash expected␤  in method STORE at src/gen/CORE.setting:6110␤  in block <anon> at /tmp/wPlxxSagrm:1␤␤»
10:05 jnthn Don't need the class and stuff to reproduce this one.
10:05 hoelzro so my %hash = Class.new coerces the RHS to a Hash?
10:06 Guest6173 joined #perl6
10:06 jnthn No
10:06 jnthn It doesn't coerce it anywhere
10:07 jnthn Storing into a hash first puts the list of things being assigned into flattening, eager context.
10:08 jnthn It then goes through them. If it sees anything that is ~~ EnumMap, it flattens that in. If it sees a Pair or Enum object, it will use it as a key/value pair. For anything else, it expects there to be a key followed by a value.
10:15 flussence so... turns out that "is rw" on sub params in zavolaj doesn't actually have any effect - they're writable even without it.
10:16 flussence .oO( which is nicer than the alternative, being unmodifiable in spite of it... )
10:20 moritz jnthn: the question is, does the default .new/.bless bind or assign hash attributes?
10:20 jnthn moritz: Assign.
10:20 jnthn moritz: Same for scalars and arrays.
10:21 moritz that's... odd
10:21 moritz r: class A { has @.a }; say A.new(a => [1, 2, 3]).a.elems
10:21 p6eval rakudo 1fe39c: OUTPUT«3␤»
10:21 moritz if it's assignment, why does it flatten?
10:21 moritz special case?
10:21 jnthn Because masak demanded that work so we somehow made it do so, I think... :)
10:22 jnthn r: my $x = [1, 2, 3]; class A { has @.a }; my $a = A.new(a => $x); say $a.a.elems
10:22 p6eval rakudo 1fe39c: OUTPUT«3␤»
10:22 jnthn r: my $x = [1, 2, 3]; class A { has @.a }; my $a = A.new(a => $x); $x.push(4); say $a.a.elems
10:23 p6eval rakudo 1fe39c: OUTPUT«3␤»
10:23 jnthn ah, yes
10:24 jnthn We explicitly decontainerise.
10:26 Psyche^ joined #perl6
10:31 godfrey999 joined #perl6
10:50 tokuhiro_ joined #perl6
10:50 JimmyZ joined #perl6
10:57 Guest39567 joined #perl6
11:04 mikemol joined #perl6
11:11 GlitchMr joined #perl6
11:13 lumi_ r: sub foo { 1 }; try eval 'foo() = 3' ; say $!.perl
11:13 p6eval rakudo 1fe39c: OUTPUT«X::Assignment::RO.new()␤»
11:13 lumi_ r: sub foo { my $x }; try eval 'foo() = 3' ; say $!.perl
11:13 p6eval rakudo 1fe39c: OUTPUT«X::AdHoc.new(payload => "Cannot assign to a readonly variable or a value")␤»
11:13 lumi_ Does this make sense?
11:13 apejens joined #perl6
11:13 lumi_ Should it be the same exception?
11:14 JimmyZ r: sub foo { my $x }; try eval 'foo() = 3' ;
11:14 p6eval rakudo 1fe39c:  ( no output )
11:19 dukeleto joined #perl6
11:43 colomon n: say and die 3
11:43 p6eval niecza v19-13-g442e075: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'and' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1402 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /home…
11:43 Khisanth joined #perl6
11:44 brrt joined #perl6
11:44 Coleoid joined #perl6
11:44 benabik joined #perl6
11:44 preflex joined #perl6
11:44 Exodist joined #perl6
11:44 aloha joined #perl6
11:44 rsimoes joined #perl6
11:44 c1sung joined #perl6
11:44 baest joined #perl6
11:44 domidumont joined #perl6
11:44 wolong joined #perl6
11:44 Tene joined #perl6
11:44 pnu joined #perl6
11:45 JimmyZ r: sub foo { my $x; say 'ehhl'; }; try eval 'foo() = 3' ;
11:45 p6eval rakudo 1fe39c: OUTPUT«ehhl␤»
11:45 colomon n: module M { }; say 42 ~~ M
11:45 p6eval niecza v19-13-g442e075: OUTPUT«Unhandled exception: Unable to resolve method ACCEPTS in type M␤  at /tmp/86dw2hnyuj line 1 (mainline @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3918 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3919 (module-CORE @ 562) ␤  at /home/…
11:50 colomon n: say 'foo123bar' ~~ /foo <( 123 <( bar/
11:50 p6eval niecza v19-13-g442e075: OUTPUT«#<match from(3) to(9) text(123bar) pos([].list) named({}.hash)>␤»
11:51 dukeleto joined #perl6
11:55 HarryS joined #perl6
12:00 colomon n: my $p = 'a' ~~ /$<foo>='a'/;  my $q = $p.clone
12:00 p6eval niecza v19-13-g442e075: OUTPUT«Potential difficulties:â�¤  $q is declared but not used at /tmp/BGRHrdSIGd line 1:â�¤------> [32mmy $p = 'a' ~~ /$<foo>='a'/;  my [33mâ��[31m$q = $p.clone[0mâ�¤â�¤Unhandled exception: Representation P6cursor does not support cloningâ�¤  at /home/p6eval/niecza/lib/…
12:00 bbkr1 that's weird...
12:03 bbkr1 Is test correct here? I haven't found anything in spec saying that match object cannot be cloned.
12:04 colomon bbkr1: darned if I know.  I assume it can, but I don't know for sure that's the case.
12:04 bbkr1 colomon: after $dayjob I'll fix my test commits that compare rakudo error messages so they check thrown exceptions (as moritz explained) to avoid niecza conflicts
12:05 colomon That will just cause a different set of niecza conflicts (no exceptions), but it's a good plan because they will be much better tests with the exception check.
12:05 colomon bbkr1++
12:06 * colomon just realized his computer has now been backing up his family's digital pictures for over 12 hours now, and it's still in 2011
12:11 zhutingting joined #perl6
12:13 cognominal_ joined #perl6
12:20 cognominal_ .ms?
12:21 cognominal_ oops
12:21 flussence that's a lot of pics... I think the ones I've got still fit on one SD card :)
12:23 colomon flussence: there are probably duplicates involved... and it's backing it up across cable internet, so I doubt the upload time is particularly fast.  (Downloading to my NAS at my in-laws' house.)
12:24 daniel-s_ joined #perl6
12:24 daniel-s_ hi
12:25 moritz hi daniel-s_
12:25 daniel-s_ rakudo: say "hi there daniel-s!"
12:25 p6eval rakudo 1fe39c: OUTPUT«hi there daniel-s!␤»
12:25 daniel-s_ :) hi p6eval
12:26 daniel-s_ so, I have never been that interested in how compilers work, but I have recently had a little project in which I need to read a particular file format
12:26 daniel-s_ I tried the first time, basically it's really long and has a whole bunch of really complicated loops and regular expressions
12:27 daniel-s_ ...then I read a book on compiler design :)
12:27 moritz :-)
12:27 daniel-s_ when you have created tokens and you're parsing the tokens, what goes on the non-leaf nodes?
12:28 daniel-s_ that's where I'm stuck, I'm trying to write a recursive loop that creates the syntax tree. From there I'm pretty much set
12:28 tadzik are you reading "Let's Build a Compiler", by any chance?
12:28 daniel-s_ should I be creating a new token that I call something like, "expression token"
12:29 moritz daniel-s_: with "token", do you mean the piece of text just read, or a piece of the AST?
12:29 daniel-s_ Fundamentals of Compilers, an introduction to computer language translation
12:29 daniel-s_ Karen A. Lemone 1992 0-8493-7341-7
12:30 daniel-s_ Before I started reading I thought it was going to be a horrible scary book (I never did computer science)
12:30 daniel-s_ but it's actually really simple and easy :)
12:30 moritz maybe I should read it too :-)
12:31 moritz daniel-s_: there are different approaches, so without a bit more context it's hard to answer the question
12:31 moritz the first is the classical compilation in phases
12:31 moritz first you tokenize the whole file
12:31 daniel-s_ I started this morning, I thought I would read it through (it's only 150 pages) then write my interpreter, but I keep getting impatient and will read a chapter, implemented, get stuck, then read the next chapter and get unstuck
12:31 moritz then you create a parse tree from the token
12:32 moritz and then the AST from the parse tree
12:32 daniel-s_ that's where I'm stuck (parse tree from tokens)
12:32 moritz and then the IR or assembler or from the AST
12:32 moritz daniel-s_: there are basically two approaches, recursive descending parsing
12:33 moritz daniel-s_: or using a tool like bison/yacc
12:33 moritz recursive descending is probably easier to understand
12:33 moritz there, you start with a top rule
12:33 moritz like 'program'
12:34 rafl joined #perl6
12:34 moritz and if a program is just a list of expressions, you just call 'expression' until all of the tokens are consumed
12:34 moritz and collect the return values from all 'expression' calls in an array, and return it
12:36 moritz http://cpansearch.perl.org/src/MORITZ/Math-Expression-Evaluator-v0.3.2/lib/Math/Expression/Evaluator/Parser.pm is a recursive descending parser for mathematic expression
12:37 moritz http://cpansearch.perl.org/src/MORITZ/Math-Expression-Evaluator-v0.3.2/lib/Math/Expression/Evaluator/Lexer.pm for the tokenizer
12:37 arnsholt daniel-s_: Basically, what you label the result of combining several tokens depends on how it will combine with other things to make larger pieces of structure
12:39 daniel-s_ OK. I will read the two chapters on parsing and give it another go tomorrow. It got to 9:30 and I gave up and came back home
12:39 daniel-s_ By the way, do you guys often do all nighters?
12:40 daniel-s_ I did, the first time a few weeks ago because there was something I really needed to get done. Absolutely horrible!
12:40 daniel-s_ it's not nearly as glamorous as I had been led to believe
12:40 arnsholt I've been known to do them, but not because I like it =)
12:40 arnsholt Necessity is the mother of invention, and all that
12:41 bbkr1 Laziness s the mother of invention :)
12:41 tadzik yes, exactly :)
12:41 * [Coke] misreads X::OutOfRange as X::OutRage
12:41 dalek roast: 6acf7cf | (Solomon Foster)++ | S02-types/hash.t:
12:41 dalek roast: Fudge for niecza.  (And another new test that is not at all Niecza friendly. Hmm.)
12:41 dalek roast: review: https://github.com/perl6/roast/commit/6acf7cf454
12:41 dalek roast: 66bf9aa | (Solomon Foster)++ | S03-operators/precedence.t:
12:41 dalek roast: Fudge for niecza.
12:41 dalek roast: review: https://github.com/perl6/roast/commit/66bf9aad6b
12:41 dalek roast: dc9f15f | (Solomon Foster)++ | S (7 files):
12:41 dalek roast: Lots of niecza fudges.
12:41 dalek roast: review: https://github.com/perl6/roast/commit/dc9f15faa2
12:43 daniel-s_ I like the bill gates quote, if he has a difficult problem he'll give it to a lazy person because they will find a way to make it easy :)
12:44 flussence just make sure they're genuinely lazy, and not just dumb :)
12:44 [Coke] yay. dry run from cron now has pugs failing no spec tests, niecza failing 218, and rakudo failing 8.
12:45 * colomon almost has the number of niecza spectest failures down to something reasonable...
12:45 [Coke] (as opposed to yesterday, which was 1885, 99, and 8)
12:45 [Coke] colomon++
12:45 [Coke] you don't stay on top of it, people adding tests can easily screw you up :|
12:46 [Coke] (it is a nice problem to have, of course.)
12:46 * [Coke] does another spectest run in advance of the noon-eastern comparisonrun.
12:50 [Coke] Yay, still clean!
12:55 HarryS joined #perl6
12:56 JimmyZ [Coke]: how about rm_pasm now? :)
12:58 rafl joined #perl6
12:59 colomon [Coke]: biggest issue here was that my mono install was still borked, so I was getting large numbers of false failures in spectest runs.  I gave up entirely on keeping on top of things for a week or two.  But I finally figured out my mono problem yesterday evening, and now I'm trying to get on top of things again.
12:59 colomon n: sub foo($x where { $x == $y }, $y) { }
12:59 p6eval niecza v19-13-g442e075: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable $y is not predeclared at /tmp/EgxI56we7j line 1:â�¤------> [32msub foo($x where { $x == [33mâ��[31m$y }, $y) { }[0mâ�¤â�¤Potential difficulties:â�¤  $y is declared but not used at /tmp/EgxI56we7j line 1:â�¤------> [32msub …
13:01 [Coke] colomon++
13:02 dalek roast: 3257bad | (Solomon Foster)++ | S12- (2 files):
13:02 dalek roast: Fudge for niecza.
13:02 dalek roast: review: https://github.com/perl6/roast/commit/3257bad815
13:03 [Coke] JimmyZ: rm_pasm wasn't waiting on me, was it?
13:03 [Coke] ah, probably.
13:03 * [Coke] should at least get it up to date.
13:04 JimmyZ any reason it's not merged into trunk?
13:07 zhutingting joined #perl6
13:09 [Coke] JimmyZ: Lack of interest on my part to push it?
13:10 JimmyZ [Coke]: I don't know, actually ;)
13:18 localhost joined #perl6
13:19 MayDaniel joined #perl6
13:20 dalek roast: 11d7758 | (Solomon Foster)++ | S02-magicals/env.t:
13:20 dalek roast: Fudge for niecza.
13:20 dalek roast: review: https://github.com/perl6/roast/commit/11d7758c2a
13:28 gdonald joined #perl6
13:32 skids joined #perl6
13:33 atrodo joined #perl6
13:34 gdonald where to report a Rakudo compile issue?
13:35 masak rakudobug@perl.org
13:35 masak and/or here.
13:35 masak well, through some nopaste service, preferably.
13:41 bluescreen10 joined #perl6
13:52 birdwindupbird joined #perl6
13:55 tyatpi joined #perl6
14:04 sergot joined #perl6
14:04 sergot hi o/
14:06 GlitchMr joined #perl6
14:07 masak sergocie! \o/
14:12 diakopter X::OutRage
14:13 bbkr1 X::TrustMe::ImAnEngineer :)
14:14 tadzik :)
14:14 tadzik hey, why would that be an exception? :P
14:14 masak X::ImADoctor::Jim::NotACircusSeal
14:15 bbkr1 tadzik: because X::TrustMe::ImAnEngineer rethrows X::WhatTheF::DidJustHappen::Here :)
14:16 diakopter X::ThrowMe
14:16 masak what is this, Wonderland?
14:20 bluescreen10 joined #perl6
14:22 [Coke] Curious, sir.
14:23 prettyrobots joined #perl6
14:23 diakopter hm, where'd those unfertilized chicken embryos run off to
14:24 jnthn Accross the road?
14:24 flussence X::Frogger?
14:24 * masak .oO( shouldn't have put all those eggs in the same basket... )
14:25 pmichaud good morning, #perl6
14:25 moritz good am, pm
14:25 jnthn morning, pmichaud
14:25 PacoAir joined #perl6
14:25 pmichaud other things have come up around here, so I'm tuit-less until tomorrow afternoon :-/
14:26 masak pmichaud! \o/
14:26 jnthn Aww. Good luck with @other-thing
14:26 pmichaud (well, at least tomorrow afternoon)
14:26 masak yes, good luck.
14:26 pmichaud who is doing this month's rakudo release?
14:26 pmichaud (compiler release)
14:26 tadzik I think I do
14:26 tadzik or maybe I'm August
14:26 masak no, I am.
14:26 moritz 2012-07-19   Rakudo #54 masak
14:26 moritz 2012-08-23   Rakudo #55 tadzik
14:26 tadzik yep, I'm August
14:27 tadzik aye
14:27 moritz September is free
14:27 moritz October is pmichaud
14:27 moritz sorry, PerlJam
14:27 * masak .oO( October is p<tab> ) :)
14:27 moritz right :-)
14:27 pmichaud I'm thinking that I want to start bumping PARROT_RELEASE only when we need a new version of Parrot
14:28 moritz +1
14:28 masak I won't have time to ram D2 into the July release, I'm afraid. but I'll probably get started on it before Thursday.
14:28 moritz so, we downgrade it to 4.4.0 ?
14:28 pmichaud yes, back it down to 4.4.0
14:28 pmichaud unless there's something in 4.6.0 that we think we need
14:28 moritz fwiw after 4.6.0 there'll be the io_cleanup merge (I hope), to which I plan to upgrade nearly immediately
14:28 pmichaud I'll try to get the release guide updated with this; but if not -- masak++ you know what to do :)
14:29 pmichaud will the io_cleanup merge involve patches to rakudo/nqp ?
14:29 moritz yes
14:29 pmichaud okay, so we'd have to bump then.
14:30 moritz (setting encoding on the socket, for one)
14:30 pmichaud sounds good
14:30 moritz that'll explain how $sock.recv manages to return a Str, not a Buf :-)
14:30 moritz on which our users currently rely
14:31 tadzik ew
14:31 masak pmichaud: gotcha. we stick to 4.4.0, and I update the release guide unless you beat me to it.
14:32 pmichaud +1 and thanks
14:32 pmichaud I expect to be more available again tomorrow.
14:32 flussence if 4.4.0 means I don't need to randomly insert -G flags into nqp's makefile, +1 to that :)
14:32 dalek nqp: 8cbe162 | moritz++ | tools/build/PARROT_REVISION:
14:32 dalek nqp: downgrade parrot to 4.4.0
14:32 dalek nqp:
14:32 dalek nqp: there was no reason to require 4.5 over 4.4, so we can depend on
14:32 dalek nqp: an older parrot (but it still works on the newer one)
14:32 dalek nqp: review: https://github.com/perl6/nqp/commit/8cbe162109
14:33 jnthn flussence: Does the Rakuod you get out in the end work oK?
14:33 jnthn *Rakudo, *ok :)
14:33 jnthn (with the flags, I mean)
14:34 flussence yep, I was doing some messing around with nativecall on it this morning :)
14:43 arnsholt What kind of NativeCall messing around, OOC?
14:46 * [Coke] grumbles about autogenerated tests in roast again (making them hard to fudge)
14:47 bbkr1 autogenerated?
14:47 nightlord joined #perl6
14:47 [Coke] s/auto//
14:47 [Coke] some of the trig stuff is (rightfully) generated so that it's easier to maintain and test edge cases.
15:08 kresike bye all
15:10 cognominal__ joined #perl6
15:13 cognominal__ joined #perl6
15:20 thelazydeveloper joined #perl6
15:22 gdonald joined #perl6
15:24 daxim flussence++  # hypotenuses
15:25 thou joined #perl6
15:25 flussence heh, didn't think anyone would notice that :)
15:26 * flussence -> decommute
15:27 MayDaniel joined #perl6
15:40 xinming joined #perl6
15:41 * [Coke] can get about 100 more passes if he could fudge S32-trig/sin.t ... and presumably 100 more from cos and tan
15:55 [Coke] so quiet today.
15:56 diakopter .
15:59 benabik joined #perl6
15:59 sirrobert joined #perl6
15:59 sirrobert Why does this happen?:
15:59 sirrobert class A { has $.str }; my $a = A.new(str => 'foo'); say $a.str;
15:59 sirrobert r: class A { has $.str }; my $a = A.new(str => 'foo'); say $a.str;
15:59 p6eval rakudo 1fe39c: OUTPUT«foo␤»
16:00 sirrobert r: class B { has $.str; submethod BUILD {}  }; my $b = B.new(str => 'foo'); say $b.str;
16:00 p6eval rakudo 1fe39c: OUTPUT«Any()␤»
16:00 dukeleto joined #perl6
16:00 sirrobert Adding an empty submethod BUILD {}'
16:00 sirrobert makes it behave in a way I don't understand
16:02 [Coke] unhelpfully, presumably you are overriding the builtin BUILD, and not dispatching to it, so you have to replace its functionality.
16:02 sirrobert ok, hmm.  How can I apply a mixin to an instance during construction?
16:03 sirrobert what's the best way to do that?
16:03 sirrobert in BUILD?
16:03 [Coke] r: class B { has $.str; submethod BUILD(:$arg) { $.str = $arg } }; my $b =B.new(str => 'foo'); say $b.str;
16:03 p6eval rakudo 1fe39c: OUTPUT«===SORRY!===␤Virtual call $.str may not be used on partially constructed objects␤at /tmp/MAwUBpqRbB:1␤»
16:04 jnthn r: class B { has $.str; submethod BUILD(:$!str) { }; };  my $b =B.new(str => 'foo'); say $b.str;
16:04 sirrobert I don't know where to find docs on BUILD ... are there any yet?
16:04 p6eval rakudo 1fe39c: OUTPUT«foo␤»
16:04 [Coke] jnthn: looks magicy.
16:04 sirrobert (thanks, jnthn and COKE =)
16:05 sirrobert er [Coke]
16:05 sirrobert heh
16:05 jnthn sirrobert: Not sure p6doc has anything on BUILD yet. moritz++ did a good blog post on it
16:05 [Coke] sirrobert: S12, I think.
16:05 [Coke] jnthn: http://perlgeek.de/blog-en/perl-6/object-construction-and-initialization.html ?
16:05 lue joined #perl6
16:06 sirrobert thanks; reading
16:07 jnthn sirrobert: http://perlgeek.de/blog-en/perl-6/object-construction-and-initialization.html
16:07 jnthn ah, [Coke] beat me to finding it
16:07 sirrobert thanks =)
16:12 cognominal joined #perl6
16:13 sirrobert that clarified it.  Thanks all.  I'll put a up a blog post about it in a min.
16:17 thou tadzik: do you have an example of any module that includes C code as part of it (to be used via NativeCall)? or an idea of how you think such a thing would be structured and built, or what tools need to be developed to make that happen? I just started playing w/ a simple Term::Curses module, and need some helper functions to work around macros in the curses API.... I have it working, but just with is native('term-curses.dyl
16:17 thou ib') and manual build of the lib.
16:18 thou maybe it's premature to worry about packaging on that kind of thing
16:21 arnsholt AFAIK we don't have any modules that have C code in them as well
16:21 arnsholt How complicated are the macros you're replacing?
16:21 arnsholt You might be able to replicate them with pure Perl code
16:25 prettyrobots joined #perl6
16:26 thou arnsholt: the problem i have is that the curses api does stuff like:  getyx(WINDOW *, int y, int x). this is a macro that uses the opaque WINDOW * object to get out the values, and stores them into y and x (notice those are not pointers -- the macro assigns directly)
16:27 thou so void term_curses_getyx(WINDOW *win, struct Point *p) { getyx(win, p->y, p->x); }
16:28 MayDaniel_ joined #perl6
16:28 thou i'm using a class Perl is repr('CStruct') to get the values back out
16:28 thou i can't avoid the macro, afaik, the curses api doesn't provide a non-macro way to (portably) extract those values
16:30 mucker joined #perl6
16:30 geekosaur it doesn't.  it's a mess
16:32 thou this is kind of getting off-topic, but, "Also, ncurses meets the XSI requirement that every macro entry point have a corresponding function which may be linked (and will be prototype-checked) if the macro definition is disabled with #undef. "
16:34 thou but i couldn't seem to get that to work (i tried stuff like sub getyx(OpaquePointer, int is rw, int is rw) (to try to say "I'm passing a pointer-to-int"), but it (not surprisingly, to me at least) segfaults
16:35 * [Coke] needs to add the timings to the test runs. I'd be interested to see how long pugs takes to pass its 40
16:35 [Coke] % of rakudo's tests.
16:36 [Coke] s/see/track/
16:47 arnsholt thou: Oh! I see. Yeah, I've no good ideas then
16:48 arnsholt But if the signature is void getyx(WINDOW *, int *, int*) it might be better to make it sub getyx(OpaquePointer, CArray, CArray) and use one-element arrays
16:49 arnsholt I'm not at all certain that int is rw is supposed to work
16:50 arnsholt Speaking of #undef and such, seeing how you're using (under the hood, that is) dlopen and friends to get at the symbols, the function equivalents should be directly available without any further hackery
16:52 arnsholt Also, given that curses is vaguely objecty, you might want to look at the CPointer REPR
16:53 thou arnsholt: yes, i was considering using CPointer. it turns out the doc i was reading is wrong, not *all* of the macros have function implementations. from curses.h:  /* These pseudo functions are always implemented as macros: */  #define getyx(win,x,y)
16:54 thou there *is* a non-portable function available in ncurses, so i could just cheat and use that. thanks for the tip about single-element CArray, that makes sense
16:55 PerlJam seems like zavolaj should provide handy aliases for the one-element CArray of int and str
16:56 PerlJam (assuming that works)
17:03 jnthn I suspect it should make the "is rw" syntax map to that trick :)
17:18 crab2313 joined #perl6
17:20 snearch joined #perl6
17:23 seldon joined #perl6
17:33 nodmonkey joined #perl6
17:35 GlitchMr joined #perl6
17:39 birdwindupbird joined #perl6
17:39 [Coke] colomon: so close.
17:39 [Coke] "Impl",      "pass","fail","todo","skip","plan","spec"
17:39 [Coke] +# 07/16/2012 - rakudo++ (22933); niecza (89.88%); pugs (39.63%)
17:39 [Coke] +"niecza",     20613,     1,   738,  1472, 22824, 24361
17:39 [Coke] +"pugs"  ,      9089,     0,  3338,  1603, 14030, 24223
17:39 [Coke] +"rakudo",     22933,     8,   645,  1829, 25415, 24361
17:40 [Coke] rakudo is failing tests in : S06-routine-modifiers/lvalue-subroutines.rakudo S19-command-line/dash-e.t
17:41 [Coke] niecza failed one test: niecza failed: S19-command-line/dash-e.t
17:41 colomon [Coke]: works fine on my system
17:42 [Coke] r: say 22933*.4-9089
17:42 p6eval rakudo 1fe39c: OUTPUT«84.2␤»
17:45 kst joined #perl6
17:47 sorear good * #perl6
17:47 sorear colomon: pong
17:48 colomon sorear: .... GIVE ME A Minute to swap back into my main memory in the issue I had found.
17:49 colomon ah, in Utils.pm
17:49 colomon you switched it to proto sub is_run(|$) is export { * }
17:49 colomon (six months ago)
17:49 colomon in niecza, that gives you
17:49 colomon Unsupported use of | with sigil; nowadays please use | without sigil at /Users/colomon/tools/niecza/t/spec/packages/Test/Util.pm line 7:
17:49 colomon ------> [32mproto sub is_run(|$[33m�[31m) is export { * }[0m
17:50 colomon dunno if that is a concern or not, but I thought I should point it out.
17:50 thou is there a way to declare attribute has Int $.y is rw, such that $object.y += 1 will call method y(Int $val) { call_sub_with($val); } ?
17:50 MayDaniel joined #perl6
17:51 thou i think i can declare method y() is rw { ... }, but how do i hook that up to get the $val and do something with it?
17:51 * colomon is having one of those days.... precipitated a 40-minute tantrum at the grocery store by not buying cookies with cream ice cream sandwiches
17:52 sorear thou: you can do Proxy.new(FETCH => sub () { fetch; }, STORE => sub ($new_val) { store; })
17:52 sorear s:g/sub/method/
17:53 thou sorear: ah, Proxy. ok, thanks. is this ... idiomatic, or is it generally considered smelly code?
17:53 sorear colomon: we decided that |$foo was subtly wrong because the object being bound wasn't _really_ a scalar
17:53 sorear thou: it's idiomatic code, but the relevant spec parts are a bit smelly imo
17:53 thou ok :-)
17:54 sorear colomon: so the spec got changed to allow |foo, with |$foo as an obsolescent compatibility form
17:54 sorear colomon: if rakudo supports |foo, change it, otherwise #OK use of | with sigil
17:58 jnthn It doesn't yet :(
17:59 jnthn After I'm done with QAST, I should really look at that.
17:59 jnthn Will need to leave in compat for the old way too I guess...
18:02 PacoAir joined #perl6
18:05 REPLeffect joined #perl6
18:07 thou sorear: rakudo isn't recognizing $new_val, it's saying it's not declared at the STORE => method($new_val) line. do you happen to know if that's a rakudo bug or ? any existing Proxy code out there?
18:09 thou hmmm, https://github.com/perl6/roast/blob/master/S06-routine-modifiers/proxy.t    ; looks correct according to that
18:09 colomon sorear++
18:11 tyatpi joined #perl6
18:12 dukeleto joined #perl6
18:14 thou ah, i had syntax error, needed method ($foo) # Space before parens
18:15 Chillance joined #perl6
18:17 telex joined #perl6
18:20 dukeleto joined #perl6
18:24 cognominal_ joined #perl6
18:37 arnsholt thou: (sorry, went afk for a while) If there're normal functions available, I'd go for those for a first implementation
18:37 arnsholt Worry about the finer points later
18:38 arnsholt Also, are there many other curses implementations in active use that aren't ncurses?
18:38 thou right. no, i don't think so
18:39 sorear arnsholt: pdcurses?  maybe bsd curses
18:39 geekosaur System V curses (Solaris, HP/UX, etc.)
18:40 sorear is BSD curses actually a thing?  my osx system seems to have ncurses
18:43 geekosaur freebsd, hence os x, went to ncurses years ago.  I don't know what netbsd or openbsd do
18:46 arnsholt Yeah, no idea about the other BSDs, but FreeBSD is definitely ncurses
18:46 arnsholt And I guess we can consider Solaris (or whatever it's called at this point) and HP/UX marginal ATM =)
18:47 geekosaur more to the point might be that there are some windows curses implementations based on pdcurses instead of ncurses
18:47 arnsholt That's a good point, though
18:52 sorear colomon: hmm, I kind of thought that a <( b <( c was undefined behavior
18:53 colomon sorear: all I know is it is spectested.  You can take that for exactly what it is worth.
18:53 colomon (explicitly spectested, I mean, not just an accident)
18:53 sorear ah.
18:54 sorear if it's spectested, it's not undefined behavior
18:55 colomon or someone mistakenly wrote a spectest.  :)
19:01 PerlJam It seems fine to me.
19:03 fibo joined #perl6
19:04 rurban joined #perl6
19:05 rurban parrot master and rakudo nom: /usr/src/parrot/rakudo-git/nqp/src/ops/nqp_dyncall_ops.c:3578: undefined reference to `_dlLoadLibrary'
19:06 diakopter there was recently a fix to nqp for dyncall build errors
19:06 diakopter tested on strawberry and activeperl.. not cygwin
19:06 rurban I'm on debian now and did --gen-nqp
19:06 diakopter oh
19:07 rurban no wait. this is cygwin...
19:07 rurban I'm testing many machines with tomorrows parrot-4.6.0 release
19:08 rurban Is rakudo closed already also or can I try to fix cygwin?
19:09 jnthn rurban: I'm guesisng it's NQP that needs the fix; there's still time for a cygwin patch.
19:12 brrt joined #perl6
19:13 rurban This one? https://github.com/perl6/nqp/commit/62b9fc9f16
19:19 tadzik thou: sure
19:19 tadzik thou: did you see Perl6-MPD or whathisname?
19:20 tadzik thou: https://github.com/tadzik/perl6-MPD/blob/master/lib/MPD.pm
19:20 thou tadzik: yes, but it just uses NativeCall on existing mpd library, doesn't package an extra .c source file and compile that to a lib
19:20 tadzik oh, right
19:20 tadzik then NativeCall uses that, methinks
19:20 tadzik in its tests
19:20 thou other NativeCall users do the same, i haven't seen any that have to supply their own
19:20 thou ah, hmmm
19:20 tadzik yeah, me neither
19:21 tadzik you were talking about curses. Do you hate macros as well? :)
19:21 tadzik thou: https://github.com/jnthn/zavolaj/tree/master/t has C files which it compiles (I think)
19:21 thou i'll look at that
19:25 rurban dyncall creates elf objects files on cygwin. nice.
19:26 dukeleto joined #perl6
19:30 not_gerd joined #perl6
19:30 not_gerd hello, #perl6
19:31 not_gerd rurban: NQP should build on Cygwin (at least it did 4 days ago)
19:31 rurban For now the cygwin workaround for dyncall is quite heavy, make in all 3 dyncall subdirs and mv the build_out files into .
19:33 brrt joined #perl6
19:36 rurban but maybe I have left some elf files there...
19:40 brrt joined #perl6
19:40 brrt r: pir::load_language("NQP")
19:40 p6eval rakudo 1fe39c: OUTPUT«"load_language" couldn't find a compiler module for the language 'NQP'␤  in block <anon> at /tmp/Gl7PP8Uh3d:1␤␤»
19:41 rurban yes, my fault. make didn't pick up the arch change after rsync.
19:41 brrt r: pir::load_language("nqp")
19:41 p6eval rakudo 1fe39c: OUTPUT«"load_language" couldn't find a compiler module for the language 'nqp'␤  in block <anon> at /tmp/oug0XEgF_E:1␤␤»
19:41 rurban p Configure.pl --gen-nqp; mkdir /usr/local/lib/parrot/4.6.0/languages/nqp: Permission denied
19:41 rurban Should'nt there be a sudo check?
19:42 cognominal joined #perl6
19:42 rurban with installed parrot
19:46 rurban sudo make install for --gen-nqp is needed
19:51 moritz yes, would be nice to have an option that does sudo on install
19:52 mauke joined #perl6
20:01 Timbus joined #perl6
20:01 sivoais joined #perl6
20:01 rurban make test for rakudo/nom on debian and cygwin ok with installed parrot-4.6.0
20:14 dalek roast: 6d2b72c | (Pawel Pabian)++ | S06-multi/redispatch.t:
20:14 dalek roast: change test to avoid comparing rakudo-specific error messages
20:14 dalek roast: review: https://github.com/perl6/roast/commit/6d2b72c731
20:14 dalek roast: 2f85a48 | (Pawel Pabian)++ | S03-operators/precedence.t:
20:14 dalek roast: avoid checking rakudo-specific error
20:14 dalek roast:
20:14 dalek roast: I could not use X:: here as it still throws X::AdHoc.
20:14 dalek roast: I also could not switch to eval_dies_ok as evaluated code has "die" in
20:14 dalek roast: it - it will be impossible to say if code died to compilation failure
20:14 dalek roast: or die inside caused it.
20:14 dalek roast: So I reversed test logic and I'm checking if die in evaluated code was
20:14 dalek roast: not executed by comparing $! value after eval.
20:14 dalek roast: review: https://github.com/perl6/roast/commit/2f85a48f15
20:14 dalek roast: e9acfaf | (Pawel Pabian)++ | S12-subset/subtypes.t:
20:14 dalek roast: avoid checking rakudo-specific error in test
20:15 dalek roast:
20:15 dalek roast: Remains fudged for Niecza but with different reason.
20:15 dalek roast: review: https://github.com/perl6/roast/commit/e9acfaf0f9
20:17 bbkr I'm not sure how to modify https://github.com/perl6/roast/commit/84fa0c2df0af6c499b44b3bc161653fd5ddf1ae1 test to be Niecza-compatible
20:19 masak bbkr++ # nice work on tests
20:19 moritz bbkr: is that behavior specced?
20:19 moritz or is that a limitation in rakudo?
20:20 moritz nr: class A { has Array $x .= new }; A.new
20:20 p6eval niecza v19-13-g442e075: OUTPUT«Unhandled exception: Unable to resolve method ctxzyg in type Method␤  at /home/p6eval/niecza/src/NieczaPassSimplifier.pm6 line 162 (run_optree @ 8) ␤  at /home/p6eval/niecza/src/NieczaPassSimplifier.pm6 line 19 (NieczaPassSimplifier.invoke_incr @ 5) ␤  at …
20:20 p6eval ..rakudo 1fe39c: OUTPUT«===SORRY!===␤Cannot use .= to initialize an attribute at line 2, near " }; A.new"␤»
20:20 sorear bbkr: proper form these days is to smartmatch on types like X::Foo
20:20 sorear bbkr: this doesn't work on niecza, I know :|  but it's clearly the right way going forward
20:21 moritz sorear: do you think the example above (has Type $.x .= new) should work?
20:21 sorear moritz: Yes
20:21 moritz then the proper thing is to test that it works
20:21 moritz and then both rakudo and niecza fail the test
20:21 moritz except that rakudo has the nicer error message
20:22 bbkr I'll reverse test logic and fudge it for Rakudo and Niecza
20:22 sorear good point, I wasn't even looking at the test itself :D
20:22 sorear moritz: saying that Rakudo has the nicer error message implies that Niecza has an error message at all, which I would dispute :D
20:23 moritz sorear: it prints something in the case of an error, so I'd call it an "error message" :-)
20:23 bbkr also RT should be reopened here, am I right?
20:23 moritz yes
20:23 rurban debian 64bit: t/spec/S32-io/IO-Socket-INET.t Failed tests:  1-17
20:24 moritz woah
20:24 moritz rurban: can you paste the output from running  ./perl6 -Ilib t/spec/S32-io/IO-Socket-INET.t  please?
20:24 moritz erm, better to nopaste :-)
20:24 rurban cygwin has only some filespec tests and dash-e.t failing
20:24 rurban sure. just redoing it
20:26 [Coke] masak: pugs spectesting back up and running. Now we just need someone to write some haskell. ;)
20:26 masak [Coke]: :)
20:26 masak [Coke]: my first priority is still $grant, sadly.
20:26 alester joined #perl6
20:26 rurban 'No such method 'encoding' for invocant of type 'Socket'
20:26 masak but I'm not averse to writing Haskell.
20:27 masak speaking of nothing, `git add -i` FTW! \o/
20:27 rurban moritz: http://nopaste.snit.ch/148448 No such method 'encoding' for invocant of type 'Socket'
20:29 [Coke] your mention of grant reminds me to poke pmichaud for a grant report.
20:29 masak I was just bitten by a logical bug -- sprintf not matching the number of args to the number of directives.
20:29 masak feels like the compiler is doing less than it can there.
20:30 masak partly because sprintf encodes a sublanguage as a dead string.
20:30 masak like Perl 5 does with regexes.
20:30 [Coke] "we completely rewrite regular expressions, but leave sprintf as is?"
20:30 masak :)
20:31 flussence is there any prior art we can steal? :)
20:31 masak there are several forces in play here. one the one hand, sprintf suffers from its first argument being a dead string.
20:31 bruges joined #perl6
20:32 flussence (preferably prior art that can be used in double-quoted strings without causing insanity)
20:32 masak on the other hand, it's a very convenient and useful encoding of formats, and the mixing of constant string values and directives is *deliberate* and actually the very reason we use sprintf.
20:32 masak but to me it looks like a slang now that I think about it.
20:32 masak not a string.
20:33 masak well, hm.
20:33 masak in Druid I actually built strings and passed them to sprintf. I couldn't do that (as easily) with a slang. maybe.
20:33 dalek roast: 506d0a5 | (Pawel Pabian)++ | S12-class/attributes.t:
20:33 dalek roast: initialization of class attribute using .= should work
20:33 dalek roast:
20:33 dalek roast: IRC discussion in RT #74850
20:33 dalek roast: review: https://github.com/perl6/roast/commit/506d0a59c5
20:33 masak but most of the time I just have a constant string.
20:34 [Coke] I don't know what you mean by dead string.
20:35 [Coke] seems like writing a grammar for the sprintf format would be an obvious implementation.
20:35 rurban http://nopaste.snit.ch/148450 cygwin fails
20:35 [Coke] (except that passing what we have to sprintf() is obviouser)
20:36 moritz rurban: which rakudo branch are you on?
20:36 rurban moritz: nom
20:36 flussence .oO( U+1F4A1! )
20:36 jnthn moritz: When was .encoding added?
20:36 * [Coke] hurls http://www.tcl.tk/man/tcl8.6/TclCmd/format.htm for a slightly-different-from-ANSI version of sprintf.
20:37 rurban $ g br -r origin/HEAD -> origin/nom
20:37 jnthn moritz: could the earlier drop to an earlier Parrot version have caused it?
20:37 rurban parrot did not merge the io_cleanup1 branch yet
20:38 jnthn Aye, but the .encoding method could still have been a recent addition.
20:39 masak [Coke]: dead string as opposed to a sublanguage, which is syntax-checked with the rest of the program. even Perl 5 regexes are syntax-checked. not so sprintf format strings.
20:40 diakopter you might use a new quote mechanism
20:40 rurban PERL6LIB=lib:. ./perl6 t/spec/S06-routine-modifiers/lvalue-subroutines.rakudo runs only 8 tests, not 14
20:42 moritz d0dc2d33d0a5eabc1a781b52c253d1f1d85d0a61 in branch parrot-iocleanup1
20:42 moritz +        $PIO.encoding(nqp::unbox_s(PARROT_ENCODING(self.encoding)));
20:42 moritz looks like it might have caused that issue
20:43 rurban And one more issue: "SEGV in Parrot_CallContext_get_pmc_keyed_int" (61 lines) at http://nopaste.snit.ch/148452
20:43 moritz but, I have no idea if/how that commit made it into rurban++'s nom branch
20:43 moritz rurban: what does 'git describe nom' say on your rakudo repo?
20:44 rurban Ooh. I see the problem. my fault. sorry
20:44 rurban g diff origin/nom.. has this line added. $PIO.encoding(nqp::unbox_s(PARROT_ENCODING(self.encoding)));
20:45 moritz rurban: I'm relieved that I didn't mess up nom then :-)
20:45 rurban I'll redo all the rakudo tests now. I'm relieved also. Sigh
20:45 moritz it won't have any effect on non-socket tests
20:46 [Coke] masak: if I am bored I'll write up a grammar that matches the tcl one I sent.
20:46 moritz wow, that segfault is what, 4 nested runloops deep?
20:46 masak r: my %h = foo => 1, bar => 2; .say for (%h ==> map { .value })
20:46 p6eval rakudo 1fe39c: OUTPUT«1␤2␤»
20:46 masak r: my %h = foo => 1, bar => 2; .say for (%h ==> grep { .value == 2 })
20:46 p6eval rakudo 1fe39c: OUTPUT«"bar" => 2␤»
20:47 masak r: my %h = foo => 1, bar => 2; .say for (%h ==> map &key)
20:47 p6eval rakudo 1fe39c: OUTPUT«Cannot call 'map'; none of these signatures match:␤:(&code, *@values)␤␤  in block <anon> at /tmp/B0n2MdXjsl:1␤␤»
20:47 rurban 4 is my record :)
20:47 masak r: my %h = foo => 1, bar => 2; .say for (%h ==> map key)
20:47 p6eval rakudo 1fe39c: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&key' called (line 1)␤»
20:47 masak oh!
20:47 rurban I count even 5
20:47 masak r: say key (foo => 1)
20:47 p6eval rakudo 1fe39c: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&key' called (line 1)␤»
20:47 masak that explains it.
20:47 masak why is 'keys' a builtin sub but not 'key'?
20:48 flussence just throwing some ideas around: https://gist.github.com/3124942
20:48 moritz masak: because p5 has hashes, but no pairs
20:48 spider-mario joined #perl6
20:49 moritz masak: and we don't have subs for every possible method in every type below Cool
20:50 masak I've often felt that we builtinize too few of them. never felt that we builtinize too many.
20:51 * moritz feels the exact other way round
20:51 masak it's a good thing we're both on the project, then. :)
20:51 moritz too few masaks and too many moritzes
20:51 moritz or so :-)
20:51 sorear the problem with methods is that it's very difficult for the optimizer to statically prove that they haven't been overridden
20:51 not_gerd left #perl6
20:52 masak aye.
20:52 sorear "I guuess that makes me masak"
20:52 moritz well
20:52 masak I'm not favoring one over the other.
20:52 masak I'm saying we're not being very consistent about which methods we builtinize.
20:52 moritz in rakudo, we usually re-dispatch the sub form to the method form
20:52 moritz so we don't get any speed benefit from the sub form
20:52 rurban with pair you mean something like a cons cell?
20:52 moritz rurban: yes
20:53 moritz r: say (a => 1).WHAT
20:53 p6eval rakudo 1fe39c: OUTPUT«Pair()␤»
20:53 sorear but perl 6 does _not_ use cons lists
20:53 moritz ... except when you do :-)
20:53 masak unless you build them from Pairs.
20:54 rurban I see. Maybe I can add that to the coretypes of hash with fixed-size 1. https://github.com/rurban/coretypes
20:54 sorear moritz: there are complicated issues with this in niecza, mostly reducing to "what dynamic scopes is &take allowed to cross?"
20:56 snearch joined #perl6
20:57 rurban still: S06-routine-modifiers/lvalue-subroutines.rakudo loops into an recursion at test 9
20:57 brrt moritz: are your logs searchable?
20:57 moritz brrt: yes-ish
20:57 brrt great
20:57 moritz brrt: there's a "search" link, but the search isn't very good
20:58 fridim_ joined #perl6
21:24 brrt left #perl6
21:29 tyatpi joined #perl6
21:50 thou i have what seems like a bug to me, but maybe i'm not understanding scope / closure right:  https://friendpaste.com/53MKnWboUIKj7JwCqIQ5FW
21:51 thou i'd expect the $!repr attribute to be available in the anonymous sub that's assigned to the FETCH param in Proxy.new
21:51 jnthn thou: Which if you'd written an anonymous sub there would be fine. :)
21:51 thou but i have to alias it, or else i get an error. in this simplified test, i get an error "Native call expected object with CPointer representation, but got something else", which is a pretty nice error
21:51 jnthn thou: But it's an anonymous method.
21:51 jnthn So it gets its own self.
21:52 thou oh, right
21:52 thou hmmm, why *would* i want an anonymous method?
21:52 * thou checks if sub works OK
21:52 jnthn It'll work, but you probably need to take a $cont arg extra or some such
21:53 * thou copied from sorear++ and from S06 without understanding
21:53 thou i got a segfault w/ my more complex (Term::Curses) code instead of that nice error message
21:53 sorear I suspect that Proxy.new takes methods because someone wasn't thinking quite straight when they wrote that part of S06
21:53 jnthn sorear: That is also rather possible :)
21:55 thou i see on google old (2005-era) code using -> $val { pointy block }, which is prettier imo
21:59 thou i wonder if it would be possible to simplify all this with something like:  has $.foo :STORE({ store-func }) sugary adverbial goodness
21:59 thou or is that just another layer of indirection that'd be confusing
22:00 sorear I like is STORE
22:00 sorear maybe would be better to do 'is trigger'
22:01 sorear projects I'd like to do someday, partial list: go through the lists of Moose core and MooseX features and port as many as possible to Perl 6
22:01 sorear 'trigger' is the Moose core adverb that does what you want
22:01 thou ah, good point, i guess Moose has gotten some real-world feedback on this
22:01 mauke heh. stealing perl6 ideas back from perl5?
22:02 sorear mauke: it's more like stealing from perl6, since Moose was started by Pugs hackers
22:03 sorear I consider everyone who works on Moose today part of the perl6 community
22:03 sorear s/<( perl6/broader/
22:03 masak hm. not sure about that.
22:04 masak well, they're part of the Perl community that likes to think of Perl 6 as something serious.
22:04 masak lol, I blog'ded! http://strangelyconsistent.org/blog/july-16-2012-things-which-are-part-of-the-scenery
22:05 sorear moritz: I kind of dozed off yesterday, sorry :|
22:10 masak bbkr++ # I'm catching p6c emails, and you're everywhere, writing spectests
22:15 cognominal joined #perl6
22:31 cognominal joined #perl6
22:50 raiph joined #perl6
22:59 Coleoid joined #perl6
23:01 skids joined #perl6
23:22 awwaiid joined #perl6
23:27 masak 'night, #perl6
23:35 tokuhiro_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo