Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-08-29

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 * grondilu wants to create a infinite list of strings in lexicographic order
00:02 * grondilu though 'map *.base(36), 1..*' would do
00:02 grondilu *thought
00:04 colomon m: say 'a', *.succ ... 'zz'
00:04 camelia rakudo-moar ce2631: OUTPUT«a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp …»
00:05 colomon errr, come to think of it though, that's not lexicographic order
00:06 grondilu well, what I do want is my strings to be as small as possible, and still be in some order
00:06 colomon ah, well there's a definite order to the *.succ strings, they're just not in lexicographic order
00:07 grondilu how could I use more characters than just 'a'..'z'?
00:07 grondilu and I do need an infix comparison operator, though
00:07 colomon oh, that's easy
00:08 colomon m: say (32..1000).map(*.chr)
00:08 camelia rakudo-moar ce2631: OUTPUT«  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” …»
00:08 colomon etc
00:08 grondilu I want an infinite list
00:09 timotimo you could write a class that does Positional and implement at_pos by doing .chr :P
00:10 grondilu :/ that would be a hassle.  I don't get why '[before] *.base(36), 0..*' doesn't work :/
00:11 colomon grondilu: because base 36 isn't in lexographical order any more than base 10 is
00:26 colomon grondilu: https://gist.github.com/colomon/196e74c18c504d1150c4
00:26 colomon you can tweak @codes to control how quickly the string gets longer
00:30 grondilu it's hard for me to believe it's not easier to create an infinite ordered list of strings :/
00:32 grondilu I could of course use map *.Str, 0..* but I wanted to compress things a bit
00:32 BenGoldberg That wouldn't be in lexigraphical order.
00:33 grondilu I don't mind which kind of order as long as I have an order
00:33 grondilu m: say [<] map *.Str, 0..100; # just checking
00:33 camelia rakudo-moar ce2631: OUTPUT«True␤»
00:35 grondilu m: say [<] map *.fmt("%x"), ^10;
00:35 camelia rakudo-moar ce2631: OUTPUT«True␤»
00:36 BenGoldberg m: say [<] map *.fmt("%x"), ^11;
00:36 camelia rakudo-moar ce2631: OUTPUT«use of uninitialized value $/ of type Nil in string context  in block <unit> at /tmp/lc5aNFCnKB:1␤␤Error while creating error string: No exception handler located for warn␤»
00:37 BenGoldberg m: say '9' < 'a';
00:37 camelia rakudo-moar ce2631: OUTPUT«use of uninitialized value $/ of type Nil in string context  in block <unit> at /tmp/CnuFByDpmw:1␤␤Error while creating error string: No exception handler located for warn␤»
00:37 BenGoldberg Aha!
00:38 grondilu yeah I must not forget 0x
00:39 grondilu isn't there an extension of the printf format for base 36?
00:40 grondilu since Z is the last letter, it could be 0Z.  so *.fmt("0Z%Z")
00:43 grondilu also, if I define infix:«<=>» on a custom type, aren't infix:«<» and infix:«>» automatically defined as well?
00:44 colomon grondilu: quick answer is no
00:50 colomon grondilu: you can't make base lexicographic.
00:51 grondilu damn it
00:52 grondilu I just want a base method so that $a.base($base) < $b.base($base) if and only if $a < $b
00:53 colomon do you mean $a.base($base) lt $b.base($base) ?
00:53 grondilu yes
00:53 colomon that can't work with any normal base, that was the point of my above comment.
00:53 BenGoldberg You mean a numeric encoding, not necessarily a base.  Use the right terms, and people will be less confused ;)
00:54 colomon certianly a numeric encoding can be done, both BenGoldberg and I have suggested them
00:54 BenGoldberg m: sub encode($n is copy) { return '0' unless $n; $n = $n.base(2); 1 ~ encode($n.chars-1) ~ $n.substr(1) }; say map { encode($_) }, ^200;
00:54 camelia rakudo-moar ce2631: OUTPUT«0 10 1100 1101 1110000 1110001 1110010 1110011 11101000 11101001 11101010 11101011 11101100 11101101 11101110 11101111 111100000000 111100000001 111100000010 111100000011 111100000100 111100000101 111100000110 111100000111 111100001000 111100001001 1111000…»
00:55 colomon BenGoldberg++ # that's a lovely one
00:55 BenGoldberg There's a name for it, but I forget what ;)
00:56 BenGoldberg That one is asymtotically optimal, if you don't mind that it produces bits :)
01:01 grondilu so my challenge is:  find a sub f(Int $ --> Str) {...}  such that  f($a) lt f($b) if and only if $a < $b and with f($a) as short as possible.
01:03 grondilu maybe I should ask on stackexchange or something :)
01:07 grondilu or more precisely:  given an alphabet @abc and a subset Word of Str where /^^<@abc>+$$/; find a sub f(Int $n --> Word) {...} such that f is bijective and f($a) lt f($b) iff $a < $b
01:08 grondilu (if such a bijection exists, which I'm not sure of)
01:21 dalek roast: 7fc8efd | TimToady++ | S32-exceptions/misc.t:
01:21 dalek roast: update to new P5var warnings
01:24 dalek rakudo/nom: 54cd8fb | TimToady++ | src/ (3 files):
01:24 dalek rakudo/nom: update to new P5var warnings
01:24 dalek rakudo/nom: Also a start on implementing sigil-only variables, which parse but produce
01:24 dalek rakudo/nom: an erroneous QAST at the moment.  They do not, however, interfere with
01:24 dalek rakudo/nom: existing code, so in they go without a branch. :)
01:29 grondilu so I must give up on requiring a bijection.  Nevermind.  The problem remains.  Just need to rephrase it.
01:33 BenGoldberg You need a "universal coding", I think.
01:34 BenGoldberg The encoding() function I gave was a variation of the "Elias Omega Coding", modified to be able to represent 0
01:51 BenGoldberg m: sub encode($n is copy) { return 'a' unless $n; $n = $n.base(36); 'b' ~ encode($n.chars-1) ~ $n }; say map { encode(10 ** $_) }, 12..13;
01:51 camelia rakudo-moar ce2631: OUTPUT«bba7CRE66I9S bba83JLXPT2PS␤»
01:52 BenGoldberg Hmm... all of the 'overhead' is right at the front.  Maybe we can encode it!
01:53 colomon timotimo: oooh!  moar_jit is rakudobrew config
01:54 colomon recent addition.  :)
02:30 kyun NMAKE : fatal error U1077: “C:\ProgramData\Oracle\Java\javapath\java.EXE”: return code“0x1”
02:30 kyun Oh, I build jvm backend faild
02:34 colomon timotimo: https://gist.github.com/colomon/8e89203b8dd97b88cf56#comment-1290523
05:02 jack_rabbit Is there a reason the comparison operators need spaces on either side of them?
05:04 jack_rabbit r: my @nums = 1..50; my $v=0;loop (my $i=0;$i+12 < @nums.elems;$i++){my $w=[*] @nums[$i..($i+12)];if ($w>$v) {$v=$w;}};say $v;
05:05 jack_rabbit is fine, but
05:05 jack_rabbit r: my @nums = 1..50; my $v=0;loop (my $i=0;$i+12<@nums.elems;$i++){my $w=[*] @nums[$i..($i+12)];if ($w>$v) {$v=$w;}};say $v;
05:05 jack_rabbit is an error.
05:09 TimToady %foo<bar> is the postfix notation for a literal key, so less-than requires a space
05:10 TimToady Perl 6 is not optimized for golf
05:13 TimToady though when you think about it, real golf is not optimized for golf either...
05:14 TimToady you can't use your putter to get from a term to an infix, you need a longer club :)
05:30 jack_rabbit so, there's no way I can tell to assign an infinite list to an array variable. Someone suggested a sub that returns the list.
05:37 moritz and, if you can't assign, use binding (:=)
06:53 sergot m: say 1[1]
06:55 camelia rakudo-moar 54cd8f: OUTPUT«use of uninitialized value of type Nil in string context  in block <unit> at /tmp/L2iPiNIiD9:1␤␤use of uninitialized value of type Nil in string context  in block <unit> at /tmp/L2iPiNIiD9:1␤␤Error while creating error string: No exception handler …»
07:17 sergot TimToady: could you give us the answer here: https://rt.perl.org/Public/Bug/Display.html?id=121947 ? will be great :)
10:38 donaldh .tell jnthn NQPMatch objects are getting through add_inlining_info_if_possible in QAST::Want objects
10:39 donaldh .tell jnthn this is an odd one - https://gist.github.com/donaldh/f5502df973ec2b41a9c2 fixes it, but why?
10:43 moritz TimToady++ # getting rid if "Non-declarative sigil is missing its name"
10:45 dalek roast: 60951ad | (Elizabeth Mattijsen)++ | S03-operators/context.t:
10:45 dalek roast: Fix tests now that bare sigils are ok
10:47 moritz hoelzro: re "Include the offending variable name in uninitialized warning", commit 5f583edc15d779d2b200ca2850abca889107cc32: -- I intentially removed that, because it reported wrong variable names too often
10:52 moritz m: $@
10:52 camelia rakudo-moar 54cd8f: OUTPUT«===SORRY!===␤Unknown QAST node type NQPMu␤»
10:52 moritz that's LTA
10:53 * masak submits rakudobug
10:53 moritz TimToady: ^^ return self if $name eq '$' || $name eq '@' || $name eq '%' || $name eq '&';  this probably leaves $/.ast undefined/NQPMu
10:55 moritz hoelzro: perl6/doc htmlify.p6 spits out many "use of uninitialized value of type Nil in string context  in any enter at src/gen/m-Metamodel.nqp:3080" warnings; do you know where those come from?
10:56 masak moritz: it's a recent change in rakudo.
10:56 masak things like this are probably the culprit:
10:56 masak m: say ~(42 if 0)
10:57 masak moritz: TimToady ruminated over them in the backlog, that `if` is a tricky one here -- whether it should give back () or Nil
10:58 dalek roast: 40c5a41 | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
10:58 dalek roast: More test fixups after TimToady++'s work
11:07 lizmat r: my @a=({:a<1>}, {:b<1>}, {:a<1>}); my $with = &[evq]; @a .= uniq(:$with)); say @a
11:07 camelia rakudo-moar 54cd8f: OUTPUT«===SORRY!===␤Cannot find method 'returns'␤»
11:07 lizmat this seems to segfault in some situations during spectesting
11:09 FROGGS evq?
11:09 FROGGS r: my @a=({:a<1>}, {:b<1>}, {:a<1>}); my $with = &[eqv]; @a .= uniq(:$with); say @a
11:10 camelia rakudo-{parrot,jvm,moar} 54cd8f: OUTPUT«{"a" => "1"} {"b" => "1"}␤»
11:11 lizmat FROGGS: what is the diff ?
11:11 FROGGS s/evq/eqv/ and s/))/)/
11:11 FROGGS m: &[baz]
11:11 camelia rakudo-moar 54cd8f: OUTPUT«===SORRY!===␤Cannot find method 'returns'␤»
11:12 FROGGS LTA
11:12 * masak submits rakudobug
11:12 FROGGS masak++
11:13 masak I reiterate my question, though: why doesn't `(1, 2, 3) ~~ (1, 2, Int)` match?
11:15 FROGGS m: say (1, 2, 3) »~~« (1, 2, Int) # masak: you meant that?
11:15 camelia rakudo-moar 54cd8f: OUTPUT«True True True␤»
11:15 masak FROGGS: well, you can do that and it works.
11:16 masak FROGGS: but I'm more wondering why ~~ on the whole parcel doesn't DWIM and smartmatch 3 against Int.
11:20 masak or rather, since `(1, 2, 3) ~~ (1, 2, Int)` is False but `3 ~~ Int` is True, what kind of matching does happen, element-wise?
11:20 masak m: say (1, 2, (3, 4)) ~~ (1, 2, (3, 4))
11:20 camelia rakudo-moar 54cd8f: OUTPUT«False␤»
11:20 masak o.O
11:21 FROGGS rakudo/src/core/Parcel.pm:11:    multi method ACCEPTS(Parcel:D: $topic) { self.list.ACCEPTS($topic) }
11:22 FROGGS masak: it checks using === on the elems
11:24 masak m: say (3, 4) === (3, 4)
11:24 camelia rakudo-moar 54cd8f: OUTPUT«False␤»
11:24 masak FROGGS: that's just sad.
11:25 masak I vote for === being changed to ~~ for the elements.
11:25 dalek roast: d755436 | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
11:25 dalek roast: Add RT number
11:25 masak furthermore, I vote for the abolition of *, which is seldom used and mostly muddling up the semantics of list/parcel matching.
11:25 masak it has no "model integrity".
11:25 FROGGS masak: I am already spectesting that
11:25 masak and it's more-than-subsumed by the awesome matching powers of signatures.
11:27 jnthn masak++ # reporting the issue that bit me today :)
11:27 dalek roast: 23abe1b | (Elizabeth Mattijsen)++ | S32-list/uniq.t:
11:27 dalek roast: Mark test as skip because of segfault
11:33 colomon timotimo: I got some JIT timings for you last night.
11:33 colomon https://gist.github.com/colomon/8e89203b8dd97b88cf56#comment-1290523
11:35 colomon also, channel in general: I figured out that what's been blocking smoke testing for the last few days are hangs in Test-ClientServer and Chess
11:35 colomon I got a successful run last night
11:35 colomon by killing those tests manually
11:35 colomon 02-simple-socket.t hangs in the former
11:36 colomon pgn.t in the latter
11:36 dalek roast: 2b3a12a | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
11:36 dalek roast: Add test for #122646
11:38 FROGGS masak: that's the spectest using ~~: https://gist.github.com/FROGGS/80b086660badcf365e5a
11:40 FROGGS colomon: btw, v5 should be build- and testable now
11:40 masak FROGGS: only the first and maybe the last two look relevant, methinks.
11:47 colomon smoke test done: http://host07.perl6.com:8080/report
11:51 nwc10 jnthn: current --profile-comile http://ccl4.org/~nick/profile-1409312777.79459.html.gz
11:54 FROGGS masak: only t/spec/integration/advent2010-day12.t fails due to the change
11:55 FROGGS masak: fails with: Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏bar' (indicated by ⏏)
11:55 dalek rakudo/nom: b6b3f55 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
11:55 dalek rakudo/nom: A bare 'say' is now an exception
11:55 FROGGS lizmat++ # ohh nice!
11:55 dalek roast: fd376fc | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
11:55 dalek roast: Add test for bare say exception
11:56 lizmat it's runtime, not compile time yet
11:58 hoelzro_ moritz: I have a fix for the ~Nil problem; I'm just going to test it real quick
12:06 hoelzro ok, my patch fixes perl6/doc
12:06 hoelzro waiting for spectest
12:23 moritz hoelzro: but why does it try to stringify Nil? did it do that before the S17 merge too?
12:24 hoelzro it's because Mu.Stringy used to unconditionally call .Str
12:24 hoelzro I changed it yesterday so it doesn't, but I have a fix I'm testing right now for that
12:42 moritz hoelzro: htmlify makes quite some assumptions regarding the generated Pod tree
12:43 moritz hoelzro: and I don't want any regressions due to changed parsing or Pod tree to go unnoticed
12:43 moritz hoelzro: so I wonder if these Nil interpolations point to some new, deeper problem, or if they existed before, and were silent
12:44 moritz hoelzro: did you diff the output before and after the merge, for example?
12:44 hoelzro I can do that later today
12:44 moritz that would be cool
12:44 moritz also I noticed that it became much slower
12:44 moritz it ran in 41m18s today
12:44 moritz I remember more like 15 to 20m
12:44 hoelzro I'll test timing too
12:53 hoelzro ok, my fix for the Stringy stuff is clean
12:54 dalek rakudo/nom: 7c8a4a7 | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
12:54 dalek rakudo/nom: Fix problems with incomplete POD
12:54 dalek rakudo/nom: Still invoke $.Str from Stringy
12:59 moritz hoelzro: isn't Mu.Stringy a relatively hot path?
12:59 moritz I'm kinda worried about introducing a dynamic var there
13:02 hoelzro the dynamic var is only created for undefined invocants, though, if that helps
13:02 FROGGS that's what it was at the release: https://github.com/rakudo/rakudo/blob/5dd10bbc9f34a67e2751d49725a0bd05a37352c3/src/core/Mu.pm#L402
13:04 moritz hoelzro: yes, might help
13:07 FROGGS do we need the variable name in that warning at all?
13:07 FROGGS I mean, this often led to leaking internal variable names
13:12 hoelzro it's just a very nice-to-have, especially for people coming from Perl 5
13:14 flussence colomon: I've hacked around that Test-ClientServer/t/ hang for the time being, hope that helps.
13:20 BenGoldberg m: sub encode($n is copy) { my $m = 0; my $rest = ''; while ($n) { $n = $n.base(10); ++$m; $rest = $n~$rest; $n = $n.chars-1; }; $m.base(36)~$rest; }; say [lt] map { encode($_) }, ^2000
13:20 camelia rakudo-moar b6b3f5: OUTPUT«True␤»
13:20 BenGoldberg grondilu, there's a solution for you ^ :)
13:22 PerlJam BenGoldberg: you can shorten $n = $n.base(10) to $n.=base(10);  That'll help mitigate those extra chars you had to use to prepend
13:25 BenGoldberg It is a nearly-universal numeric coding, whose outputs are at most 2 letters longer than ordinary base 10.
13:26 BenGoldberg And, unlike ordinary base 10, the results are in lexigraphical order :)
13:35 hoelzro moritz: I found no performance issues, but I did find a regression
13:35 hoelzro the section links aren't being correctly generated
13:35 hoelzro I have to start getting to work, but I'll check it out tonight
13:40 dalek roast: 2759035 | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
13:40 dalek roast: TODO test for bare say being a compile time error
13:41 [Coke] lizmat: see also S16-io/bare-say.t
14:03 timotimo m: try EVAL "say"; say $!.WHAT; say $!.perl;
14:03 camelia rakudo-moar 187d75: OUTPUT«Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument␤  in block <unit> at /tmp/rvw2qgoPEO:1␤␤»
14:03 timotimo ... huh?
14:04 timotimo i wasn't able to find where that error message is currently implemented
14:04 lizmat atm, it is a say MMD candidate
14:06 dalek rakudo/nom: 1450e3e | (Elizabeth Mattijsen)++ | src/core/IO.pm:
14:06 dalek rakudo/nom: Remove bare say as a candidate
14:06 dalek rakudo/nom: We need a more comprehensive approach
14:14 PerlJam Seems to me you just add a "say" term (just like "now") that calls $*W.throw()
14:17 jnthn I should probably backlog properly, but - why aren't we stealing precisely the STD solution for say? :)
14:18 [Coke] I figure if it was easy, someone would have done it 4 years ago? ;)
14:18 jnthn Ok, fine, I'll do it :P
14:18 * jnthn looks at STD
14:19 PerlJam ah, STD is more general too in that it fixes this for many things.
14:19 TimToady except, of course, that it just uses a list
14:19 TimToady rather than having a trait
14:19 TimToady or a signature
14:20 timotimo ah, yeah, it has the %deftrap thing
14:20 timotimo jnthn: OK, you can do it :P
14:21 jnthn lizmat: https://github.com/perl6/std/blob/master/STD.pm6
14:21 TimToady jnthn: I'm this close to having anonymous rvalue variables working; they successfully declare a variable, but then lose track of it somewhere
14:22 TimToady so if I say: $; $ANON_VAR__1 = 42; say $ANON_VAR__1  then it prints 42
14:22 TimToady but $ = 42 gets a NQPMu
14:24 jnthn It may be easiest for me to look at a patch; working on the death trap first. :)
14:26 timotimo hm, so maybe it expects to build a QAST::Var somewhere, but if the name isn't set it doesn't end up assigning to the $var that would hold it
14:26 timotimo and then it puts $var into the qast tree without checking?
14:30 dalek rakudo/nom: c711b1e | TimToady++ | src/Perl6/Actions.nqp:
14:30 dalek rakudo/nom: latest version of rvalue $
14:30 jnthn TimToady: That often means you incorporated something into the QAST tree that was undefined; most often due to .ast on something make wasn't called on :)
14:31 TimToady but it's in the same path as a normal token variable, so it oughta return the ast the same way from there upward
14:34 mberends nwc10: yes! I'm currently at DebConf14 and one of my goals here is to become Debian Maintainer for MoarVM :-)
14:34 dalek rakudo/nom: dd580df | (Elizabeth Mattijsen)++ | src/core/Exception.pm:
14:34 dalek rakudo/nom: We don't need no bare exception either
14:34 nwc10 mberends: cool
14:34 nwc10 mberends: I don't know how many architectures it's currently portable to
14:35 nwc10 at one point it has worked on x86_64, x86, arm and ppc
14:35 mberends nwc10: surely just amd64
14:36 tadzik mberends: it runs on my ARM phone just fine :)
14:36 nwc10 the crazy bit was that ppc (big endian) was fairly easy, and ARM wasn't
14:36 nwc10 I don't have access to anything else useful, and haven't had time to check them recently.
14:37 nine moritz: I managed to write a failing test with only inline Perl 5: https://github.com/niner/Inline-Perl5/commit/de167995c90fe2cd2267ab699d50ca6a7895dcc4
14:38 nwc10 mberends: getting moarvm on debian (and hence rakudo available on more-than-just-parrot) would be really $expletive useful.
14:38 tadzik mberends: well, "just fine" is maybe a bit of an overstatement. It did run, but running nqp on top of it resulted in a mysterious sigpipe
14:38 japhb_ jnthn: re: the gist I sent you yesterday ... is it expected that if I create promises in a tree (starting tasks that themselves make promises), I need a fair amount of threads just to make any progress at all under r-j?
14:39 jnthn japhb: If you use "await" a bunch it's not smart enough (anywhere) to give the thread back to the scheduler for the time being.
14:40 jnthn japhb: That'll likely happen on MoarVM at some point in the not too distant future. On the JVM...continuation barrier stuff...mumble...argh...so yeah :)
14:41 jnthn (I really want to do it on JVM too, it's just I tried it once, and know there's some work to do)
14:42 lizmat I'm considering adding an "abspath" attribute to IO::Handle
14:43 japhb lizmat: as a cache, to avoid having to compute it if someone asks?
14:43 lizmat yes, because now we get a "rel2abs" call for every file test operation
14:44 lizmat and that's expensive
14:45 japhb Yeah, it is.  I haven't been able to follow the discussion -- was there any progress in making rel2abs any less expensive, or has it just hit a wall that we can't improve right now?  (And if so, what is that wall?)
14:45 lizmat for Unix we can simplify, but not for Win
14:46 lizmat in the best case, rel2abs is: return self.canonpath($path) if self.is-absolute($path);
14:47 lizmat the canonpath is rather extensive and involved
14:48 japhb lizmat: But is it *correct*?  There are so many edge cases in path canonicalization, I'm wondering if we even handle it properly (where "as well as Perl 5" would be a good start)
14:48 lizmat japhb: I only know that if a change the smallest thing, I get spectest errors  :-)
14:50 lizmat I guess another thing making this slow, is the forced runtime lookup of methods
14:51 lizmat method rel2abs( |c )               { $SPEC.rel2abs( |c )               }
14:59 * masak is thinking about smartmatching
15:00 masak here is the draft of my change so far: https://gist.github.com/masak/1322886ed7092c522bd8
15:00 masak a. smartmatch on lists/parcels becomes structural; that is, it does ~~ on its elements. the fallout is that `(1, 2, 3) ~~ (1, 2, Int)` does what I expect.
15:01 masak b. the funky behavior with whatevers in lists/arrays/parcels goes away. whatevers now mean only "whatever". tadzik++'s example in the advent post then actually becomes correct. :)
15:02 lizmat and how would that work for (1,2,3,4) ~~ (1,2,anyothernumber of ints)
15:03 jnthn std: my $s = set;
15:03 camelia std 53b3ca6: OUTPUT«[31m===[0mSORRY![31m===[0m�The 'set' listop may not be called without arguments (please use () or whitespace to clarify) at /tmp/4Znrem_HlD line 1:�------> [32mmy $s = set[33m�[31m;[0m�Check failed�FAILED 00:01 123m�»
15:03 jnthn S02-types\set.rakudo.moar fails like that
15:03 lizmat actually, I just realize an abspath wouldn't speed up Perl6 start time
15:03 lizmat as each path (except one) is only ever checked once during startup anyway
15:06 jnthn TimToady: I get a failure in S32-str/substr-rw.t claiming "Unsupported use of $$ variable; in Perl 6 please use $*PID" over is($$r⏏, "gloop", '$r referent is eq to the sub
15:07 jnthn TimToady: Related to your recent patches? I don't see right off how it could be my one...
15:07 jnthn Bah, I'll just push this thing then we can distribute triage :)
15:09 dalek rakudo/nom: e616060 | jonathan++ | src/Perl6/Grammar.nqp:
15:09 dalek rakudo/nom: Add deftrap mechanism from STD.
15:09 dalek rakudo/nom: Catches say; and similar mistakes.
15:10 TimToady jnthn: found the problem, kinda
15:10 jnthn japhb: I can't see any issues in the code you sent me right away...
15:10 TimToady in Action variable, there's a make $past at the end, but it doesn't seem to work
15:11 TimToady hang on, I'll test and push
15:15 dalek rakudo/nom: 3d233ed | TimToady++ | src/Perl6/ (2 files):
15:15 dalek rakudo/nom: oddly, need explicit make $past; return;
15:15 dalek rakudo/nom: It should fall through and do the 'make $past' at the end of the function but doesn't.
15:15 TimToady there, that version works, but I don't know why it's different
15:16 timotimo TimToady: you have a "my $past" in the inner scope
15:16 TimToady ah!
15:16 timotimo that's why the $past at the end of the function ends up NQPMu
15:16 dalek roast: 42e5824 | jonathan++ | S0 (2 files):
15:16 dalek roast: A couple of fixes for the deftrap rule.
15:16 dalek roast: STD rejected these two before; now Rakudo does also.
15:16 TimToady timotimo++
15:16 * timotimo is pleased with himself
15:18 dalek rakudo/nom: 114ba1d | TimToady++ | src/Perl6/Actions.nqp:
15:18 dalek rakudo/nom: remove stupid 'my' spotted by timotimo++
15:19 TimToady say() and say '' are both fine, I think, and likewise set(), to indicate emptiness explicitly
15:24 [Coke] jnthn: "say for 1" dies as expected. "say  for 1" does not.
15:26 jnthn [Coke]: Yeah, just noticed that. wtf.
15:27 dalek roast: 06159ea | jonathan++ | S16-io/bare-say.t:
15:27 dalek roast: Unfudge passing tests; toss a bogus one.
15:30 jnthn [Coke]: Fixed it locally, so now bare-say.t can pass in full
15:31 timotimo looking forward to seeing what caused that behavior %)
15:32 jnthn Well, I kinda cheated on the fix.
15:53 dalek rakudo/nom: a98d264 | jonathan++ | src/Perl6/Grammar.nqp:
15:53 dalek rakudo/nom: Make "say  for 1;" complain also.
15:54 dalek roast: 927f3e1 | jonathan++ | S16-io/bare-say.t:
15:54 dalek roast: Unfudge "say  for 1;" test.
15:55 dalek roast: 1059587 | TimToady++ | S03-operators/context.t:
15:55 dalek roast: update for anonyvars
16:24 lizmat not ok 3 - Calling sub if without parens parsefails
16:24 lizmat jnthn TimToady ^^^
16:25 lizmat from t/spec/S02-lexical-conventions/one-pass-parsing.t
16:26 lizmat also: not ok 253 - alternation and conjunction (&|) - parse error
16:26 lizmat from t/spec/S05-mass/rx.t
16:30 jnthn std: sub if() { "#foo" }; say if;
16:30 camelia std 53b3ca6: OUTPUT«[31m===[0mSORRY![31m===[0m�Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/kG_B89Ln4H line 1:�------> [32msub if() { "#foo" }; say[33m�[31m if;[0m�Confused at /tmp/kG_B89Ln4…»
16:31 jnthn Rakudo now matches that error
16:31 jnthn So, the test wants an update
16:32 lizmat all current fails: https://gist.github.com/lizmat/d0968a1791e605f52ba1
16:33 dalek Inline-Perl5: 2e80595 | nine++ | / (3 files):
16:33 dalek Inline-Perl5: Allow passing Perl 6 objects through Perl 5 space.
16:33 jnthn lizmat: If you want an easy patch to do, making the patch I did throw a typed exception could be nice...
16:33 jnthn lizmat: And then update that S02 test to look for it
16:33 TimToady it's not necessary to follow STD slavishly there
16:34 dalek roast: 7910209 | jonathan++ | S02-lexical-conventions/one-pass-parsing.t:
16:34 dalek roast: Sync test to expect same error STD gives.
16:35 nine It really makes me nervous that this Inline::Perl5 stuff works with so little hassle. This ought to be much more complicated.
16:35 lizmat actually, renaming X::AdHoc to X::Die would make sense to me
16:35 lizmat or X::Died
16:35 TimToady nine: well, have you looked at diakopter's design to see where your design is going to break?
16:36 jnthn Oh heck, I need to implement DESTROY stuff for nine++ too, don't I... :)
16:36 nine jnthn: yes, pretty please :)
16:36 TimToady dunno if there's a separate document somewhere offhand
16:36 lizmat jnthn: well, *some* code to be executed at GC expulsion would be nice
16:37 jnthn lizmat: Yeah, the GC changes are not too bad
16:37 jnthn lizmat: It's where to run the code that's tricky.
16:37 TimToady I'm sure diakopter++ would be glad to foist some of the work off on nine++
16:37 carlin using NativeCall, I have a CStruct that `has int $.v`, how do I use that to pass to a C function? `some_struct.new(v => 42)` doesn't work
16:38 nine TimToady: what I can find in his grant proposal is completely different from my implementation.
16:42 dalek rakudo/nom: 4887ae5 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
16:42 dalek rakudo/nom: Make filetests only check for existence once
16:49 * lizmat is getting lost in the maze that is IO IO::Handle IO::Path and IO::Spec
16:50 jnthn lizmat: You and me both... :)
16:56 btyler_ tony-o: thanks! I think I'm going to change the api a bit, "from-json(<foo>, True)" isn't a great way to declare that you want a handle on a jansson object instead of a core p6 data structure
16:56 lizmat hmmm.... according to spec, IO::Handle should *not* be doing IO::FileTestable
16:56 lizmat is that a problem in the spec?  or a problem in the implementation ?
16:58 lizmat also: according to spec (S32/Str), a bare say or print should warn, not die
17:00 lizmat About IO::FileTestable: the spec states: "If you apply that role to a class, that class must provide a C<Str> method which returns the full path."
17:00 lizmat TimToady: is "full path" the same as "absolute path", and is therefore the .Str of IO faulty atm ?
17:01 * TimToady lost track of everything IO about 87,000 years ago
17:02 lizmat so "slushy" would be a good description of the current state of IO
17:28 [Coke] (planeteria) site admin is working on the issue, please be patient.
17:29 dalek rakudo/nom: 6a6b5d0 | TimToady++ | src/core/List.pm:
17:29 dalek rakudo/nom: gist should, like, give you the tl;dr of the list
17:30 [Coke] hey, someone borked the spectests.
17:30 TimToady yes, there's still a bit of fallout from the anonyvars
17:30 [Coke] jvm: 49, moar: 68; moar-jit: 67; parrot: 731
17:31 TimToady but it's not all my fault
17:31 [Coke] (as of rakudo 54cd8fb, spectest 7fc8efd)
17:37 lizmat jnthn: from a performance point of view, would it make sense to just add a fallback to IO::Spec that would install the right IO::Spec::xxx method at runtime
17:37 lizmat rather than the class method -> variable class.method approach right now?
17:38 lizmat to prevent this kind of mapping: method rel2abs( |c )               { $SPEC.rel2abs( |c )               }
17:39 lizmat possibly doing this in the optmizer?
17:39 grondilu so with this new $++ thing I remembered there is a (state $)++ in RC's evolutionary algorithm.  So I try it before I change it and I got:
17:39 grondilu Internal error: invalid thread ID in GC work pass
17:40 * grondilu wonders if there was not some test for RC regressions
17:40 grondilu issue was in http://rosettacode.org/wiki/Evolutionary_algorithm#Perl_6
17:56 dalek specs: 6ab1396 | TimToady++ | S02-bits.pod:
17:56 dalek specs: .gist only prints 100 entries of long lists
17:58 hoelzro are dynamic variables specific to a single compilation unit?
17:58 hoelzro ex. if I have $*VAR_NAME in my module, and someone else uses that same variable name in another module, will they interfere?
17:58 nwc10 mberends: sorry, looks like I ran out of time in May and never figured out how to get Rakudo itself building on PPC
17:58 nwc10 mberends: sorry, part 2, NQP used to work, but seems to be bust
17:59 nwc10 bisecting
18:01 dalek rakudo/nom: 32cb14d | TimToady++ | src/core/List.pm:
18:01 dalek rakudo/nom: off-by-one on gist's tl;dr
18:01 moritz hoelzro: perl6/doc htmlify.p6 is back to < 10min with latest rakudo
18:03 jnthn TimToady: About push: the reason it became pessimized wasn't so much the special case for item and avoiding the *@foo, afaict
18:04 jnthn TimToady: It wsa the callsame and the fact that ruins the optimizer's ability to avoid building *%_
18:04 jnthn TimToady: I *think* if we can do the special case and avoid he callsame we may come out ahead...
18:07 jnthn Oh, there's a new n-ary push?
18:08 TimToady yes, it just does a splice rather than pushing one at a time
18:09 TimToady I haven't got around to adding @a.push(@a) yet
18:09 TimToady which is blazingly faster than it used to be
18:09 TimToady for larger N
18:12 moritz tadzik++ # panda, rebootstrap.pl
18:14 BenGoldberg grondilu, here's a decoding function written in perl5:
18:14 BenGoldberg eval: use warnings; sub unencode { local $_ = shift; s/(.)//; my $m = $1 or return 0; my $n = 1; for my $mm ( 1 .. $m ) { warn "[$m;$n;$mm;$_]\n"; s/(.{$n})// or die; $n = $1 }; $_ }; [ unencode("3114562949953421312") ];
18:15 BenGoldberg I'm sure it can be easily be rewritten in perl6... but I'm not good at golfing, yet :)
18:15 lizmat the more I look at it, I think IO::Path is overenginieered and mostly useless
18:16 lizmat a lot of effort is spent converting IO::Path to Str and vice-versa
18:16 grondilu p6: role Foo {}; my %h = ("foo" but Foo) => 1; say %h.keys[0] ~~ Foo;
18:16 camelia rakudo-{parrot,jvm,moar} 4887ae, niecza v24-109-g48a8de3: OUTPUT«False␤»
18:17 grondilu so Hash keys can not have a role attached to them?
18:17 TimToady m: role Foo {}; my %h{Any} = ("foo" but Foo) => 1; say %h.keys[0] ~~ Foo;
18:17 camelia rakudo-moar 4887ae: OUTPUT«True␤»
18:18 TimToady grondilu: ^^
18:20 nine jnthn: yes, you might. I managed to write a test with only inline Perl 5: https://github.com/niner/Inline-Perl5/commit/de167995c90fe2cd2267ab699d50ca6a7895dcc4
18:22 nine jnthn: we're using add_fallback to pass through method calls on Perl5Objects to the Perl 5 interpreter: https://github.com/niner/Inline-Perl5/blob/master/lib/Inline/Perl5.pm6#L247
18:22 nine jnthn: but there's strange calls to "sink" and in the test, $!perl5 seems to end up being a Perl5Object instead of a PerlInterpreter
18:23 jnthn nine: Yes, that's because things in void context do .can('sink') or so
18:23 jnthn Perl5Object.^add_fallback(-> $, $ { True },
18:23 jnthn That means you're claiming you support *every* method.
18:24 jnthn Eventually, though, we really should write a Perl5HOW meta-object...
18:25 jnthn That way we can even have Perl 5 object dispatches go through the method cache rather than the slow path.
18:29 nine jnthn: ok that takes care of the "sink" problem. But there's still the following error: http://paste.scsys.co.uk/420296 caused by $!perl5 being a Perl5Object instead of a PerlInterpreter. I really have no idea why. The code seems to be very straight forward.
18:30 jnthn My latest talk slides are now linked from http://jnthn.net/articles.shtml
18:33 dalek roast: 48160f2 | TimToady++ | S03-operators/context.t:
18:33 dalek roast: anonymous & doesn't make a lot of sense
18:34 dalek rakudo/nom: 9a9da9f | TimToady++ | src/Perl6/Grammar.nqp:
18:34 dalek rakudo/nom: anonymous & doesn't make a lot of sense
18:34 dalek rakudo/nom: (and causes bugs in rx parsing of &)
18:36 lizmat given a file "foo" with "foo" in it, and "bar" with "bar in it:
18:36 lizmat this seems *very* wrong to me:
18:36 lizmat $ 6 'my $h = "foo".IO.open; $h.open("bar"); say $h.lines'
18:36 lizmat bar
18:36 TimToady m: say 1,1...*
18:36 camelia rakudo-moar 32cb14: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...␤»
18:36 dalek Inline-Perl5/call_backs: a563d94 | nine++ | / (3 files):
18:36 dalek Inline-Perl5/call_backs: Failing call backs
18:38 jnthn TimToady: wtf, why the 1 1 1...
18:39 brrt that's a spesh or jit error
18:39 TimToady m: say (1,1.1...*)
18:39 camelia rakudo-moar 32cb14: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 6.7 6.8 6.9 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9 9.1 …»
18:39 brrt :-)
18:40 TimToady wow
18:40 jnthn 57 is a magical number
18:42 jnthn lizmat: Feels like a wtf to me...
18:43 TimToady ooh, it's something about my gist change
18:43 jnthn lizmat: Well, the VM GCs IOHandles and will close them...
18:43 jnthn lizmat: So we're not *too* bad from that angle.
18:43 jnthn lizmat: Unless the original handle makes gen2.
18:44 jnthn From data I'm seeing at present, full collection frequency wants to becme a function of bytes promoted
18:48 brrt we have a known inlining-related bug in moar with $_
18:49 jnthn brrt: We...do?
18:49 dalek rakudo/nom: 1ff1d30 | TimToady++ | src/core/List.pm:
18:49 dalek rakudo/nom: don't use $_ two different ways
18:49 dalek rakudo/nom: previous .gist patch did just that, TimToady--
18:50 TimToady would that account for my buggy code getting the right (wrong) $_ after 57?
18:50 brrt https://github.com/MoarVM/MoarVM/issues/127 jnthn
18:50 jnthn TimToady: As I said, 57 is a *very* suspect number
18:57 jnthn brrt: Thanks, got a fix for #127 locally
19:00 jnthn Pushed the fix.
19:01 brrt jnthn++
19:01 jnthn And yeah, guess that one got lost in my travel blind spot :)
19:24 Ven http://stackoverflow.com/questions/19178989/is-there-a-language-with-constrainable-types/25574936#25574936 <- answered with PErl6 :)
19:25 Ven ^ if anybody has to fix my answer, feel free to :)
19:26 brrt p6: my int $i = 8; my int $y = -3; say $i div $y;
19:26 camelia ..rakudo-{parrot,moar} 32cb14: OUTPUT«-3␤»
19:30 brrt ok, i won't be complaining anymore :-)
19:32 TimToady p6: my int $i = 8; my int $y = 0; say $i div $y;
19:32 camelia rakudo-jvm 1ff1d3: OUTPUT«(timeout)»
19:32 camelia ..rakudo-moar 1ff1d3: OUTPUT«Division by zero␤  in block <unit> at /tmp/tmpfile:1␤␤»
19:32 camelia ..rakudo-parrot 1ff1d3: OUTPUT«(signal )»
19:36 TimToady m: say 1,1,*+*...*
19:36 camelia rakudo-moar 1ff1d3: OUTPUT«1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 70140873…»
19:36 TimToady that's better
19:45 TimToady 100 seems about the right limit to me; unlikely to interfere with printing small lists, and not so long it scrolls off your screen
19:46 TimToady I also don't bother to check .infinite
19:46 TimToady if it's not infinite, I'd have to check .elems, and that could be huge, or effectively infinite
19:47 TimToady m: my @a = 1..*; say @a
19:47 camelia rakudo-moar 1ff1d3: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8…»
20:13 nwc10 jnthn: other PPC "bug" was solved with fadd779... Update to simpler MAST::Label API.
20:14 nwc10 ie was trying to use too old an NQP
20:44 nine How can a typed private attribute of an object get a value of a different type?!
20:47 nine TimToady: this is the complete source of the class: https://gist.github.com/niner/11490afd74ede2af7b8b
20:52 nine Changeing the order of attributes in that class changes the error message. I now get: No such method 'call' for invocant of type 'Perl6::Metamodel::ContainerDescriptor'
20:59 nine If I change the private attributes to public ones and remove the BUILD method the errors disappear.
21:03 moritz nine: if you make them public, but keep the BUILD, what happens?
21:05 nine moritz: Cannot find method 'STORE' in submethod BUILD at /home/nine/Inline-Perl5/lib/Inline/Perl5.pm6:262
21:06 raiph m: subset Probability of Num where 0.0 <= * <= 1.0; # Is this a solution to question part `1` in SO question (as answered by ven++ at http://stackoverflow.com/a/25574936/1077672)? What about a solution to part `2`?
21:14 * Ven 's trying to find the second part to raiph++'s answer
21:21 Ven it's a Map, just [+](.values) I think
21:22 dalek Inline-Perl5: 67dfcac | moritz++ | lib/Inline/Perl5.pm6:
21:22 dalek Inline-Perl5: give Perl5Object a no-op sink method
22:14 dalek Inline-Perl5/call_backs: 1baec29 | nine++ | / (3 files):
22:14 dalek Inline-Perl5/call_backs: Implement parameterless callbacks
22:16 dalek Inline-Perl5/call_backs: Implement passing parameters to call backs
22:21 spider-mario nqp on parrot builds with various -Werror=… parameters
22:21 spider-mario this causes problems, as it also builds dyncall with those
22:22 spider-mario but dyncall doesn’t try to avoid those warnings
22:28 spider-mario and once built, it doesn’t appear to know its version number
22:28 spider-mario $ nqp-p --version
22:28 spider-mario This is nqp version  built on parrot 6.7.0 revision 0
22:41 * donaldh noticed some spam in RT that needs deleted https://rt.perl.org/Ticket/Display.html?id=122651
22:55 spider-mario even after patching nqp so it prints “This is nqp version 2014.08 built on parrot 6.7.0 revision 0”, Rakudo’s Configure.pl thinks it’s too old… what’s going on? :/
22:57 dalek rakudo/nom: 7467ee8 | (Rob Hoelz)++ | src/core/Pod.pm:
22:57 dalek rakudo/nom: Add :content in Pod::Block constructor, but warn about deprecation
22:58 dalek doc: 0a5229d | (Rob Hoelz)++ | lib/Pod/Convenience.pm6:
22:58 dalek doc: Don't use deprecated contents attribute
22:58 hoelzro .tell moritz I fixed up and checked the docs; they're fine now!
23:25 dalek rakudo/nom: d8c8342 | TimToady++ | src/core/List.pm:
23:25 dalek rakudo/nom: first whack at implementing .plan
23:26 TimToady > perl6 -e 'my @a = 1,2,3; @a.plan(4..*); say @a'
23:26 TimToady 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
23:28 TimToady unfortunately, hangs if you try to subscript into the lazy part
23:28 TimToady but it's a start

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

Perl 6 | Reference Documentation | Rakudo