Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-11-26

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:08 Mouq https://github.com/sillymoose/Perl6-On​e-Liners/pull/6#issuecomment-64404187
00:08 raydiak timotimo: you could add a layer of indirection between your module's values and sdl's values, then rearrange the values attached to your public enums so all conflicting names have the same value :P
00:09 Mouq Is there a simpler way to write `$_ ~= "\n"` that I don't know about?
00:09 Mouq Having `~="\n"` seems like it would violate TTIAR
00:12 timotimo m: sub postfix:<~="\n">($a is rw) { $a = $a ~ "\n" }; my $a = "hooray!"; $a~="\n"; print $a.perl
00:12 camelia rakudo-moar e1aa07: OUTPUT«"hooray!\n"»
00:14 lizmat joined #perl6
00:14 Mouq m: sub prefix:<~=> ($s) { CALLER::<$_> ~= $s }; $_ = "hooray"; ~="\n"; .print # more like.. :)
00:14 camelia rakudo-moar e1aa07: OUTPUT«hooray␤»
00:17 TimToady m: sub postfix:<n> ($x) { $x ~ "\n" }; print 42\n;
00:17 camelia rakudo-moar e1aa07: OUTPUT«42␤»
00:17 TimToady just don't trying append a tab that way :)
00:18 TimToady s/ing//
00:18 TimToady er, s/ing/ to/
00:19 Mouq m: sub postfix:<n> ($x) { $x ~ "\n" }; print 42\i\n;
00:19 camelia rakudo-moar e1aa07: OUTPUT«0+42i␤»
00:30 ssqq joined #perl6
00:33 perturbation left #perl6
00:56 KCL_ joined #perl6
01:00 dalek nqp: ba888b5 | TimToady++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java:
01:00 dalek nqp: one test for special cases; if -> switch; fix tabs
01:00 dalek nqp:
01:00 dalek nqp: Seems to run about 1.5% faster.
01:00 dalek nqp: review: https://github.com/perl6/nqp/commit/ba888b5fa3
01:01 bjz joined #perl6
01:04 anaeem1 joined #perl6
01:05 Mouq m: my $g = (^4 Z=> (1..16).pick(4)).BagHash;say $g.fmt("%d: %d"); say "Total ", [+] $g.values; say $g.pick(*).uniq for ^30;
01:05 camelia rakudo-moar e1aa07: OUTPUT«0: 7␤1: 14␤2: 8␤3: 1␤Total 30␤0 1 2 3␤3 0 1 2␤0 1 2 3␤0 2 1 3␤1 2 0 3␤0 1 3 2␤0 1 2 3␤0 1 2 3␤1 2 0 3␤0 2 1 3␤0 1 2 3␤1 0 2 3␤2 1 0 3␤0 2 1 3␤1 3 2 0␤2 1 0 3␤1 2 0 3␤2 0 1 3␤2 1 0 3␤1 2 0 3␤1 0 2 3␤0 1 2 …»
01:05 anaeem1 joined #perl6
01:05 Mouq ^^ One-line version of https://github.com/perl6/perl6-examples/blo​b/master/perlmonks/weighted-roll-731696.pl
01:08 TimToady good thing my window is so wide...
01:12 TimToady that 1.5% faster was the timing on the parse phase of the setting, btw
01:12 timotimo cute
01:12 timotimo more of that? :)
01:13 TimToady overall build time was actually about 5% faster
01:13 TimToady but not very scientifically done
01:15 timotimo so switch/case is faster than if/else in java?
01:18 arnsholt Probably
01:18 arnsholt switch compiles to a jump table, so if there are many branches, I wouldn't be surprised
01:20 dalek nqp: 489bd97 | TimToady++ | src/vm/parrot/ops/nqp.ops:
01:20 dalek nqp: one test for special cases; if -> switch; fix tabs
01:20 dalek nqp:
01:20 dalek nqp: (same for parrot as we just did for jvm)
01:20 dalek nqp: review: https://github.com/perl6/nqp/commit/489bd97f26
01:22 colomon joined #perl6
01:22 arnsholt Oh yeah, that switch there is probably going to help I think. At least if it's kinda hot (like it looks like it is)
01:22 TimToady we still need to optimize switches in P6 that way
01:22 TimToady yes, the NFA is definitely hot code
01:23 arnsholt Yeah. That's trickier though, since P6 allows more complicated things in the cases than C and Java
01:23 TimToady however, we've been very careful to define smartmatching to depend only on the type of the "when"
01:24 TimToady so 'when 1' is always integer comparison
01:24 TimToady hence optimizable
01:24 arnsholt True, true
01:24 TimToady also strings, where you could dispatch based on, say, the first character
01:25 TimToady of course, if there are multiple entries with the same first letter, it would devolve to the current situation of testing each of those
01:25 TimToady so it would be good to group them
01:26 TimToady one could go as far as to generate a trie of all the strings, I suppose
01:26 dayangkun joined #perl6
01:26 TimToady but generally by the time you've gone to that much trouble, you should have been using polymorphism on method names instead
01:26 arnsholt Yeah, or something more clever in general
01:26 timotimo will foo[1]['bar'] += 10 create foo[1]['bar'] if foo[1] is a dictionary that does not include 'bar' yet?
01:27 timotimo most probably not :\
01:27 TimToady well, I don't think either python or ruby do autoviv the way perl does
01:27 TimToady that's kinda one of perl's distinctives
01:27 arnsholt Standard Python dicts won't, no
01:28 arnsholt There's defaultdict though, if you want that behaviour
01:28 TimToady even if perl5 botches it in spots
01:48 Mouq https://github.com/perl6/perl6-exa​mples/blob/master/shootout/RESULTS
01:50 timotimo 2009
01:50 timotimo i hope we've improved a bit since then
01:51 Mouq A lot :)
01:57 Mouq And this is without compact arrays, and is compared to p5's greased-up regexes
01:57 timotimo did you calculate some up to date values
02:02 Mouq N-Body: Was: 550x slower than p5. Is: 47.3x. Is, with s/Num //: 27.8x
02:03 Mouq Although it looks like p5 takes more of a lead as N increases
02:04 * Mouq finds it LTA that slurp() no longer works... :/
02:05 colomon slurp in p5 no longer works?
02:05 Mouq Regex-DNA: Was 410x, is 16.9x
02:05 Mouq in p6
02:05 Mouq m: say slurp
02:05 camelia rakudo-moar e1aa07: OUTPUT«set encoding requires an object with REPR MVMOSHandle␤  in method encoding at src/gen/m-CORE.setting:15900␤  in method slurp-rest at src/gen/m-CORE.setting:15855␤  in sub slurp at src/gen/m-CORE.setting:16606␤  in block <unit> at /tmp/plB0OXczaV:1…»
02:06 Mouq j: say slurp
02:06 camelia rakudo-jvm e1aa07: OUTPUT«Can't open perl script "/home/camelia/jvm-rakudo/eval-client.pl": No such file or directory␤»
02:06 Mouq p: say slurp
02:06 camelia rakudo-parrot e1aa07: OUTPUT«No such method 'encoding' for invocant of type 'Any'␤  in method encoding at gen/parrot/CORE.setting:15822␤  in method slurp-rest at gen/parrot/CORE.setting:15774␤  in sub slurp at gen/parrot/CORE.setting:16514␤  in sub slurp at gen/parrot/CORE.s…»
02:07 Mouq K-Nucleotide: Was 200x, is 23.7x
02:07 colomon "/home/colomon/.ssh/config".IO.slurp works fine for me, though my Rakudo is a day or two old
02:08 Mouq Wait
02:08 Mouq Yeah
02:08 Mouq colomon: Yeah, but just plain 'ol `slurp` to get STDIN seems borked
02:10 Mouq Revcomp: Was 1600x, is 38.4x
02:10 colomon yeah, you're right.  wonder if the rakudobug has been reported?  it's clearly a bug...
02:11 Mouq Fasta: Was 590x, is 15x
02:12 Mouq Oh, wait
02:13 Mouq Well, I just realized I'm on a Rakudo from October
02:13 Mouq But if camelia fails it, it's definitely still a bug :P
02:18 japhb Mouq: Are these with no types, native types (num), or high-level types (Num)?
02:20 Mouq The timings? No native types. High-level types are used in repo's current N-Body impl and slow it down
02:25 TimToady well, Num is really not a very high-level type, just a num in disguise
02:25 TimToady Int is rather further from int, I think
02:34 dalek nqp: ce191a8 | (Timo Paulssen)++ | / (2 files):
02:34 dalek nqp: show allocations split into interpd/speshd/jitted frames
02:34 dalek nqp: review: https://github.com/perl6/nqp/commit/ce191a82b2
02:34 timotimo ^- enjoy
02:35 raydiak timotimo++
02:38 dj_goku joined #perl6
02:39 adu joined #perl6
02:40 jimmy_ joined #perl6
02:45 colomon Mouq: yeah, the set encoding requires an object with REPR MVMOSHandle was the error I was getting
02:46 ilbot3 joined #perl6
02:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:,  niecza:, std:, or /msg camelia perl6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
02:47 adu joined #perl6
02:47 cognominal joined #perl6
02:48 KCL joined #perl6
02:50 chenryn joined #perl6
03:00 timotimo i hope it's correct
03:02 dj_goku does anyone know a good way to contact FROGGS?
03:03 timotimo if you .tell FROGGS blah blah, he'll get it the next time he writes on irc
03:03 * colomon doesn't know a method better than invoking his name here….
03:03 timotimo otherwise email@froggs.de
03:03 dj_goku .tell FROGGS testers.perl6.org front-end seems to be down. :(
03:03 yoleaux dj_goku: I'll pass your message to FROGGS.
03:04 timotimo http://cpandatesters.org/ seems to work
03:04 dj_goku hmm maybe it is my internet?
03:04 dj_goku because that didn't work either.
03:04 timotimo oh
03:04 dj_goku hmm from my vps it does.
03:05 dj_goku weird they both work from my vps.
03:05 kurahaupo joined #perl6
03:06 dj_goku lol quit safar and now it works.
03:06 dj_goku :(
03:07 dj_goku s/safar/safari/
03:20 noganex_ joined #perl6
03:34 vike joined #perl6
03:44 Mso150 joined #perl6
03:55 raydiak why don't we have something that autothreads like a junction and is introspectable like a set? never collapses, but coerces to a junction w/explicit .any/.all/.one/.none, otherwise maybe behaves like a list in bool context (.elems.Bool)
04:05 Mouq joined #perl6
04:09 raiph joined #perl6
04:14 rmgk joined #perl6
04:16 zakharyas joined #perl6
04:54 KCL_ joined #perl6
04:55 chenryn joined #perl6
05:01 TimToady .oO(and a pony)
05:02 kaleem joined #perl6
05:04 anaeem1_ joined #perl6
05:10 ssqq write *use v6* or ignore it, Have any difference?
05:36 adu joined #perl6
05:49 kurahaupo joined #perl6
05:52 dayangkun joined #perl6
05:58 kaare_ joined #perl6
06:10 moritz good morning
06:10 moritz ssqq: with 'use v6;', you get a much better error message if you accidentally run it with perl 5
06:10 moritz ssqq: that has happened to me quite a few times :-)
06:11 moritz also, it makes it easier for tools (like syntax hilighters) to reliably determine the language
06:11 JimmyZ ssqq: 好久不见
06:29 ssqq JimmyZ: 好久不见。
06:30 ssqq moritz: I found CORE:.kyes have not change when ignore *use v6*
06:49 anaeem1_ joined #perl6
07:00 kurahaupo joined #perl6
07:00 telex joined #perl6
07:01 kaleem joined #perl6
07:07 denis_boyun joined #perl6
07:25 blackbolt joined #perl6
07:26 salv0 joined #perl6
07:27 gfldex joined #perl6
07:36 jluis joined #perl6
07:39 dalek doc: cbcd9b0 | Mouq++ | lib/Language/operators.pod:
07:39 dalek doc: Get rid of a TODO for dotty ops
07:39 dalek doc: review: https://github.com/perl6/doc/commit/cbcd9b027f
07:47 vti joined #perl6
08:00 FROGGS joined #perl6
08:11 masak mornin', #perl6
08:13 lizmat morning masak
08:14 * lizmat is about to commute to Lyon
08:14 lizmat for the Patch -p2 Hackathon
08:14 moritz .oO( the Lyon sleeps tonight )
08:14 lizmat .oO( I would by Lyon if I said that was wrong )
08:16 raydiak Lyon in green pastures?
08:16 raydiak Lyon battery in my laptop?
08:16 * lizmat hopes it won't be freezing in Lyon
08:16 lizmat .oO( I don't like your Lyon Ice )
08:17 * lizmat must stop with bad Lyon puns
08:18 virtualsue joined #perl6
08:19 * masak .oO( I still have a milLyon of them left! )
08:20 bjz joined #perl6
08:20 Alina-malina joined #perl6
08:22 rurban joined #perl6
08:25 raydiak g'night #perl6
08:27 kjs_ joined #perl6
08:28 masak 'night, antipodal raydiak
08:29 Mso150 joined #perl6
08:30 darutoko joined #perl6
08:42 Mouq joined #perl6
08:43 [Sno] joined #perl6
08:50 ptc_p6 joined #perl6
09:05 Alina-malina joined #perl6
09:07 rindolf joined #perl6
09:10 dalek rakudo/newio: 124cab4 | (Elizabeth Mattijsen)++ | src/core/PIO.pm:
09:10 dalek rakudo/newio: First version of PIO role (untested as yet)
09:10 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/124cab4b77
09:10 dalek rakudo/newio: 8af1338 | (Elizabeth Mattijsen)++ | src/core/IO/Pipe.pm:
09:10 dalek rakudo/newio: IO::Pipe first consumer of PIO role
09:10 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/8af1338db3
09:10 sven_123 perl6: say 3+4
09:10 camelia rakudo-{parrot,moar} e1aa07: OUTPUT«7␤»
09:11 lizmat commute to Lyon&
09:15 fhelmberger joined #perl6
09:19 FROGGS m: say 1, 2, 4 ... 32 # sven_123: it can do pretty nice things :o)
09:19 yoleaux 03:03Z <dj_goku> FROGGS: testers.perl6.org front-end seems to be down. :(
09:19 camelia rakudo-moar e1aa07: OUTPUT«1 2 4 8 16 32␤»
09:19 FROGGS damn
09:20 JimmyZ m: say 1, 2, 3 .. 10
09:20 camelia rakudo-moar e1aa07: OUTPUT«123..10␤»
09:20 JimmyZ m: say 1, 2, 3 ... 10
09:20 camelia rakudo-moar e1aa07: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
09:20 JimmyZ m: say 1, 2, 5 ... 10
09:20 camelia rakudo-moar e1aa07: OUTPUT«===SORRY!===␤Cannot assign to a readonly variable or a value␤»
09:20 FROGGS eww
09:20 FROGGS that sounds like it fails to generate the exception or so
09:21 sqirrel__ joined #perl6
09:21 FROGGS dj_goku: thanks, I restarted it
09:21 JimmyZ aye
09:21 FROGGS p: say 1, 2, 5 ... 10
09:21 camelia rakudo-parrot e1aa07: OUTPUT«Cannot assign to a readonly variable or a value␤  in block  at gen/parrot/CORE.setting:19586␤  in any coro at gen/parrot/CORE.setting:8486␤  in method reify at gen/parrot/CORE.setting:8467␤  in block  at gen/parrot/CORE.setting:8177␤  in method…»
09:22 JimmyZ n: say 1, 2, 5 ... 10
09:22 camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Unable to figure out pattern of series␤  at /home/camelia/niecza/lib/CORE.setting line 1536 (die @ 5) ␤  at /home/camelia/niecza/lib/CORE.setting line 3423 (get-next-closure @ 37) ␤  at /home/camelia/niecza/lib/CORE.setting …»
09:22 FROGGS m: say 1, 2 ... 32, 33 ... 40
09:22 camelia rakudo-moar e1aa07: 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␤»
09:22 FROGGS m: say 1, 2, 4 ... 32, 33 ... 40
09:22 camelia rakudo-moar e1aa07: OUTPUT«1 2 4 8 16 32 33 34 35 36 37 38 39 40␤»
09:22 FROGGS well, at least that still works...
09:22 bjz joined #perl6
09:22 FROGGS I'll rakudobug the other issue
09:23 JimmyZ Thanks :)
09:29 vike joined #perl6
09:30 sven_123 FROGGS - is there a big difference between 'perl6:' and 'm:'?
09:31 masak m: say 4
09:31 camelia rakudo-moar e1aa07: OUTPUT«4␤»
09:31 masak perl6: say 4
09:31 camelia rakudo-{parrot,moar} e1aa07: OUTPUT«4␤»
09:31 masak p: say 5
09:31 camelia rakudo-parrot e1aa07: OUTPUT«5␤»
09:31 masak sven_123: hope that answes it.
09:32 dakkar joined #perl6
09:34 JimmyZ time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 10000000 { exit; } }' # real    0m0.934s
09:34 JimmyZ time php -r '$n =0; for(;;) { if($n++ == 10000000) { exit; }}' # real    0m0.490s
09:34 sven_123 actually not really - i mean one is the parrot-thing and the other is moar-vm, i read a bit about that, but i don't know enough, to know the real differences; guess mostly it doesn't matter, I just asked, because froggs wrote me an example and used m:
09:35 JimmyZ time perl6 -e 'my int $n = 0; loop { 10000000.rand; $n = $n +1; if $n == 10000000 { exit; } }'  # real    0m10.562s
09:35 JimmyZ time php -r '$n =0; for(;;) { rand(1, 100000000); if($n++ == 10000000) { exit; }}'  #real    0m4.185s
09:36 moritz sven_123: 'm:' is faster, uses less memory, and supports concurrency
09:36 masak m: sub stick-figure { my ($head, $arm, $legs) = (577 * 3).base(16).comb; my $body = [~] $arm, $head, $arm, $legs; chr :16($body) }; say stick-figure
09:36 camelia rakudo-moar e1aa07: OUTPUT«웃␤»
09:37 masak :D
09:37 * masak hopes he just created a new type of obfuscated Perl 6 code category
09:38 sven_123 thx :)
09:44 zakharyas joined #perl6
09:53 pecastro joined #perl6
09:56 ptc_p6 joined #perl6
10:00 Ugator joined #perl6
10:03 virtualsue joined #perl6
10:09 JimmyZ .tell timotimo perl6 --profile -e 'my int $n := 0; loop { $n := $n +1; if $n == 10000000 { exit; } }'  has 10000001  Scalar Allocations, It will be nice to avoid it
10:09 yoleaux JimmyZ: I'll pass your message to timotimo.
10:09 JimmyZ .tell timotimo please igonre ':'
10:09 yoleaux JimmyZ: I'll pass your message to timotimo.
10:16 JimmyZ .tell timotimo and I see Exclusive Time on exit is 18446744073709.23ms ..
10:16 yoleaux JimmyZ: I'll pass your message to timotimo.
10:23 Ulti masak that reminds me of a code golf I did in Java http://codegolf.stackexchange.com/questions/23102​/shortest-code-to-print-random-times/23401#23401
10:23 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=23401
10:25 kjs_ joined #perl6
10:38 daxim joined #perl6
10:41 chenryn joined #perl6
10:44 pecastro joined #perl6
10:52 Mouq joined #perl6
11:00 anaeem___ joined #perl6
11:13 sunnavy joined #perl6
11:27 pecastro joined #perl6
11:28 masak Ulti: writing that stick figure was fun. I'm pondering writing a (short) blog post about it. :)
11:35 * masak ponders what it'd take to eliminate the synopsebot false positive above
11:37 masak either "is this #NNNNN thing not part of a URL?" or "was there whitespace or BOL before the '#'?"
11:55 tadzik well, we can have a test suite :)
12:06 pmurias joined #perl6
12:08 pmurias arnsholt: it seems that it's not that variables are only declared when set but that python keeps track if they were initialized before use or not
12:12 pecastro joined #perl6
12:35 sqirrel__ joined #perl6
12:40 arnsholt pmurias: Yeah, the relevant piece of spec is https://docs.python.org/3/reference/e​xecutionmodel.html#naming-and-binding
12:41 arnsholt It seems to me that this comes from the easy way to implement this in a simple interpreter: a chain of hashtables
12:41 arnsholt On read, walk the chain looking for the key, and throw an exception if you can't find it
12:41 arnsholt Assignment just binds to the top hashtable on the stack
12:42 arnsholt It's pretty straightforward in that setting. But in a context like QAST, which likes to know about names up-front, it's a bit more tricky
12:49 Alina-malina joined #perl6
12:49 Alina-malina joined #perl6
12:50 timotimo i don't understand why jimmyz toldme to "please ignore ':'"? maybe he means using a version without binding?
12:50 yoleaux 10:09Z <JimmyZ> timotimo: perl6 --profile -e 'my int $n := 0; loop { $n := $n +1; if $n == 10000000 { exit; } }'  has 10000001  Scalar Allocations, It will be nice to avoid it
12:50 yoleaux 10:09Z <JimmyZ> timotimo: please igonre ':'
12:50 yoleaux 10:16Z <JimmyZ> timotimo: and I see Exclusive Time on exit is 18446744073709.23ms ..
12:58 spider-mario joined #perl6
12:59 masak arnsholt: ties into what I felt was frustrating when I did some Python (3) last week: simple typos or thinkos resulting in "variable not found" errors were delayed until that line of code was executed at runtime.
12:59 JimmyZ joined #perl6
12:59 JimmyZ timotimo: yeah, binding to int won't work
13:00 timotimo ah, yes, binding to natives isn't supported yet
13:01 masak arnsholt: I can even see why they chose to go with that model (and similar design decisions pushing towards late binding and dynamism). but I'm so used to getting author-time errors about missing explicit lexical declarations... I guess I like that too much.
13:03 arnsholt Yeah, I can see the reasoning behind such a model. I just think it trades a small up-front cost for much larger downstream costs, and is thus actually a bad idea
13:03 masak agree.
13:03 FROGGS timotimo: he said "please ignore ':'", which probably means that the original code had assignment instead of binding
13:03 timotimo yeah
13:04 masak the lexical model is *beautiful*, both in the speed optimizations it permits and in the closure semantics it results in.
13:06 masak apparently closures were discovered by Steele and Sussman as they were investigating the Actors model!
13:08 timotimo ah, the scalar "allocations" are actually a bug
13:09 timotimo caused by my recent code
13:09 timotimo since the code uses getlexstatic_o, it gets the Scalar object, but getlexstatic_o doesn't always allocate
13:09 timotimo so what i do is i check if the object returned from it is at the very end of the nursery, which would mean "was just allocated" regularly
13:10 timotimo but in the case of this particular benchmark, it means "is the last thing that was allocated"
13:10 timotimo and that loop allocates nothing at all in the heap, so it'll count the same scalar object as allocated over and over again
13:10 Guest17214 and Exclusive Time  :P
13:10 timotimo that's probably having recorded an entry time, but not an exit time
13:11 timotimo as the profiler dump code gets run as part of THE_END more or less
13:12 timotimo i'm wondering why the code isn't eliminating the $_ lexical
13:12 Ven joined #perl6
13:12 timotimo i replaced exit with last in order to get a proper profile
13:13 Ven o/, #perl6!
13:13 timotimo however, getting the static lexical "last" in that case is done as const_s lits(last) + getlexstatic_o
13:14 timotimo i'm not entirely sure what getlexstatic does exactly and if we have a direct rather than indirect version of that
13:14 timotimo but that could certainly help performance
13:14 timotimo oh, except
13:14 timotimo that BB only ever gets executed once. so never mind
13:14 masak \o Ven
13:15 Ven masak: I havn't backlogged yet, did you ping me at some point with some witty and interesting stuff?
13:15 timotimo weird. i seem to recall having put the optimize_can_op back in place, but here i see a const_s + can_s
13:15 Ven .oO( like... A BLOG POST )
13:17 timotimo um ... Teh F? the jitlog shows "append label: 6", then a bunch of PHIs, then "append label: 6" and "append label: 6"
13:17 timotimo i'm *pretty* sure a label should only appear once, rather than three times
13:17 zakharyas joined #perl6
13:23 brrt joined #perl6
13:24 masak Ven: witty and interesting stuff like blog post still in our future time cone. :/
13:25 Ven masak: too bad :). I secretly hoped the blog post you talked about before yesterday (/ yesterday) was there :P
13:25 brrt masak - never say ahead of time you're going to blog :-)
13:26 timotimo m)
13:26 timotimo i forgot to remove the break; before the call to optimize_can_op
13:27 masak brrt: point.
13:31 timotimo brrt: what do you say about the label situation i've mentioned up there?
13:31 brrt i'll be reading
13:31 brrt backlogging, really
13:31 timotimo :)
13:32 timotimo our code-gen for a loop { } is using the while op and feeding it a QAST::Var(lexical "True")
13:32 ssqq joined #perl6
13:32 timotimo that's hilarious
13:33 timotimo even after speshing, that means we're looking up the contents of "True" for each iteration, guarding for concreteness, deconting, unboxing its int value and checking that against 0
13:38 timotimo m: my \True = 0; loop { say "lol" }; say "hahaha"
13:38 camelia rakudo-moar e1aa07: OUTPUT«hahaha␤»
13:38 timotimo m: my \True = class :: { method Bool { (1, 1, 1, 1, 1, 0).pick } }; loop { say "lol" }; say "tadaa"
13:38 camelia rakudo-moar e1aa07: OUTPUT«lol␤lol␤lol␤lol␤lol␤lol␤tadaa␤»
13:39 zakharyas joined #perl6
13:39 masak o.O
13:39 masak nice job, Houdini.
13:40 masak I'd call it a bug if the urge to call it insane wasn't so much stronger.
13:40 Ven holy hell.
13:40 masak arguably, `loop` doesn't have anything to do with `True`.
13:40 timotimo yeah
13:41 arnsholt Nice one!
13:41 timotimo i changed it to emit IVal.new( :value(1) ) instead of the lexical True
13:41 timotimo a benchmark is about to come up.
13:41 masak are we *sure* we're not able to redefine 1 ? :P
13:42 Ven "you deserve what you get"
13:42 Ven There was a trend in the JS ecosystem, before: wrap your code with `(function (undefined) { ... })()`
13:43 Ven so that, if somebody redefined `undefined` (because it was possible), you'd still have a sane value!
13:43 Ven I've yet to stop arguing about how stupid this is :)
13:43 timotimo time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_000_000_000 { last; } }'
13:43 timotimo 11.96user 0.02system 0:12.01elapsed 99%CPU (0avgtext+0avgdata 123408maxresident)k
13:43 timotimo time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_000_000_000 { last; } }'
13:43 timotimo 42.15user 0.02system 0:42.20elapsed 99%CPU (0avgtext+0avgdata 123348maxresident)k
13:44 timotimo guess which one is which
13:44 masak timotimo: yipes.
13:45 dalek rakudo/nom: cd9001e | (Timo Paulssen)++ | src/Perl6/Actions.nqp:
13:45 dalek rakudo/nom: loop { } doesn't need to inspect lexical "True" each iteration
13:45 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cd9001efc8
13:45 arnsholt That's a pretty nice speed-up!
13:45 arnsholt timotimo++
13:45 timotimo i wouldn't call it "speed-up" for such a tight loop
13:45 timotimo but it's a nice overhead-reduction
13:46 Ven timotimo-- timotimo++
13:46 arnsholt Troo
13:47 timotimo Ven: what did i deserve the -- for this time?
13:47 timotimo is it just your personal animousity against me?
13:47 Ven timotimo: you ++'d yourself :P
13:47 Ven but I still wanted to ++ because you did something nice
13:47 timotimo oh
13:47 timotimo i ++'d myself by committing?
13:47 Ven oooh
13:47 Ven timotimo++ # I'm blind, I read arnsholt's ++ as yours. My baad
13:48 timotimo fair enough
13:48 timotimo you karma-nazi :)
13:48 timotimo karmmar nazi?
13:48 timotimo krammer nazi.
13:48 masak Ven has personal animosity? I hope there's treatment for that.
13:48 Ven timotimo was mean to me for a week... That's merely payback :P
13:48 timotimo oh, without a u
13:49 * masak .oO( there's no "you" in "animosity" )
13:49 timotimo Ven: you were asking for it! :P
13:49 timotimo masak: no u!
13:49 Ven you made me install your module!
13:49 Ven you monster.
13:49 masak timotimo: no, u!
13:53 erkan joined #perl6
13:53 erkan joined #perl6
13:54 guru joined #perl6
13:54 ptc_p6 joined #perl6
13:54 kaare_ joined #perl6
14:03 * timotimo is working on a fix to prevent the same object being counted as "allocated" infinitely many times in a row
14:03 timotimo "up to infinitely times" i should say
14:04 timotimo ah, yes, that seems to put things right.
14:05 masak m: say ^Inf
14:05 camelia rakudo-moar e1aa07: OUTPUT«0..^Inf␤»
14:05 masak m: say (^Inf).elems
14:05 camelia rakudo-moar e1aa07: OUTPUT«Inf␤»
14:05 timotimo done.
14:06 * masak tries to look worried about the fact that the range excludes infinity, and thus does not quite go up to it
14:06 * masak fails
14:06 timotimo masak: the thing is, you're also including the 0
14:06 timotimo so the count is actually Inf, not Inf - 1
14:06 timotimo you'd have to write 0^..^Inf for that
14:06 masak m: say 0 ^..^ Inf # neko operator
14:06 camelia rakudo-moar e1aa07: OUTPUT«0^..^Inf␤»
14:06 timotimo :D
14:07 timotimo need more manekineko in perl6
14:08 Ven m: sub infix:<(◕‿◕)>($a, $b) { $a + $b }; 3 (◕‿◕) 5
14:08 camelia rakudo-moar e1aa07: ( no output )
14:09 Ven m: sub infix:<(◕‿◕)>($a, $b) { $a + $b }; say 3 (◕‿◕) 5
14:09 camelia rakudo-moar e1aa07: OUTPUT«8␤»
14:09 Ven why would you not love perl6?
14:11 Celelibi joined #perl6
14:16 hoelzro joined #perl6
14:17 timotimo too lazy to get up and go to the desktop, hit the return key to wake it up, so i can launch a full benchmark run ...
14:17 timotimo i probably dread the possible realization that the nice 4x increase for the microbenchmark above probably translates into a 0.001% improvement in any use of loop { } that is more complex
14:18 timotimo s/possible/likely/
14:20 sorear joined #perl6
14:23 brrt it might be more given that - if JITTed - this might become a much simpler loop than it was
14:23 brrt with much better branch prediction
14:25 timotimo would removing gotos that point to the immediately following instruction be a win at all?
14:26 brrt yes
14:26 brrt albeit a small one
14:26 timotimo i bet branch prediction is very good at dealing with "goto" instructions
14:26 * colomon hopes that question was rhetorical.
14:27 brrt well, i would never bet on technology i don't fully understand
14:27 brrt or that's not really true
14:27 timotimo colomon: i could imagine that the instruction decoding stage of the pipeline would just immediately drop goto statements on the floor if they are absolutely useless
14:27 brrt maybe 'fully' and 'never' need attenuating
14:28 Rounin We're still a bit behind on "Why does anything exist in the first place" question
14:28 timotimo "i would never fully bet on technology i don't fully understand" :)
14:28 Rounin I mean, a JIT without a universe would be pretty novel
14:28 Rounin Or without electromagnetism
14:29 colomon timotimo: but even if it did drop it, taking the time to drop it is still an issue.  maybe a small one, but still an issue.
14:29 timotimo colomon: it's probably not as big an issue as removing a lexical lookup, or throwing out a redundant "set" instruction
14:29 colomon sure
14:29 brrt i build my next JIT on top of the weak nuclear force
14:30 timotimo brrt: then you'll get annihilated by the talented engineers at google who build their next javascript jit on top of the strong nuclear force ...
14:31 timotimo hmm, what about building an anti-JIT?
14:31 brrt a BIT - backwards in time
14:31 timotimo :D
14:31 timotimo with a BTTF deoptimization engine
14:32 timotimo (and don't forget to compensate for register flux)
14:32 zakharyas joined #perl6
14:33 timotimo did i ever mention the "solipsism + 1" philosophy i (claim that i) developed?
14:34 timotimo basically, it's the belief that the universe exists completely without an intelligence to experience it
14:35 Rounin So your claim implies that you are not intelligent
14:35 timotimo hm. actually, no microbenchmark even has a loop { } in it
14:35 Rounin Do you suffer from that Coutard delusion or whatever it's called
14:35 timotimo hm, i think "an intelligence" isn't the word i meant
14:35 timotimo "a consciousness" perhaps?
14:36 Rounin But then you're not conscious
14:36 timotimo is that the one where a person believes they are already dead?
14:36 Rounin Who is making the claim?
14:36 Rounin Yeah haha :D
14:36 timotimo i remember that
14:36 timotimo it's not a claim, it's a philosophy :P
14:37 JimmyZ hmm, the last version is slower than the exit version, though the exit version have wrong time
14:38 JimmyZ I mean Exclusive Time :P
14:38 timotimo hm, could be
14:40 pecastro joined #perl6
14:41 timotimo ... i thought frame handlers were super cheap and there should not be a noticable overhead to having a last inside a loop like that?
14:42 brrt frame handlers are cheap, yes
14:43 JimmyZ except when they are not
14:43 * brrt is not ready to get into discussions of 'consciousness' today
14:43 timotimo :D
14:45 brrt hang on, frame handlers are not free iirc
14:46 Ulti timotimo if I want to try and run your Cairo shooter on OSX do you have any tips for deps?
14:46 JimmyZ yeah, cheap doesn't mean free ;)
14:46 Ulti I have GTK and Cairo, but am having troubles with X server stuff and dbus
14:47 timotimo Ulti: give up right now.
14:47 brrt in the JIT, entering a frame handler means storing your bytecode position
14:47 timotimo Ulti: you can only find more pain
14:47 timotimo Ulti: but i've been working on an SDL2 port that works without GTK
14:47 [Coke] now getting malloc errors in rakudo-p
14:47 timotimo and without GTK you don't need X, because cairo is x-independent
14:48 brrt so that's relatively costly compared to not having it
14:48 timotimo brrt: did you read the label thing i found?
14:48 brrt no, not yet
14:48 brrt overbusy :-) can you point me to it?
14:48 [Coke] S05-interpolation/regex-in-variable.rakudo​.parrot..perl6-p(29944,0x7fff7987b310) malloc: *** error for object 0x7fcf1b9baad0: incorrect checksum for freed object - object was probably modified after being freed.
14:49 [Coke] rurban: ^^
14:49 timotimo brrt: let me try to reproduce it so you can look for yourself :)
14:49 [Coke] also timtoady, since that's a regex, and I know he just touched NQP.
14:50 [Coke] also happening in S05-metasyntax/litvar.t.
14:50 Ulti timotimo got rid of the X11 fail, now it just segfaults moar :D
14:50 timotimo https://gist.github.com/timo/911901053290122928bb
14:50 timotimo Ulti: i'm not doing error checking very well
14:51 brrt odd... hmm
14:51 brrt i have my suspicions why this is so, but note that it doesn't 'really matter' much :-)
14:51 brrt it is just inefficient
14:51 timotimo brrt: refresh and see more
14:51 timotimo how can emitting a label multiple times be correct?
14:52 timotimo oh, wait
14:52 timotimo are these just gotos?
14:52 brrt they're all emitted at the same place
14:52 brrt no
14:52 brrt they're labels
14:52 timotimo oh, because PHI have zero length
14:52 brrt basically, they do nothing but note to dynasm 'here's a special place'
14:52 brrt and probably they come from ending/starting the frame handler labels
14:53 brrt and several other ways you can get multiple labels
14:53 timotimo OK
14:53 timotimo that makes sense
14:53 brrt :-)
14:54 raiph joined #perl6
14:55 Ulti hmmm both cairo and gtk are working on their own for simple things like drawing a square and opening a blank window...
14:55 Ulti neat
14:56 Ulti and the only issue I had was not reading actionable output from brew when dbus was installed
14:58 timotimo oh?
14:58 timotimo well, ven had a lot more trouble
14:58 sorear joined #perl6
14:59 [Coke] if uniq is now deprecated, need updates to the spectest suite.
14:59 timotimo damn. perl6-bench outputs the commits in american-date-order :\
15:01 dalek gtk-simple: c9a432f | Matt++ | lib/GTK/Simple.pm6:
15:01 dalek gtk-simple: Deprecation of renamed method more -> emit
15:01 dalek gtk-simple:
15:01 dalek gtk-simple: Haven't tested this.
15:01 dalek gtk-simple:
15:01 dalek gtk-simple: Saw 1 call to deprecated code during execution.
15:01 dalek gtk-simple: ========================================​========================================
15:01 dalek gtk-simple: Method more (from Supply) called at:
15:01 dalek gtk-simple:   lib/GTK/Simple.pm6, line 542
15:01 dalek gtk-simple: Deprecated since v2014.10, will be removed with release v2015.10!
15:01 dalek gtk-simple: Please use emit instead.
15:01 dalek gtk-simple: ----------------------------------------​----------------------------------------
15:01 dalek gtk-simple: Please contact the author to have these calls to deprecated code adapted,
15:01 dalek gtk-simple: so that this message will disappear!
15:01 dalek gtk-simple: review: https://github.com/perl6/gt​k-simple/commit/c9a432f6cd
15:03 timotimo ah, yes. thank you!
15:06 Ulti np
15:06 bjz_ joined #perl6
15:07 * Ulti wistfully looks at WebKitGTK+ ^___^
15:08 Ulti farabi could be a desktop app then
15:08 Ulti the amount of GTK and WebKit specific stuff you have to have working looks kind of crazy though
15:09 timotimo :\
15:09 Ulti would be a lot easier to just automatically open a browser tab
15:09 timotimo might be easier to use the Chrome Embedding Framework, CEF
15:09 timotimo though i suspect that may be C++
15:13 KCL_ joined #perl6
15:16 nine If you're not tied to one browser engine, just open a browser for your app. The pain of embedding is just not worth it.
15:18 timotimo i agree
15:19 timotimo i recently tried to use "Brackets" or what it's called
15:19 timotimo i didn't get it to work at all.
15:20 * JimmyZ uses Brackets too
15:21 JimmyZ and it's nice Javascript project
15:22 timotimo JimmyZ: would you mind telling me how to get it to run?
15:22 JimmyZ I download the .deb package
15:22 timotimo oh
15:22 timotimo i have fedora %)
15:23 JimmyZ .oO( then only don't have .rpm)
15:23 JimmyZ *doesn't
15:24 telex joined #perl6
15:25 KCL joined #perl6
15:26 rindolf JimmyZ: JavaScript is spelled with a capital "S".
15:26 timotimo .o( Java'S Crap, T! )
15:27 timotimo .o( i pity de foolz who done Java )
15:27 hoelzro timotimo++ # github commentary
15:29 JimmyZ As far as Perl 6 is faster enough, we can use Perl 6 write a new backend for rakudo, just like the java one  :P
15:29 Ven joined #perl6
15:29 Ven masak: I'm not sure I linked it before. https://github.com/jashken​as/coffeescript/pull/3171
15:29 timotimo i'm glad you agree to my comment
15:29 timotimo JimmyZ: feel free to make perl6 fast enough so that we can bootstrap rakudo without nqp :)
15:30 JimmyZ :)
15:31 Ven .tell masak I'm not sure I linked it before. https://github.com/jashken​as/coffeescript/pull/3171
15:31 yoleaux Ven: I'll pass your message to masak.
15:31 masak computer, messages.
15:31 yoleaux 15:31Z <Ven> masak: I'm not sure I linked it before. https://github.com/jashken​as/coffeescript/pull/3171
15:31 masak Ven: interesting.
15:32 Ven Yeah. The discussion is a little bit interesting as well
15:32 masak aye.
15:32 timotimo brrt, JimmyZ, reducing the size of jitted code is always good for instruction cache reasons; so i suppose throwing out unnecessary gotos would be worth at least a tiny little something
15:34 Ven masak: in this case, they went with the "no ast sugar" approach. uncool :P
15:35 brrt timotimo: i agree
15:35 brrt what do you have in mind
15:35 masak Ven: well, it's one approach.
15:35 masak Ven: substitute from the outside.
15:35 Ven masak: hence the linking :)
15:35 masak Ven: it *does* solve the {{{ }}} issue :P
15:35 Ven masak: have you read more of 50 years of lisp?
15:35 masak Ven: no, but I've ordered it.
15:35 masak Ven: at some point I will read the web page you linked, too.
15:36 * Ven ordered and received homotopy type theory, but is still reading Chapter 0 by Aluffi for now... :)
15:36 masak Ven: patience. already later this week, I'll be more available.
15:36 Ven Well; I read a bit of HoTT already – and cried a lot.
15:36 masak cried?
15:36 Ven yes :)
15:36 timotimo brrt: was "what do you have in mind" aimed at me?
15:39 brrt yes
15:39 brrt :-)
15:39 timotimo ah
15:39 timotimo just throwing out gotos at the end of BBs that have only a single successor anyway
15:39 timotimo hm ... actually
15:40 timotimo i think i may have to only drop gotos at the end of BBs if their single successor is also the linear_next bb
15:49 brrt seems ok yes
15:49 JimmyZ Good night
15:50 masak night, 卓明亮
15:52 erkan joined #perl6
15:52 erkan joined #perl6
15:57 guru joined #perl6
16:16 kaleem joined #perl6
16:16 timotimo brrt: the "big loop" benchmark that i set as the title of the that gist builds 478418 bytes of jitted bytecode. does that seem like a lot?
16:17 brrt hmmm... it's a lot, yes, but not extraordinary i think
16:18 timotimo for 284 frames
16:18 brrt hmmm
16:18 brrt and how many opcodes?
16:19 brrt no, i don't think it is extraordinary
16:19 brrt if anything it's extraordinary on the rakudo level
16:19 virtualsue joined #perl6
16:21 chenryn joined #perl6
16:23 timotimo m:     778 append_ins: <wval>
16:23 camelia rakudo-moar cd9001: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/opk813zHjeâ�¤Two terms in a rowâ�¤at /tmp/opk813zHje:1â�¤------> [32m778 [33mâ��[31mappend_ins: <wval>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or met…»
16:23 timotimo 826 append_ins: <goto>
16:23 timotimo 2124 append_ins: <set>
16:23 timotimo oops.
16:23 timotimo those are the top 3
16:25 rurban I fixed my append performance problems in potion by overallocating by 3.
16:25 TimToady *3 or +3 ?
16:25 mr-foobar joined #perl6
16:26 rurban +3 was enough. I used for the 3 AST kids
16:26 acrussell joined #perl6
16:26 rurban But the number os append calls would be the same.
16:26 rurban os=>of
16:27 TimToady I think p5 grows overextends arrays 20% or so, iirc
16:27 rurban in your case you could benchmark if worthwhile
16:27 rurban was a huge win for me
16:28 TimToady unless it determined that you were shifting and pushing the same array, and then it would make it much larger to avoid lots of bulk copydowns
16:30 TimToady but also a lot of numbers were tuned to the powers-of-two malloc that p5 would supply if you asked for it
16:34 rurban not even +3, only mod 3. In blocks of multiples of 3.
16:34 b2gills I'm writing a post, what would you call this feature: 1,2,4 ... 32
16:35 timotimo m: say 1, 2, 4 ... 33
16:35 camelia rakudo-moar cd9001: OUTPUT«1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736…»
16:35 timotimo that wasn't what i wanted :)
16:35 timotimo m: say 1, 99, 33 ... *
16:35 camelia rakudo-moar cd9001: OUTPUT«===SORRY!===␤Cannot assign to a readonly variable or a value␤»
16:35 timotimo oh, i remember now, that recently broke
16:37 TimToady b2gills: I dunno, deduced is the word used in the specs
16:37 TimToady so maybe 'deduced sequences'
16:37 b2gills I think I can work with that
16:38 timotimo i wanted to tickle that expression out of camelia
16:40 dalek perl6-roast-data: 76824d6 | coke++ | / (4 files):
16:40 dalek perl6-roast-data: today (automated commit)
16:40 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/76824d63ac
16:40 TuxCM joined #perl6
16:41 masak b2gills: it's a geometric sequence in this case. arithmetic and geometric sequences are the two we deduce.
16:42 b2gills I was going for more of a general name of the feature
16:43 rurban m: describe 1, 2, 4 ... 33
16:43 camelia rakudo-moar cd9001: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/qanQ3f0Rh0â�¤Undeclared routine:â�¤    describe used at line 1â�¤â�¤Â»
16:45 flussence "DWIM"?
16:46 TimToady I suppose deduced sequences are knowably monotonic, so we could detect end-point crossing, but if the user supplies the iterator, we can't know that easily
16:47 TimToady so there's no way to eliminate the surprise, but we could push it back a little
16:48 TimToady m: say 1, -2, 4 ... *
16:48 camelia rakudo-moar cd9001: OUTPUT«1 -2 4 -8 16 -32 64 -128 256 -512 1024 -2048 4096 -8192 16384 -32768 65536 -131072 262144 -524288 1048576 -2097152 4194304 -8388608 16777216 -33554432 67108864 -134217728 268435456 -536870912 1073741824 -2147483648 4294967296 -8589934592 17179869184 -34359…»
16:49 TimToady or knowably non-monotonic, except in abs
16:50 TimToady however, warning at compile time for a sequence known not to terminate would be...quite a trick, if it were a huge sequence
16:51 TimToady unless we have an easy formula for "Is this number in this sequence?" that doesn't involve calculating the whole sequence
16:51 TimToady and how much work do you put into that if you can't solve the general case, anyway?
16:53 TimToady I guess arithmetic termination is just modular, and the geometric case would tend to diverge pretty quickly for powers significantly over 1
16:54 * colomon remembers that we changed to the current sequence rules because the old more DWIMy rules were a complete mess to implement…
16:55 TimToady the old dwimmy rules were trying to work for user-supplied functions as well, which doesn't
16:58 TimToady I guess for the geometric you want to look at representations in the base of the multiplier and see if the endpoint is representable with a single 1 bit followed by all zeros
16:58 TimToady so in the binary case, 33 is two set bits, not one
16:59 TimToady one could do something in logs to approximate the endpoint and see what matches, I suppose
17:01 TimToady if there were a way of guaranteed rational logs for exactness, that would help
17:01 TimToady but I think that's probably asking too much of math :)
17:02 guru joined #perl6
17:05 timotimo today, i'd love to try fuzz testing out
17:05 timotimo since i've never done this before for any language or program ... tips please? :)
17:06 timotimo also:
17:06 timotimo m: say "a", "aa" ... *
17:06 camelia rakudo-moar cd9001: OUTPUT«a 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 cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg…»
17:06 timotimo not what i mean ;(
17:06 timotimo m: say ("a", "b" ... "profit").elems
17:07 TimToady m: say [\~] 'a' xx *
17:07 camelia rakudo-moar cd9001: OUTPUT«(timeout)»
17:07 camelia rakudo-moar cd9001: OUTPUT«a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaa…»
17:07 TimToady mine's shorter anyway :)
17:07 timotimo aye. not bad
17:08 ajr joined #perl6
17:08 TimToady m: say [\~]('a' xx *) ... 'aaaaaaaaa'
17:08 camelia rakudo-moar cd9001: OUTPUT«a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa␤»
17:09 timotimo ooooooooh
17:10 ajr joined #perl6
17:11 ajr joined #perl6
17:15 ajr joined #perl6
17:18 masak m: say 'a', * ~ 'a' ... *
17:18 camelia rakudo-moar cd9001: OUTPUT«a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaa…»
17:19 guru joined #perl6
17:19 TimToady m: say 'a' X~ 1..*
17:19 camelia rakudo-moar cd9001: OUTPUT«a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 a64 a65 a66 a…»
17:19 TimToady m: say 'a' Xx 1..*
17:19 camelia rakudo-moar cd9001: OUTPUT«a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaa…»
17:20 timotimo that's cute
17:20 timotimo m: say 'a1' ... 'a99'
17:20 camelia rakudo-moar cd9001: OUTPUT«a1 a2 a3 a4 a5 a6 a7 a8 a9 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 g0 g1 g2 g3 g4 g5 g6 g7 g8 g9 h0 h1 h2 h3 h4 h5 h6 h7 h8 h9 i0 i1 i2 i3 i4 i5 i…»
17:20 timotimo oh, hehe.
17:21 TimToady m: say 'a00' ... 'a99'
17:21 camelia rakudo-moar cd9001: OUTPUT«a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 …»
17:21 masak m: say 'a' X~ 00 .. 99
17:21 camelia rakudo-moar cd9001: OUTPUT«Potential difficulties:â�¤    Leading 0 does not indicate octal in Perl 6; please use 0o0 if you mean thatâ�¤    at /tmp/Nj7_GSh6rM:1â�¤    ------> [32msay 'a' X~ 00[33mâ��[31m .. 99[0mâ�¤a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a1…»
17:21 masak m: say 'a' X~ 0 .. 99
17:21 camelia rakudo-moar cd9001: OUTPUT«a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 a64 a65 a6…»
17:21 TimToady m: say 'a00' ... 'a77'
17:21 camelia rakudo-moar cd9001: OUTPUT«a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 …»
17:21 masak m: say 'a' X~ ^100
17:21 camelia rakudo-moar cd9001: OUTPUT«a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 a64 a65 a6…»
17:22 masak m: say 'a' X~ (^100)>>.fmt("%02d")
17:22 camelia rakudo-moar cd9001: OUTPUT«a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 …»
17:24 KCL_ joined #perl6
17:27 andrewm joined #perl6
17:28 kaleem joined #perl6
17:29 [Sno] joined #perl6
17:35 pmurias joined #perl6
17:36 masak vendethiel: looking at it again, I think it's a bit of a stretch to call https://github.com/jashken​as/coffeescript/pull/3171 "hygienic".
17:38 [Coke] reminder, only one perl grant request came in this month, please comment it if you have something to say: http://news.perlfoundation.org/2014/​11/grant-proposal-ioall-redux-1.html (it's a p5 module that maybe we could steal some stuff from)
17:38 pmurias arnsholt: http://pastie.org/9745189
17:39 pmurias arnsholt: as the paste shows the variables are declared at *compile* time
17:39 pmurias arnsholt: it's that it's checked an initialisation time if they were set
17:43 cognominal joined #perl6
17:43 masak pmurias: only for the very specific case of 'write before read', though.
17:47 pmurias meant to say "it's that it's checked at runtime if they were set"
17:49 pmurias masak: what my paste was meant to illustrate is that 'if 1==0: x = 123' declares x
17:50 masak indeed.
17:50 masak in other words, the scoping is per function, not per block. just like `var` in JavaScript.
17:53 pmurias masak: they reference manual does not consider an if statement a block
17:53 pmurias "The following are blocks: a module, a function body, and a class definition."
17:53 masak oh, that makes sense.
17:54 masak but the difference to JavaScript is in terminology, not in semantics.
17:54 pmurias with no explicit way to declare a variable that sort of makes sense
17:56 pmurias masak: so my idea is that instead of using a hash table as a custom python scope, snake should keep a initalized flag
17:58 pmurias with my assumption being that a keeping some native int flags would be much cheaper than doing hash access
18:03 perturbation joined #perl6
18:05 alexghacker joined #perl6
18:08 khisanth__ joined #perl6
18:14 raiph joined #perl6
18:17 guru joined #perl6
18:18 alexghacker m: sub d( $first is copy, $second ) { say $first === $second }; my $a = []; my $b = {}; d( $a, $a ); d( $b, $b )
18:18 camelia rakudo-moar cd9001: OUTPUT«True␤True␤»
18:18 gfldex joined #perl6
18:20 alexghacker From S03, === is "For objects that are not value types, their identities are their values."
18:20 jnthn "is copy" dosn't mean "clone the thing"
18:20 alexghacker jnthn, I know it doesn't do a deep clone
18:20 jnthn It means "I want it assigned into a new Scalar, which I can assign to in my sub"
18:20 jnthn It doesn't do *any* clone.
18:20 alexghacker ah
18:20 alexghacker that's my problem
18:20 alexghacker (and why my deep clone attempts have all failed)
18:21 jnthn Yeah. Not sure there's a cute big of sugar for it
18:21 jnthn *bit
18:21 alexghacker the is copy is binding to the scalar holding the ref, not the ref itself
18:21 xinming joined #perl6
18:21 jnthn Yes, that's the way to understand it.
18:21 alexghacker jnthn++
18:22 alexghacker now, to be clear, if the proto read: sub d( %a is copy ), then that would create a new hash container, correct?
18:24 jnthn iirc, it is compiled as if you had written %a = the_incoming_param
18:24 jnthn So yeah, i'd be a new hash container and then assign the incoming one's contents into it.
18:25 jnthn uh, it'd :)
18:25 timotimo 478481 ← after
18:25 jnthn Being a hash container ain't legal here... :P
18:25 timotimo 478418 ← before
18:25 timotimo so ... the opposite of a win?
18:25 jnthn timotimo: Is bigger better or worse? And what is the number for? :)
18:25 timotimo sum of bytes of jitted frames
18:26 timotimo um
18:26 timotimo what the hell did i do
18:26 FROGGS joined #perl6
18:27 timotimo i used the same jitlog for both invocations and got different numbers?
18:27 timotimo ah, good
18:27 timotimo throwing away gotos at the end of BBs if the linear_next was the target of the goto anyway
18:28 timotimo m: say "only { 478481 R/ 473545 } as many bytes as it used to generate"
18:28 camelia rakudo-moar cd9001: OUTPUT«only 0.9896840 as many bytes as it used to generate␤»
18:28 jnthn Gee, nqp-j takes a while to build...
18:28 moritz if you're used to moar... :-)
18:28 timotimo m: say "(that means we saved { 478481 R- 473545 } bytes)"
18:28 camelia rakudo-moar cd9001: OUTPUT«(that means we saved -4936 bytes)␤»
18:28 timotimo oops
18:29 timotimo m: say "(that means we saved { 478481 - 473545 } bytes)"
18:29 camelia rakudo-moar cd9001: OUTPUT«(that means we saved 4936 bytes)␤»
18:29 timotimo ~4.8 kbytes less for the instruction cache to nom sounds good
18:29 moritz r the setting?
18:29 moritz s/r/for/
18:29 moritz m: say 4936 / 2**10
18:29 camelia rakudo-moar cd9001: OUTPUT«4.820313␤»
18:30 timotimo moritz: that's just a simple tight loop
18:31 timotimo perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_00_000_000 { last; } }'
18:32 timotimo moritz: i'll check out what amount of jit output the setting generates
18:33 timotimo oh, great!
18:33 timotimo /bin/sh: line 1: 31655 Segmentation fault      (core dumped) /home/timo/perl6/rakudo/../install/bin/nqp-m tools/build/gen-cat.nqp moar -f tools/build/moar_core_sources > src/gen/m-CORE.setting
18:36 moritz m: say 4936 / 478481
18:36 camelia rakudo-moar cd9001: OUTPUT«0.0103160␤»
18:37 timotimo huh. my code to strip off redundant gotos at the end of BBs seems to be wrong. and the other way i thought it could be right is apparently also wrong
18:38 jnthn Apparently, you reduced the amount of JIT output the setting makes... :P
18:39 timotimo i don't get that far
18:39 moritz by some 100% :-)
18:39 jnthn I'd have thought it's just "check if the goto target is the linear next"
18:40 timotimo yeah, me too
18:40 timotimo if (bb->last_ins->operands[0].ins_bb == bb->linear_next) {
18:41 jnthn Uh, you are checking is an unconditional goto instruction also, yes?
18:41 timotimo (and only if it's a goto)
18:41 timotimo yes
18:41 timotimo otherwise that could be mayhem :)
18:41 jnthn Are these occuring in the code we're originally getting?
18:41 timotimo but it's very probably hard to accidentally hit the memory address of the bb's linear next
18:41 jnthn Or as a result of optimizations?
18:41 timotimo probably as a result of an optimization
18:41 jnthn ah
18:42 timotimo in that case, it could be safer to put a little extra check in and not emit the goto in that case
18:42 jnthn Was gonna say, if they're in the original code, we can more easily just drop them while we build the spesh graph.
18:42 timotimo i should check that out.
18:42 jnthn Yeah. Though the code that does it is actually the longest function in the whole of the VM, I think... :)
18:43 timotimo ouch!
18:43 timotimo i'll look some other way in that case :P
18:43 jnthn :P
18:43 jnthn It doesn't mean it's inherently hard.
18:43 jnthn Just long.
18:44 jnthn It finds the BB boundaries
18:44 jnthn And creates instruction nodes.
18:44 jnthn The later creates BBs, and finally puts them into a CFG
18:45 * jnthn needs le diner
18:45 jnthn bbiab
18:48 smls joined #perl6
18:48 smls m: my $x = (2, 4, 6).BagHash; $x<4>--; say $x<4>; say $x.perl; say $x.kxxv
18:48 camelia rakudo-moar cd9001: OUTPUT«0␤(2=>1,4=>1,6=>1).BagHash␤2 4 6␤»
18:49 smls ^^ bug?
18:50 rindolf joined #perl6
18:50 colomon seems like
18:52 colomon m: my $x = (2, 4, 6).BagHash; $x<4> = 0; say $x<4>; say $x.perl; say $x.kxxv
18:52 camelia rakudo-moar cd9001: OUTPUT«0␤(2=>1,4=>1,6=>1).BagHash␤2 4 6␤»
18:54 FROGGS o/
18:56 smls m: my $x = (2, 4, 6).SetHash; $x<4> = False; say $x<4>; say $x.perl;   # same with SetHash...
18:56 camelia rakudo-moar cd9001: OUTPUT«False␤SetHash.new(2,4,6)␤»
18:56 smls or are elements not supposed to automatically disappear when their weight is set to 0/False ?
19:03 Sqirrel joined #perl6
19:03 colomon they are suppose to disappear
19:04 colomon and even if they don't, their value shouldn't be unchanged
19:04 colomon m: my $x = (2, 4, 6).SetHash; $x<1000> = True; say $x<4>; say $x.perl;
19:04 camelia rakudo-moar cd9001: OUTPUT«False␤SetHash.new(2,4,6,"1000")␤»
19:04 colomon ah
19:04 colomon that's your problem, maybe?
19:04 colomon m: my $x = (2, 4, 6).SetHash; $x{4} = False; say $x.perl;
19:04 smls oh, right
19:04 camelia rakudo-moar cd9001: OUTPUT«SetHash.new(2,6)␤»
19:05 smls colomon++
19:05 colomon yeah, not a bug, just an awkward thing
19:05 smls nah its fine, thats how object hashes that check identity with .WHICH are supposed to work...
19:14 timotimo aye.
19:14 timotimo good catch, colomon
19:16 smls Maybe Perl 7 will allow us to write   BagHash[Int()].new(2, 4, 6)   to get a mutable bag that automatically coerces all inputs to Int... :)
19:17 smls or Perl 6.x
19:17 mullagain joined #perl6
19:18 TimToady std: my Int() %bh is BagHash = 2,4,6;
19:18 camelia std 76ccee1: OUTPUT«ok 00:00 140m␤»
19:19 smls "is" ?
19:20 TimToady yes, that's how you replace the default Hash with something else, in theory
19:20 timotimo if you don't do that, you'll end up with a regular hash instead
19:20 timotimo or you'd have to bind
19:20 smls cool
19:20 smls doesn't seem to work yet, though
19:20 TimToady don't think it implemented thoguh
19:20 smls btw, why are types not coercive by default?
19:20 smls They are in C++, aren't they?
19:21 timotimo that's a different thing
19:22 timotimo in C++, the decisions will be done at compile time, no? and only for subclasses
19:22 moritz types aren't generally coercive in C++
19:22 timotimo we can coerce from different types in p6
19:22 timotimo like Str to Int/Num/Bool/...
19:22 smls well thats only for things that are coded to expect/work with Cool
19:23 smls not part of the type system itself
19:23 moritz though maybe with a copy constructor you can emulate it
19:23 mullagain is rakudo the standard compiler thus far?
19:25 sqirrel__ joined #perl6
19:25 moritz mullagain: yes (though standard by emergence, not by definition)
19:26 smls moritz: Well, methods like .Str/.Int sort of are the Perl 6 version of copy constructors, aren't they?
19:26 smls wait, no, the opposite
19:29 mullagain perl6 is using pthreads right?
19:30 TimToady perl6 is using a hybrid model
19:31 TimToady work is scheduled at a higher abstraction level and can be allocated to any of a number of real threads
19:31 mullagain ok thanks!
19:33 smls I like how Perl 6 lets you schedule a pice of code to be run on another thread
19:34 smls in Perl 5, you had to implement a custom thread pool for every use-case, because you  could only send simple data to other threads, not code objects
19:36 smls so the thread pool that started the threads, had to know about and implement all necessary functionality in advance
19:36 masak vendethiel: also, the macro system is vulnerable to multiple evaluation when parameterized nodes have side effects (such as `$i++`). but then, most macro systems are, I think.
19:36 vendethiel masak: oh, it's pretty bad
19:36 vendethiel masak: but it's ... trying :)
19:36 masak I'm not sure there's a good solution to that, except on a case-by-case basis inside of the macro.
19:37 mullagain does <key> replace {key}?
19:37 vendethiel mullagain: yes and no. key cannot be used to mean "key" anymore
19:37 vendethiel mullagain: so you can use {"key"} or <key>.
19:37 kurahaupo1 joined #perl6
19:37 TimToady heh, "A New Jersey hiker, mulled to death by a bear in September..."
19:38 mullagain ah ok, so the < is shorthand
19:38 masak m: sub key { say "bar" }; my %h = foo => "foo", bar => "bar"; say %h<key>; say %h{key}
19:38 camelia rakudo-moar cd9001: OUTPUT«(Any)␤bar␤(Any)␤»
19:38 masak m: sub key { "bar" }; my %h = key => "foo", bar => "bar"; say %h<key>; say %h{key}
19:38 camelia rakudo-moar cd9001: OUTPUT«foo␤bar␤»
19:38 masak mullagain: ^
19:39 * TimToady hopes not to be mulled to death...
19:39 kurahaupo1 TimToady: slowly boiled to death?
19:39 TimToady I'll have to mull that over...
19:39 mullagain haha
19:40 TimToady anyway, that popped up in Google News a bit ago
19:42 PacoLinux joined #perl6
19:42 anaeem1 joined #perl6
19:43 mullagain so rakudo is written in java?
19:45 masak no, Rakudo is written in mostly Perl 6 and NQP.
19:45 masak some of the JVM backend stuff is written in Java.
19:45 mullagain i was just compiling and i saw stuff like this /home/mike/rakudo-nom/install/bin/nqp-j --target=jar --output=blib/Perl6/Compiler.jar --encoding=utf8 \
19:48 user3 joined #perl6
19:48 jluis_ joined #perl6
19:48 hoelzro is there a QAST::Op for getting the current global context of the module being loaded?
19:48 moritz mullagain: rakudo supports three backends; oneof them is the JVM
19:49 hoelzro I think https://github.com/rakudo/rakudo/​blob/nom/src/Perl6/World.nqp#L361 is missing a parameter to the current GLOBALish, and I'd like to see if inserting that fixes things
19:50 dwarring joined #perl6
19:56 dwarring java interop question on SO - http://stackoverflow.com/questions/2715632​9/how-do-i-invoke-a-java-method-from-perl6
20:00 dalek nqp: d0a0d50 | jonathan++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/ (2 files):
20:00 dalek nqp: Don't allocate longlit array every NFA run.
20:00 dalek nqp: review: https://github.com/perl6/nqp/commit/d0a0d50fe4
20:06 raiph joined #perl6
20:11 smls m: class A { has $.n; method WHICH { "a" } }; say set A.new(n => 1), A.new(n => 2), A.new(n => 3)
20:11 camelia rakudo-moar cd9001: OUTPUT«set(A.new(n => 3))␤»
20:11 smls :P
20:22 kurahaupo joined #perl6
20:25 vti joined #perl6
20:30 Mouq joined #perl6
20:33 smls m: my $a = [[1, 2], [3, 4]]; my $b = $a.deepmap(*.clone).Array; $a[0][0] = 7; say $b.perl
20:33 camelia rakudo-moar cd9001: OUTPUT«[[1, 2], [3, 4]]␤»
20:33 smls ^^ Is this the best way to deep-clone an array?
20:35 moritz it's not deep enough, I fear
20:36 smls ?
20:36 moritz m: my $a = [{ a => [1]}]; my $b = $a.deepmap(*.clone).Array; $a[0]<a>[0] = 42; say $b.perl
20:36 camelia rakudo-moar cd9001: OUTPUT«[{"a" => [1]}]␤»
20:36 moritz seems I'm wrong
20:40 Mouq m: my $a = [{ a => b => [1]}]; my $b = $a.deepmap(*.clone).Array; $a[0]<a><b>[0] = 42; say $b.perl
20:40 camelia rakudo-moar cd9001: OUTPUT«[{"a" => "b" => [42]}]␤»
20:47 smls so it doesn't descend into a Pair, because it doesnit count as a map'able collection?
20:47 smls makes sense I guess
20:54 Mso150 joined #perl6
20:58 moritz the problem is really that it hits .clone eventually
20:58 moritz and .clone isn't deep
21:05 smls m: my $a = [{ a => b => [1]}]; my $b = EVAL $a.perl; $a[0]<a><b>[0] = 42; say $b.perl
21:05 camelia rakudo-moar cd9001: OUTPUT«[{"a" => "b" => [1]}]␤»
21:05 smls :)
21:05 anaeem1_ joined #perl6
21:05 Mso150 joined #perl6
21:06 kurahaupo joined #perl6
21:08 prime joined #perl6
21:17 timotimo o/
21:26 dalek roast: ffc87fa | usev6++ | S03-sequence/basic.t:
21:26 dalek roast: Add second test for RT #78324
21:26 dalek roast: review: https://github.com/perl6/roast/commit/ffc87fad90
21:26 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=78324
21:33 brrt joined #perl6
21:34 raiph joined #perl6
21:38 timotimo webpagetest tells me rakudo.org's front page could benefit from gzip transfer encoding (down to 18%) and giving caching meta-information to style.css, recaptcha.css, another style.css, rakudo-1001.png (interestingly from rakudoperl.org), wordpress.png and favicon.ico
21:39 tony-o btyler: i'm working on a refactor for http server async that is looking like it handles async (like the name implies) significantly better, what siege settings were you using?
21:39 tony-o btyler: https://gist.github.com/to​ny-o/3f7ac835659b0152d1eb
21:40 moritz timotimo: I haven't done anything on rakudo.org, because I know I can't fix it if I break it
21:41 masak TimToady: re https://github.com/perl6/specs/commit/f​22ee3e888fa7541090a1113403281b5308c5701 -- what's the rationale for character classes not participating in longest literal matching?
21:41 timotimo i understand
21:41 timotimo tony-o: yays!
21:41 timotimo i like hearing that
21:42 timotimo i wonder how we could implement farabi6 on top of HTTP::Server::Async if available (aka if MoarVM) and otherwise run it on HTTP::Server::Simple
21:42 tony-o farabi6 is that ide?
21:42 timotimo yes, it is
21:43 timotimo i think it could benefit from asynchronous features
21:43 tony-o i might try to port a templating system i wrote for p5
21:43 moritz masak: because in the end, everything comes down to either literals or character classes
21:43 tony-o not sure yet, though
21:43 timotimo we don't need templating for farabi :)
21:43 moritz masak: and if you equate them, there's no disambiguation anymore
21:44 timotimo with the example you gave me for taking over an existing connection i should be able to implement EventSource server-side, right?
21:44 timotimo tony-o: and how hard would it be to add keepalive to HTTP::Server::Async?
21:44 telex joined #perl6
21:45 tony-o timotimo: not really sure, it's a total rewrite of the Async.pm6 so give me a couple of days to get it to where the current one is. i don't imagine adding keep-alive should be too tough
21:45 timotimo OK :)
21:46 timotimo do you have a clue how hard HTTP2/SPDY is?
21:47 tony-o i don't, i was reading libmicrohttpd source earlier today though
21:48 prime joined #perl6
21:49 alexghacker joined #perl6
21:49 tony-o i need to read more about spdy
21:50 timotimo spdy is being deprecated by http2 anyway
21:50 timotimo it'll mostly be interesting to find out how http2 became the way it is
21:57 masak moritz: that's not true. both literals and character classes have width. zero-width assertions don't, so they (for example) could be the thing that halts longest-lit. ditto quantifiers and/or capturing groups.
21:57 moritz masak: well, let me rephrase
21:58 moritz masak: in a successful parse, every character of a string is consumed either by a literal or by a char class
21:59 moritz masak: so it's just a very natural approach to say that a char consumed by a literal is more specific than one consumed by a char class, thus it should get precedence
21:59 masak no argument there.
22:00 masak I guess what I'm asking about is what "force" made TimToady decide that `<[abc]>` differs in semantics from `[ a | b | c ]`
22:00 masak ("force" in the "forces acting on the problem" sense.)
22:01 moritz not being TimToady, I can only speculate :-)
22:01 masak I can totally see how `\w` is not considered part of a literal prefix. I have a harder time making that argument with `<[abc]>`.
22:01 FROGGS masak: when you parse something, you usually have keywords, and these usually should be preferred over \w+ and friends
22:02 masak well, see what I just wrote.
22:02 moritz masak: what about a..z ?
22:02 moritz there seems to be a spectrum here
22:02 FROGGS examples with one characters things does not help here
22:02 masak moritz: I'm aware that it's a slippery slope. especially since `\w` could also go inside `<[ ]>`
22:03 masak FROGGS: disagree. `<[abc]>` is (in some sense) *literal*, but `\w` is not.
22:03 moritz literals, enumerations, ranges, properties, negated ranges, negated enumerations
22:03 masak moritz: right.
22:03 masak moritz: which is why one possible answer I can imagine from TimToady is "I figured it was just easier to draw the line earlier".
22:03 moritz and it would feel equally weird to say that <[abc]> behaves differently from <[a..c]>
22:04 moritz masak: also char class vs. non-char-class is very clear line
22:04 masak right, that's what I mean.
22:04 masak by "easier".
22:04 moritz masak: except that you wrote "earlier" :-)
22:04 FROGGS masak: show me a parser where you want to treat <[abc]> equally to keywords
22:05 masak FROGGS: /<[Ff]>alse/
22:05 FROGGS keywords are more important in the way they also define an order of the chars
22:06 moritz FROGGS: also there's FORTRAN, where variables staring with certain letter ranges get certain default types; I can well imagine the use of a char class there. But overall, I agree with your point
22:06 moritz FROGGS: it's very practical, whereas we have been discussing things more from a purity PoV
22:06 FROGGS masak: that slightly feels like a "misuse" of cclasses :o)
22:08 masak FROGGS: oh, so you would prefer /[F|f]alse/ ?
22:08 FROGGS letting LLTM also treat cclasses like literals just to compress your grammar might not be the best choice
22:08 masak FROGGS: then will you be the one to explain to the newbie why they are different? :)
22:09 FROGGS masak: I think I prefer /False | false/
22:09 masak FROGGS: that is also an unsatisfactory cop-out.
22:09 masak TimToady: will the zany `G<*n|enesis>` syntax participate in longest lit? :)
22:10 FROGGS everything is about tradeoffs... and I'd like to have the line between cclasses and literals where it is now
22:11 FROGGS I hope TimToady can argue better than I can :o)
22:11 masak me too :)
22:11 alexghacker so I've done a bunch of work trying (and failing) to implement an naive but general deepclone, but while reading S32 I think I found that there's one more-or-less built in
22:11 alexghacker m: my $h = { a => 1, b => [ 2, 3, { c => 4, d => 5, f => { g => -1 } } ] }; my $i = $h.deepmap( { $_ } ); $i{'b'}[2]{'e'} = 6; $i{'b'}.unshift(0); $i{'e'} = 7; say $h; say $i
22:11 camelia rakudo-moar cd9001: OUTPUT«"a" => 1, "b" => [2, 3, {"f" => {"g" => -1}, "d" => 5, "c" => 4}]␤"a" => 1, "b" => [0, 2, 3, {"e" => 6, "f" => {"g" => -1}, "d" => 5, "c" => 4}], "e" => 7␤»
22:12 alexghacker .deepmap( { $_ } ) appears to do the trick perfectly
22:12 FROGGS I guess one problem is that <[abc]> is a too simple view on these kind of cclasses
22:13 masak alexghacker: for a mix of arrays, hashes, *and* arbitrary objects?
22:13 alexghacker masak: not for arbitrary objects
22:13 * alexghacker wasn't looking for that to begin with
22:13 masak ok.
22:16 alexghacker although if the object were Iterable, then in theory deepmap would recurse into it
22:17 alexghacker (exactly what that would mean for an "exotic" Iterable object that was a proxy for a database is left unsaid)
22:18 alexghacker cloning objects properly isn't something that can be solved generally anyway.  the object has to cooperate.
22:19 raydiak good afternoon #perl6
22:20 denis_boyun joined #perl6
22:30 raydiak was thinking about junctions last night...why don't we want people introspecting them? everyone says "use a set", but sets don't autothread which is the reason people try to use junctions in that way in the first place
22:30 raydiak so then I was thinking about a different type of autothreading container class, but without knowing what the attitude towards junctions is about, I can't exactly evaluate the viability of my ideas
22:32 bartolin joined #perl6
22:33 brrt left #perl6
22:39 tony-o how do i determine if IO::Socket::Async.listen was successful?  or die doesn't seem to work even if the listen failed
22:40 TimToady raydiak: you're basically asking for the proposed Each type
22:41 jnthn tony-o: Same as with any Supply, you subscribe to the quit event
22:41 jnthn (Given as a named argument to .tap)
22:42 TimToady on the alternation vs cclass thing, we already had to handle alternations for longest literals, so the only question is whether to extend it further.  Going to any character class is a big jump, at least from an implementation point of view, so that's where I drew the line
22:43 dadada joined #perl6
22:43 dadada hi
22:43 raydiak TimToady: thanks, I can stop thinking about it then
22:43 dadada so parrot is dead, yes?
22:44 TimToady parrot: say "Hi, I'm dead."
22:44 TimToady p: say "Hi, I'm dead."
22:44 camelia rakudo-parrot cd9001: OUTPUT«Hi, I'm dead.␤»
22:44 dadada ok, thought so
22:45 Mouq I think that's TimToady++'s cryptic way of saying "no"...
22:45 Mouq :P
22:45 jnthn .oO( Was the choice ofg "yes yes yes" as a nick when asking that question deliberate? :) )
22:45 jnthn *of
22:46 jnthn Anyways, sleep time here...should have more Perl 6 time again soon, to continue the native array work. :)
22:46 jnthn o/
22:46 TimToady you think that's cyrillic?
22:46 jnthn TimToady: No, just translit'd :)
22:46 jnthn I'm so tired I see things in all kinds of ways by this point :P
22:46 TimToady maybe it's just a dadadaist
22:47 jnthn :)
22:47 jnthn &
22:47 dadada if you really want to know my nick is inspired by this https://www.youtube.com/watch?v=vMZcXQCYwG0
22:50 tony-o jnthn: https://github.com/tony-o/perl6-http-server-​async/blob/dev/lib/HTTP/Server/Async.pm6#L48
22:51 tony-o jnthn: i have that but never see it executed when i try to connect to the server and recv a 'connection refused'
22:53 alexghacker joined #perl6
23:06 woolfy joined #perl6
23:09 lizmat joined #perl6
23:13 kjs_ joined #perl6
23:17 smls TimToady: If Set() is a coercer, why does it take arbitrarily many arguments?
23:18 smls m: say Set(2, 3, 'a'=>4)
23:18 camelia rakudo-moar cd9001: OUTPUT«set(2, 3, a)␤»
23:20 smls I'm getting the feeling that subroutine forms of coercers don't really carry their weight.
23:21 woolfy left #perl6
23:23 smls Little benefit for the added confusingness (e.g. they don't exactly reinfoce the message of the GLR separation of methods invocants vs subroutine args)
23:24 smls What is the reason for having them, other than to have Int() as direct replacement of P5's int()?
23:29 raydiak tony-o: sorry if this is too obvious, but if the server appears to listen without error, are you sure your requests are reaching it and not hitting a filter/firewall/whatever?
23:31 denis_boyun_ joined #perl6
23:34 raydiak tony-o: if it helps narrow it down, examples/echoserver works fine here on your dev branch
23:54 adu joined #perl6
23:54 adu hey
23:54 raydiak hi adu
23:54 adu I have an algo question
23:55 adu how do I write a function that takes f(x, [a, b, c])
23:55 adu and gives "<apply>" ~ a ~ "<apply>" ~ b ~ "<apply>" ~ c ~ x ~ "</apply></apply></apply>"
23:57 raydiak m: sub foo ($x, @($a, $b, $c)) {.say for $x, $a, $b, $c}; foo(1, [2, 3, 4])
23:57 camelia rakudo-moar cd9001: OUTPUT«1␤2␤3␤4␤»
23:58 adu um, what about a..z?
23:59 adu like maybe rv = x, then rv ~= "<apply>" ~ item ~ rv ~ "</apply>"

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

Perl 6 | Reference Documentation | Rakudo