»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
00:01
FROGGS left
|
|||
Mouq | github.com/sillymoose/Perl6-One-Li...t-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 | ||
Mouq | Is there a simpler way to write `$_ ~= "\n"` that I don't know about? | 00:09 | |
Having `~="\n"` seems like it would violate TTIAR | |||
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
|
|||
Mouq | m: sub prefix:<~=> ($s) { CALLER::<$_> ~= $s }; $_ = "hooray"; ~="\n"; .print # more like.. :) | 00:14 | |
camelia | rakudo-moar e1aa07: OUTPUT«hooray» | ||
00:14
exixt is now known as EXIXT
|
|||
TimToady | m: sub postfix:<n> ($x) { $x ~ "\n" }; print 42\n; | 00:17 | |
camelia | rakudo-moar e1aa07: OUTPUT«42» | ||
TimToady | just don't trying append a tab that way :) | ||
s/ing// | 00:18 | ||
er, s/ing/ to/ | |||
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
00:33
perturbation left
00:39
denis_boyun_ left
00:44
jakesyl left
00:56
KCL_ joined
|
|||
dalek | p: ba888b5 | TimToady++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java: one test for special cases; if -> switch; fix tabs Seems to run about 1.5% faster. |
01:00 | |
01:01
bjz joined
01:04
anaeem1 joined
01:05
anaeem1 left
|
|||
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: 71: 142: 83: 1Total 300 1 2 33 0 1 20 1 2 30 2 1 31 2 0 30 1 3 20 1 2 30 1 2 31 2 0 30 2 1 30 1 2 31 0 2 32 1 0 30 2 1 31 3 2 02 1 0 31 2 0 32 0 1 32 1 0 31 2 0 31 0 2 30 1 2 …» | ||
01:05
anaeem1 joined
|
|||
Mouq | ^^ One-line version of github.com/perl6/perl6-examples/bl...-731696.pl | 01:05 | |
TimToady | good thing my window is so wide... | 01:08 | |
01:10
anaeem1 left
|
|||
TimToady | that 1.5% faster was the timing on the parse phase of the setting, btw | 01:12 | |
timotimo | cute | ||
more of that? :) | |||
TimToady | overall build time was actually about 5% faster | 01:13 | |
but not very scientifically done | |||
timotimo | so switch/case is faster than if/else in java? | 01:15 | |
arnsholt | Probably | 01:18 | |
switch compiles to a jump table, so if there are many branches, I wouldn't be surprised | |||
dalek | p: 489bd97 | TimToady++ | src/vm/parrot/ops/nqp.ops: one test for special cases; if -> switch; fix tabs (same for parrot as we just did for jvm) |
01:20 | |
01:22
colomon joined
|
|||
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 | ||
yes, the NFA is definitely hot code | |||
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" | ||
so 'when 1' is always integer comparison | 01:24 | ||
hence optimizable | |||
arnsholt | True, true | ||
TimToady | also strings, where you could dispatch based on, say, the first character | ||
01:25
kst` is now known as kst
|
|||
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 | |
so it would be good to group them | |||
one could go as far as to generate a trie of all the strings, I suppose | 01:26 | ||
01:26
dayangkun joined
|
|||
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 | ||
timotimo | will foo[1]['bar'] += 10 create foo[1]['bar'] if foo[1] is a dictionary that does not include 'bar' yet? | ||
most probably not :\ | 01:27 | ||
TimToady | well, I don't think either python or ruby do autoviv the way perl does | ||
that's kinda one of perl's distinctives | |||
arnsholt | Standard Python dicts won't, no | 01:28 | |
There's defaultdict though, if you want that behaviour | |||
TimToady | even if perl5 botches it in spots | ||
01:32
vike left
01:37
Akagi201 left
01:41
bjz left
|
|||
Mouq | github.com/perl6/perl6-examples/bl...ut/RESULTS | 01:48 | |
timotimo | 2009 | 01:50 | |
i hope we've improved a bit since then | |||
Mouq | A lot :) | 01:51 | |
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 | ||
Mouq | N-Body: Was: 550x slower than p5. Is: 47.3x. Is, with s/Num //: 27.8x | 02:02 | |
Although it looks like p5 takes more of a lead as N increases | 02:03 | ||
Mouq finds it LTA that slurp() no longer works... :/ | 02:04 | ||
colomon | slurp in p5 no longer works? | 02:05 | |
Mouq | Regex-DNA: Was 410x, is 16.9x | ||
in p6 | |||
m: say slurp | |||
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 | ||
camelia | rakudo-jvm e1aa07: OUTPUT«Can't open perl script "/home/camelia/jvm-rakudo/eval-client.pl": No such file or directory» | ||
Mouq | p: say slurp | ||
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…» | ||
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 | ||
Mouq | Wait | 02:08 | |
Yeah | |||
colomon: Yeah, but just plain 'ol `slurp` to get STDIN seems borked | |||
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... | ||
Mouq | Fasta: Was 590x, is 15x | 02:11 | |
Oh, wait | 02:12 | ||
Well, I just realized I'm on a Rakudo from October | 02:13 | ||
But if camelia fails it, it's definitely still a bug :P | |||
japhb | Mouq: Are these with no types, native types (num), or high-level types (Num)? | 02:18 | |
Mouq | The timings? No native types. High-level types are used in repo's current N-Body impl and slow it down | 02:20 | |
TimToady | well, Num is really not a very high-level type, just a num in disguise | 02:25 | |
Int is rather further from int, I think | 02:26 | ||
dalek | p: ce191a8 | (Timo Paulssen)++ | / (2 files): show allocations split into interpd/speshd/jitted frames |
02:34 | |
timotimo | ^- enjoy | ||
raydiak | timotimo++ | 02:35 | |
02:38
dj_goku joined
02:39
adu joined,
cognominal left
02:40
jimmy_ joined
|
|||
colomon | Mouq: yeah, the set encoding requires an object with REPR MVMOSHandle was the error I was getting | 02:43 | |
02:45
ilbot3 left
02:46
perturbation joined,
adu left,
ilbot3 joined
02:47
adu joined,
cognominal joined
02:48
KCL joined
02:50
chenryn joined
02:51
KCL_ left,
Mouq left
02:54
jimmy_ is now known as JimmyZ,
dayangkun left
|
|||
timotimo | i hope it's correct | 03:00 | |
dj_goku | does anyone know a good way to contact FROGGS? | 03:02 | |
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…. | |||
timotimo | otherwise [email@hidden.address] | ||
dj_goku | .tell FROGGS testers.perl6.org front-end seems to be down. :( | ||
yoleaux | dj_goku: I'll pass your message to FROGGS. | ||
timotimo | cpandatesters.org/ seems to work | 03:04 | |
dj_goku | hmm maybe it is my internet? | ||
because that didn't work either. | |||
timotimo | oh | ||
dj_goku | hmm from my vps it does. | ||
weird they both work from my vps. | 03:05 | ||
03:05
kurahaupo joined
|
|||
dj_goku | lol quit safar and now it works. | 03:06 | |
:( | |||
s/safar/safari/ | 03:07 | ||
03:20
noganex_ joined
03:22
noganex left
03:24
perturbation left
03:34
vike joined
03:44
Mso150 joined
03:48
adu left
03:51
Mso150 left
|
|||
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) | 03:55 | |
04:05
Mouq joined
04:09
raiph joined
04:13
rmgk left
04:14
rmgk joined
04:16
zakharyas joined
04:25
vike left
04:40
chenryn left
04:54
KCL_ joined
04:55
chenryn joined
04:56
KCL left
04:58
kurahaupo left
|
|||
TimToady | .oO(and a pony) |
05:01 | |
05:02
kaleem joined
05:04
anaeem1_ joined
05:08
anaeem1_ left
|
|||
ssqq | write *use v6* or ignore it, Have any difference? | 05:10 | |
05:12
mr-foobar left
05:13
zakharyas left
05:17
kaleem left
05:36
adu joined
05:49
kurahaupo joined
05:52
dayangkun joined
05:55
raiph left
05:58
kaare_ joined
|
|||
moritz | good morning | 06:10 | |
ssqq: with 'use v6;', you get a much better error message if you accidentally run it with perl 5 | |||
ssqq: that has happened to me quite a few times :-) | |||
also, it makes it easier for tools (like syntax hilighters) to reliably determine the language | 06:11 | ||
JimmyZ | ssqq: 好久不见 | ||
ssqq | JimmyZ: 好久不见。 | 06:29 | |
moritz: I found CORE:.kyes have not change when ignore *use v6* | 06:30 | ||
06:33
dayangkun left
06:49
anaeem1_ joined
06:50
adu left
06:57
kurahaupo left,
ssqq left
06:58
telex left
07:00
kurahaupo joined,
telex joined
07:01
kaleem joined
07:07
denis_boyun joined
07:10
salv0 left
07:25
blackbolt joined
07:26
salv0 joined
07:27
gfldex joined
07:36
jluis joined
|
|||
dalek | c: cbcd9b0 | Mouq++ | lib/Language/operators.pod: Get rid of a TODO for dotty ops |
07:39 | |
07:47
vti joined
07:49
[Sno] left
07:51
abraxxa left
08:00
FROGGS joined
08:05
gfldex left
08:09
Mouq left
|
|||
masak | mornin', #perl6 | 08:11 | |
08:13
blackbolt left
|
|||
lizmat | morning masak | 08:13 | |
lizmat is about to commute to Lyon | 08:14 | ||
for the Patch -p2 Hackathon | |||
moritz | .oO( the Lyon sleeps tonight ) |
||
lizmat | .oO( I would by Lyon if I said that was wrong ) |
||
raydiak | Lyon in green pastures? | 08:16 | |
Lyon battery in my laptop? | |||
lizmat hopes it won't be freezing in Lyon | |||
.oO( I don't like your Lyon Ice ) |
|||
lizmat must stop with bad Lyon puns | 08:17 | ||
08:17
Alina-malina left
08:18
virtualsue joined
|
|||
masak .oO( I still have a milLyon of them left! ) | 08:19 | ||
08:20
bjz joined,
Alina-malina joined
08:22
rurban joined
|
|||
raydiak | g'night #perl6 | 08:25 | |
08:27
kjs_ joined
|
|||
masak | 'night, antipodal raydiak | 08:29 | |
08:29
Mso150 joined
08:30
darutoko joined
08:42
Mouq joined
08:43
[Sno] joined
08:50
ptc_p6 joined
08:54
woolfy left
09:01
Alina-malina left
09:05
Alina-malina joined
09:07
Mouq left,
rindolf joined
09:10
kjs_ left,
virtualsue left
|
|||
dalek | kudo/newio: 124cab4 | (Elizabeth Mattijsen)++ | src/core/PIO.pm: First version of PIO role (untested as yet) |
09:10 | |
kudo/newio: 8af1338 | (Elizabeth Mattijsen)++ | src/core/IO/Pipe.pm: IO::Pipe first consumer of PIO role |
|||
sven_123 | perl6: say 3+4 | ||
camelia | rakudo-{parrot,moar} e1aa07: OUTPUT«7» | ||
lizmat | commute to Lyon& | 09:11 | |
09:11
lizmat left
09:15
fhelmberger joined
|
|||
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. :( | ||
camelia | rakudo-moar e1aa07: OUTPUT«1 2 4 8 16 32» | ||
FROGGS | damn | ||
JimmyZ | m: say 1, 2, 3 .. 10 | 09:20 | |
camelia | rakudo-moar e1aa07: OUTPUT«123..10» | ||
JimmyZ | m: say 1, 2, 3 ... 10 | ||
camelia | rakudo-moar e1aa07: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
JimmyZ | m: say 1, 2, 5 ... 10 | ||
camelia | rakudo-moar e1aa07: OUTPUT«===SORRY!===Cannot assign to a readonly variable or a value» | ||
FROGGS | eww | ||
that sounds like it fails to generate the exception or so | |||
09:21
sqirrel__ joined
|
|||
FROGGS | dj_goku: thanks, I restarted it | 09:21 | |
JimmyZ | aye | ||
09:21
bjz left
|
|||
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…» | ||
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 …» | ||
FROGGS | m: say 1, 2 ... 32, 33 ... 40 | ||
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» | ||
FROGGS | m: say 1, 2, 4 ... 32, 33 ... 40 | ||
camelia | rakudo-moar e1aa07: OUTPUT«1 2 4 8 16 32 33 34 35 36 37 38 39 40» | ||
FROGGS | well, at least that still works... | ||
09:22
bjz joined
|
|||
FROGGS | I'll rakudobug the other issue | 09:22 | |
JimmyZ | Thanks :) | 09:23 | |
09:24
Alina-malina left
09:29
vike joined
|
|||
sven_123 | FROGGS - is there a big difference between 'perl6:' and 'm:'? | 09:30 | |
masak | m: say 4 | 09:31 | |
camelia | rakudo-moar e1aa07: OUTPUT«4» | ||
masak | perl6: say 4 | ||
camelia | rakudo-{parrot,moar} e1aa07: OUTPUT«4» | ||
masak | p: say 5 | ||
camelia | rakudo-parrot e1aa07: OUTPUT«5» | ||
masak | sven_123: hope that answes it. | ||
09:32
dakkar joined
|
|||
JimmyZ | time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 10000000 { exit; } }' # real 0m0.934s | 09:34 | |
time php -r '$n =0; for(;;) { if($n++ == 10000000) { exit; }}' # real 0m0.490s | |||
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: | ||
JimmyZ | time perl6 -e 'my int $n = 0; loop { 10000000.rand; $n = $n +1; if $n == 10000000 { exit; } }' # real 0m10.562s | 09:35 | |
time php -r '$n =0; for(;;) { rand(1, 100000000); if($n++ == 10000000) { exit; }}' #real 0m4.185s | |||
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 | ||
camelia | rakudo-moar e1aa07: OUTPUT«웃» | ||
masak | :D | 09:37 | |
masak hopes he just created a new type of obfuscated Perl 6 code category | |||
sven_123 | thx :) | 09:38 | |
09:44
zakharyas joined
09:53
pecastro joined
09:55
ptc_p6 left
09:56
ptc_p6 joined
09:57
EXIXT is now known as exixt
10:00
Ugator joined
10:03
virtualsue joined
|
|||
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. | ||
JimmyZ | .tell timotimo please igonre ':' | ||
yoleaux | JimmyZ: I'll pass your message to timotimo. | ||
10:11
risou is now known as risou_awy
10:12
pecastro left,
risou_awy is now known as risou
10:14
cognominal left
|
|||
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:21
chenryn left
|
|||
Ulti | masak that reminds me of a code golf I did in Java codegolf.stackexchange.com/question...3401#23401 | 10:23 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=23401 | ||
10:25
kjs_ joined
10:28
exixt is now known as EXIXT
10:29
JimmyZ left
10:30
EXIXT is now known as exixt
10:34
zakharyas left
10:36
sunnavy left,
sqirrel__ left
10:38
daxim joined
10:41
chenryn joined
10:44
pecastro joined
10:49
Mso150 left
10:52
Mouq joined
10:56
Mouq left
11:00
anaeem___ joined
11:03
anaeem1_ left
11:13
sunnavy joined
11:25
pecastro left
11:27
pecastro joined
|
|||
masak | Ulti: writing that stick figure was fun. I'm pondering writing a (short) blog post about it. :) | 11:28 | |
masak ponders what it'd take to eliminate the synopsebot false positive above | 11:35 | ||
either "is this #NNNNN thing not part of a URL?" or "was there whitespace or BOL before the '#'?" | 11:37 | ||
11:45
pecastro left
11:49
bloonix left
11:54
chenryn left
|
|||
tadzik | well, we can have a test suite :) | 11:55 | |
12:06
pmurias joined
|
|||
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:08 | |
12:12
pecastro joined
12:35
sqirrel__ joined
|
|||
arnsholt | pmurias: Yeah, the relevant piece of spec is docs.python.org/3/reference/execut...nd-binding | 12:40 | |
It seems to me that this comes from the easy way to implement this in a simple interpreter: a chain of hashtables | 12:41 | ||
On read, walk the chain looking for the key, and throw an exception if you can't find it | |||
Assignment just binds to the top hashtable on the stack | |||
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:42 | ||
12:46
pmurias left
12:49
Alina-malina joined,
Alina-malina left,
Alina-malina joined
|
|||
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 | ||
10:09Z <JimmyZ> timotimo: please igonre ':' | |||
10:16Z <JimmyZ> timotimo: and I see Exclusive Time on exit is 18446744073709.23ms .. | |||
12:58
spider-mario joined
|
|||
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 | |
12:59
JimmyZ joined
|
|||
JimmyZ | timotimo: yeah, binding to int won't work | 12:59 | |
13:00
JimmyZ is now known as Guest17214
|
|||
timotimo | ah, yes, binding to natives isn't supported yet | 13:00 | |
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:01 | |
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. | ||
FROGGS | timotimo: he said "please ignore ':'", which probably means that the original code had assignment instead of binding | ||
timotimo | yeah | ||
masak | the lexical model is *beautiful*, both in the speed optimizations it permits and in the closure semantics it results in. | 13:04 | |
13:04
vti left
|
|||
masak | apparently closures were discovered by Steele and Sussman as they were investigating the Actors model! | 13:06 | |
timotimo | ah, the scalar "allocations" are actually a bug | 13:08 | |
caused by my recent code | 13:09 | ||
since the code uses getlexstatic_o, it gets the Scalar object, but getlexstatic_o doesn't always allocate | |||
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 | |||
but in the case of this particular benchmark, it means "is the last thing that was allocated" | 13:10 | ||
and that loop allocates nothing at all in the heap, so it'll count the same scalar object as allocated over and over again | |||
Guest17214 | and Exclusive Time :P | ||
timotimo | that's probably having recorded an entry time, but not an exit time | ||
as the profiler dump code gets run as part of THE_END more or less | 13:11 | ||
13:11
Guest17214 is now known as JimmyZ_
|
|||
timotimo | i'm wondering why the code isn't eliminating the $_ lexical | 13:12 | |
13:12
Ven joined
|
|||
timotimo | i replaced exit with last in order to get a proper profile | 13:12 | |
Ven | o/, #perl6! | 13:13 | |
timotimo | however, getting the static lexical "last" in that case is done as const_s lits(last) + getlexstatic_o | ||
i'm not entirely sure what getlexstatic does exactly and if we have a direct rather than indirect version of that | 13:14 | ||
but that could certainly help performance | |||
oh, except | |||
that BB only ever gets executed once. so never mind | |||
masak | \o Ven | ||
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 | ||
Ven | .oO( like... A BLOG POST ) |
||
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 | |
i'm *pretty* sure a label should only appear once, rather than three times | |||
13:17
zakharyas joined
13:23
brrt joined
|
|||
masak | Ven: witty and interesting stuff like blog post still in our future time cone. :/ | 13:24 | |
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 :-) | ||
timotimo | m) | 13:26 | |
i forgot to remove the break; before the call to optimize_can_op | |||
masak | brrt: point. | 13:27 | |
timotimo | brrt: what do you say about the label situation i've mentioned up there? | 13:31 | |
brrt | i'll be reading | ||
backlogging, really | |||
timotimo | :) | ||
our code-gen for a loop { } is using the while op and feeding it a QAST::Var(lexical "True") | 13:32 | ||
13:32
ssqq joined
|
|||
timotimo | that's hilarious | 13:32 | |
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:33 | ||
m: my \True = 0; loop { say "lol" }; say "hahaha" | 13:38 | ||
13:38
zakharyas left
|
|||
camelia | rakudo-moar e1aa07: OUTPUT«hahaha» | 13:38 | |
13:38
ssqq left
|
|||
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«lollollollollolloltadaa» | ||
13:39
ptc_p6 left,
zakharyas joined
|
|||
masak | o.O | 13:39 | |
nice job, Houdini. | |||
13:39
FROGGS left
|
|||
masak | I'd call it a bug if the urge to call it insane wasn't so much stronger. | 13:40 | |
Ven | holy hell. | ||
masak | arguably, `loop` doesn't have anything to do with `True`. | ||
timotimo | yeah | ||
arnsholt | Nice one! | 13:41 | |
timotimo | i changed it to emit IVal.new( :value(1) ) instead of the lexical True | ||
a benchmark is about to come up. | |||
masak | are we *sure* we're not able to redefine 1 ? :P | ||
Ven | "you deserve what you get" | 13:42 | |
There was a trend in the JS ecosystem, before: wrap your code with `(function (undefined) { ... })()` | |||
so that, if somebody redefined `undefined` (because it was possible), you'd still have a sane value! | 13:43 | ||
I've yet to stop arguing about how stupid this is :) | |||
timotimo | time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_000_000_000 { last; } }' | ||
11.96user 0.02system 0:12.01elapsed 99%CPU (0avgtext+0avgdata 123408maxresident)k | |||
time perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_000_000_000 { last; } }' | |||
42.15user 0.02system 0:42.20elapsed 99%CPU (0avgtext+0avgdata 123348maxresident)k | 13:44 | ||
guess which one is which | |||
masak | timotimo: yipes. | ||
dalek | kudo/nom: cd9001e | (Timo Paulssen)++ | src/Perl6/Actions.nqp: loop { } doesn't need to inspect lexical "True" each iteration |
13:45 | |
arnsholt | That's a pretty nice speed-up! | ||
timotimo++ | |||
timotimo | i wouldn't call it "speed-up" for such a tight loop | ||
but it's a nice overhead-reduction | |||
Ven | timotimo-- timotimo++ | 13:46 | |
arnsholt | Troo | ||
timotimo | Ven: what did i deserve the -- for this time? | 13:47 | |
is it just your personal animousity against me? | |||
Ven | timotimo: you ++'d yourself :P | ||
but I still wanted to ++ because you did something nice | |||
timotimo | oh | ||
i ++'d myself by committing? | |||
Ven | oooh | ||
timotimo++ # I'm blind, I read arnsholt's ++ as yours. My baad | |||
timotimo | fair enough | 13:48 | |
you karma-nazi :) | |||
karmmar nazi? | |||
krammer nazi. | |||
masak | Ven has personal animosity? I hope there's treatment for that. | ||
Ven | timotimo was mean to me for a week... That's merely payback :P | ||
timotimo | oh, without a u | ||
masak .oO( there's no "you" in "animosity" ) | 13:49 | ||
timotimo | Ven: you were asking for it! :P | ||
masak: no u! | |||
Ven | you made me install your module! | ||
you monster. | |||
masak | timotimo: no, u! | ||
13:50
kaare_ left
13:54
erkan joined,
erkan left,
erkan joined,
guru joined,
ptc_p6 joined,
kaare_ joined,
guru is now known as ajr_
|
|||
timotimo is working on a fix to prevent the same object being counted as "allocated" infinitely many times in a row | 14:03 | ||
"up to infinitely times" i should say | 14:04 | ||
ah, yes, that seems to put things right. | |||
masak | m: say ^Inf | 14:05 | |
camelia | rakudo-moar e1aa07: OUTPUT«0..^Inf» | ||
masak | m: say (^Inf).elems | ||
camelia | rakudo-moar e1aa07: OUTPUT«Inf» | ||
timotimo | done. | ||
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 | |||
timotimo | masak: the thing is, you're also including the 0 | ||
so the count is actually Inf, not Inf - 1 | |||
you'd have to write 0^..^Inf for that | |||
masak | m: say 0 ^..^ Inf # neko operator | ||
camelia | rakudo-moar e1aa07: OUTPUT«0^..^Inf» | ||
timotimo | :D | ||
need more manekineko in perl6 | 14:07 | ||
Ven | m: sub infix:<(◕‿◕)>($a, $b) { $a + $b }; 3 (◕‿◕) 5 | 14:08 | |
14:08
Celelibi left
|
|||
camelia | ( no output ) | 14:08 | |
Ven | m: sub infix:<(◕‿◕)>($a, $b) { $a + $b }; say 3 (◕‿◕) 5 | 14:09 | |
camelia | rakudo-moar e1aa07: OUTPUT«8» | ||
Ven | why would you not love perl6? | ||
14:11
Celelibi joined
14:15
hoelzro left
14:16
hoelzro joined
|
|||
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 | |
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 | |||
s/possible/likely/ | 14:18 | ||
14:19
sqirrel__ left,
JimmyZ_ is now known as JimmyZ
14:20
sorear left,
sorear joined
|
|||
brrt | it might be more given that - if JITTed - this might become a much simpler loop than it was | 14:23 | |
with much better branch prediction | |||
timotimo | would removing gotos that point to the immediately following instruction be a win at all? | 14:25 | |
brrt | yes | 14:26 | |
albeit a small one | |||
timotimo | i bet branch prediction is very good at dealing with "goto" instructions | ||
colomon hopes that question was rhetorical. | |||
14:27
zakharyas left
|
|||
brrt | well, i would never bet on technology i don't fully understand | 14:27 | |
or that's not really true | |||
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 | ||
brrt | maybe 'fully' and 'never' need attenuating | ||
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" :) | ||
Rounin | I mean, a JIT without a universe would be pretty novel | ||
Or without electromagnetism | |||
14:28
pecastro left
|
|||
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 | ||
colomon | sure | ||
brrt | i build my next JIT on top of the weak nuclear force | ||
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 | |
14:31
Ven left
|
|||
timotimo | hmm, what about building an anti-JIT? | 14:31 | |
brrt | a BIT - backwards in time | ||
timotimo | :D | ||
with a BTTF deoptimization engine | |||
(and don't forget to compensate for register flux) | 14:32 | ||
14:32
zakharyas joined
|
|||
timotimo | did i ever mention the "solipsism + 1" philosophy i (claim that i) developed? | 14:33 | |
basically, it's the belief that the universe exists completely without an intelligence to experience it | 14:34 | ||
Rounin | So your claim implies that you are not intelligent | 14:35 | |
timotimo | hm. actually, no microbenchmark even has a loop { } in it | ||
Rounin | Do you suffer from that Coutard delusion or whatever it's called | ||
timotimo | hm, i think "an intelligence" isn't the word i meant | ||
"a consciousness" perhaps? | 14:36 | ||
Rounin | But then you're not conscious | ||
timotimo | is that the one where a person believes they are already dead? | ||
Rounin | Who is making the claim? | ||
Yeah haha :D | |||
timotimo | i remember that | ||
it's not a claim, it's a philosophy :P | |||
JimmyZ | hmm, the last version is slower than the exit version, though the exit version have wrong time | 14:37 | |
I mean Exclusive Time :P | 14:38 | ||
timotimo | hm, could be | ||
14:40
pecastro joined
|
|||
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:41 | |
brrt | frame handlers are cheap, yes | 14:42 | |
JimmyZ | except when they are not | 14:43 | |
brrt is not ready to get into discussions of 'consciousness' today | |||
timotimo | :D | ||
brrt | hang on, frame handlers are not free iirc | 14:45 | |
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 ;) | ||
Ulti | I have GTK and Cairo, but am having troubles with X server stuff and dbus | ||
timotimo | Ulti: give up right now. | 14:47 | |
brrt | in the JIT, entering a frame handler means storing your bytecode position | ||
timotimo | Ulti: you can only find more pain | ||
Ulti: but i've been working on an SDL2 port that works without GTK | |||
[Coke] | now getting malloc errors in rakudo-p | ||
timotimo | and without GTK you don't need X, because cairo is x-independent | ||
brrt | so that's relatively costly compared to not having it | 14:48 | |
timotimo | brrt: did you read the label thing i found? | ||
brrt | no, not yet | ||
overbusy :-) can you point me to it? | |||
[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. | ||
rurban: ^^ | 14:49 | ||
timotimo | brrt: let me try to reproduce it so you can look for yourself :) | ||
[Coke] | also timtoady, since that's a regex, and I know he just touched NQP. | ||
also happening in S05-metasyntax/litvar.t. | 14:50 | ||
Ulti | timotimo got rid of the X11 fail, now it just segfaults moar :D | ||
timotimo | gist.github.com/timo/911901053290122928bb | ||
Ulti: i'm not doing error checking very well | |||
brrt | odd... hmm | 14:51 | |
14:51
anaeem___ left
|
|||
brrt | i have my suspicions why this is so, but note that it doesn't 'really matter' much :-) | 14:51 | |
it is just inefficient | |||
timotimo | brrt: refresh and see more | ||
how can emitting a label multiple times be correct? | |||
oh, wait | 14:52 | ||
are these just gotos? | |||
brrt | they're all emitted at the same place | ||
no | |||
they're labels | |||
timotimo | oh, because PHI have zero length | ||
brrt | basically, they do nothing but note to dynasm 'here's a special place' | ||
and probably they come from ending/starting the frame handler labels | |||
and several other ways you can get multiple labels | 14:53 | ||
timotimo | OK | ||
that makes sense | |||
brrt | :-) | ||
14:54
raiph joined
|
|||
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 | |
neat | |||
and the only issue I had was not reading actionable output from brew when dbus was installed | 14:56 | ||
14:57
sorear left
|
|||
timotimo | oh? | 14:58 | |
well, ven had a lot more trouble | |||
14:58
sorear joined
|
|||
[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 :\ | ||
14:59
kaleem left
15:00
virtualsue left
|
|||
dalek | k-simple: c9a432f | Matt++ | lib/GTK/Simple.pm6: Deprecation of renamed method more -> emit Haven't tested this. Saw 1 call to deprecated code during execution. ================================================================================ Method more (from Supply) called at: lib/GTK/Simple.pm6, line 542 Deprecated since v2014.10, will be removed with release v2015.10! Please use emit instead. -------------------------------------------------------------------------------- Please contact the author to have these calls to deprecated code adapted, so that this message will disappear! |
15:01 | |
15:02
[Sno] left
|
|||
timotimo | ah, yes. thank you! | 15:03 | |
15:03
zakharyas left
|
|||
Ulti | np | 15:06 | |
15:07
bjz_ joined,
bjz left,
KCL_ left
|
|||
Ulti wistfully looks at WebKitGTK+ ^___^ | 15:07 | ||
farabi could be a desktop app then | 15:08 | ||
the amount of GTK and WebKit specific stuff you have to have working looks kind of crazy though | |||
timotimo | :\ | 15:09 | |
Ulti | would be a lot easier to just automatically open a browser tab | ||
timotimo | might be easier to use the Chrome Embedding Framework, CEF | ||
though i suspect that may be C++ | |||
15:13
KCL_ joined
|
|||
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:16 | |
timotimo | i agree | 15:18 | |
i recently tried to use "Brackets" or what it's called | 15:19 | ||
i didn't get it to work at all. | |||
JimmyZ uses Brackets too | 15:20 | ||
and it's nice Javascript project | 15:21 | ||
timotimo | JimmyZ: would you mind telling me how to get it to run? | 15:22 | |
JimmyZ | I download the .deb package | ||
timotimo | oh | ||
i have fedora %) | |||
15:23
telex left
|
|||
JimmyZ | .oO( then only don't have .rpm) |
15:23 | |
*doesn't | |||
15:24
telex joined
15:25
KCL joined
|
|||
rindolf | JimmyZ: JavaScript is spelled with a capital "S". | 15:26 | |
timotimo | .o( Java'S Crap, T! ) | 15:27 | |
.o( i pity de foolz who done Java ) | |||
hoelzro | timotimo++ # github commentary | ||
15:28
KCL_ left
|
|||
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 | |
15:29
Ven joined
|
|||
Ven | masak: I'm not sure I linked it before. github.com/jashkenas/coffeescript/pull/3171 | 15:29 | |
timotimo | i'm glad you agree to my comment | ||
JimmyZ: feel free to make perl6 fast enough so that we can bootstrap rakudo without nqp :) | |||
JimmyZ | :) | 15:30 | |
Ven | .tell masak I'm not sure I linked it before. github.com/jashkenas/coffeescript/pull/3171 | 15:31 | |
yoleaux | Ven: I'll pass your message to masak. | ||
masak | computer, messages. | ||
yoleaux | 15:31Z <Ven> masak: I'm not sure I linked it before. github.com/jashkenas/coffeescript/pull/3171 | ||
masak | Ven: interesting. | ||
Ven | Yeah. The discussion is a little bit interesting as well | 15:32 | |
masak | aye. | ||
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 | ||
Ven | masak: in this case, they went with the "no ast sugar" approach. uncool :P | 15:34 | |
brrt | timotimo: i agree | 15:35 | |
what do you have in mind | |||
masak | Ven: well, it's one approach. | ||
Ven: substitute from the outside. | |||
Ven | masak: hence the linking :) | ||
masak | Ven: it *does* solve the {{{ }}} issue :P | ||
Ven | masak: have you read more of 50 years of lisp? | ||
masak | Ven: no, but I've ordered it. | ||
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... :) | |||
masak | Ven: patience. already later this week, I'll be more available. | ||
Ven | Well; I read a bit of HoTT already – and cried a lot. | ||
masak | cried? | ||
Ven | yes :) | ||
timotimo | brrt: was "what do you have in mind" aimed at me? | ||
brrt | yes | 15:39 | |
:-) | |||
timotimo | ah | ||
just throwing out gotos at the end of BBs that have only a single successor anyway | |||
hm ... actually | |||
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:40 | ||
brrt | seems ok yes | 15:49 | |
JimmyZ | Good night | ||
15:49
JimmyZ left
|
|||
masak | night, 卓明亮 | 15:50 | |
15:50
erkan left
15:51
Ven left
15:52
erkan joined,
erkan left,
erkan joined
15:55
ajr_ left
15:57
guru joined,
guru is now known as Guest36895,
Guest36895 is now known as ajr_
16:16
kaleem joined
|
|||
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:16 | |
16:16
jluis left
|
|||
brrt | hmmm... it's a lot, yes, but not extraordinary i think | 16:17 | |
timotimo | for 284 frames | 16:18 | |
brrt | hmmm | ||
and how many opcodes? | 16:19 | ||
no, i don't think it is extraordinary | |||
if anything it's extraordinary on the rakudo level | |||
16:19
virtualsue joined
16:21
chenryn joined
|
|||
timotimo | m: 778 append_ins: <wval> | 16:23 | |
camelia | rakudo-moar cd9001: OUTPUT«===SORRY!=== Error while compiling /tmp/opk813zHjeTwo terms in a rowat /tmp/opk813zHje:1------> 778 ⏏append_ins: <wval> expecting any of: postfix infix stopper infix or met…» | ||
timotimo | 826 append_ins: <goto> | ||
2124 append_ins: <set> | |||
oops. | |||
those are the top 3 | |||
rurban | I fixed my append performance problems in potion by overallocating by 3. | 16:25 | |
16:25
erkan left
|
|||
TimToady | *3 or +3 ? | 16:25 | |
16:25
mr-foobar joined
|
|||
rurban | +3 was enough. I used for the 3 AST kids | 16:26 | |
16:26
acrussell joined
|
|||
rurban | But the number os append calls would be the same. | 16:26 | |
os=>of | |||
TimToady | I think p5 grows overextends arrays 20% or so, iirc | 16:27 | |
rurban | in your case you could benchmark if worthwhile | ||
was a huge win for me | |||
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:28 | |
16:29
brrt left
|
|||
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:30 | |
16:32
fhelmberger left
16:33
TuxCM left
|
|||
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 | ||
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…» | ||
timotimo | that wasn't what i wanted :) | ||
m: say 1, 99, 33 ... * | |||
camelia | rakudo-moar cd9001: OUTPUT«===SORRY!===Cannot assign to a readonly variable or a value» | ||
timotimo | oh, i remember now, that recently broke | ||
TimToady | b2gills: I dunno, deduced is the word used in the specs | 16:37 | |
so maybe 'deduced sequences' | |||
b2gills | I think I can work with that | ||
timotimo | i wanted to tickle that expression out of camelia | 16:38 | |
dalek | rl6-roast-data: 76824d6 | coke++ | / (4 files): today (automated commit) |
16:40 | |
16:40
TuxCM joined
|
|||
masak | b2gills: it's a geometric sequence in this case. arithmetic and geometric sequences are the two we deduce. | 16:41 | |
b2gills | I was going for more of a general name of the feature | 16:42 | |
16:43
denis_boyun left
|
|||
rurban | m: describe 1, 2, 4 ... 33 | 16:43 | |
camelia | rakudo-moar cd9001: OUTPUT«===SORRY!=== Error while compiling /tmp/qanQ3f0Rh0Undeclared routine: describe used at line 1» | ||
flussence | "DWIM"? | 16:45 | |
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:46 | |
so there's no way to eliminate the surprise, but we could push it back a little | 16:47 | ||
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…» | ||
TimToady | or knowably non-monotonic, except in abs | 16:49 | |
however, warning at compile time for a sequence known not to terminate would be...quite a trick, if it were a huge sequence | 16:50 | ||
unless we have an easy formula for "Is this number in this sequence?" that doesn't involve calculating the whole sequence | 16:51 | ||
and how much work do you put into that if you can't solve the general case, anyway? | |||
I guess arithmetic termination is just modular, and the geometric case would tend to diverge pretty quickly for powers significantly over 1 | 16:53 | ||
colomon remembers that we changed to the current sequence rules because the old more DWIMy rules were a complete mess to implement… | 16:54 | ||
TimToady | the old dwimmy rules were trying to work for user-supplied functions as well, which doesn't | 16:55 | |
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 | ||
so in the binary case, 33 is two set bits, not one | |||
one could do something in logs to approximate the endpoint and see what matches, I suppose | 16:59 | ||
17:00
ajr_ left
|
|||
TimToady | if there were a way of guaranteed rational logs for exactness, that would help | 17:01 | |
but I think that's probably asking too much of math :) | |||
17:02
guru joined,
guru is now known as Guest1875,
Guest1875 is now known as ajr_
17:03
kaleem left
|
|||
timotimo | today, i'd love to try fuzz testing out | 17:05 | |
since i've never done this before for any language or program ... tips please? :) | |||
also: | 17:06 | ||
m: say "a", "aa" ... * | |||
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…» | ||
timotimo | not what i mean ;( | ||
m: say ("a", "b" ... "profit").elems | |||
TimToady | m: say [\~] 'a' xx * | 17:07 | |
17:07
ajr_ left
|
|||
camelia | rakudo-moar cd9001: OUTPUT«(timeout)» | 17:07 | |
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…» | |||
TimToady | mine's shorter anyway :) | ||
timotimo | aye. not bad | ||
17:08
ajr joined
|
|||
TimToady | m: say [\~]('a' xx *) ... 'aaaaaaaaa' | 17:08 | |
camelia | rakudo-moar cd9001: OUTPUT«a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa» | ||
17:08
ajr left
|
|||
timotimo | ooooooooh | 17:09 | |
17:10
ajr joined,
ajr left
17:11
chenryn left,
ajr joined,
ajr left
17:15
ajr joined,
ajr is now known as Guest80237
17:16
Guest80237 is now known as ajr_
17:18
ajr_ left
|
|||
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
|
|||
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…» | ||
TimToady | m: say 'a' Xx 1..* | ||
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 is now known as ajr_
|
|||
timotimo | that's cute | 17:20 | |
m: say 'a1' ... 'a99' | |||
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…» | ||
timotimo | oh, hehe. | ||
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 …» | ||
masak | m: say 'a' X~ 00 .. 99 | ||
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 ------> say 'a' X~ 00⏏ .. 99a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a1…» | ||
masak | m: say 'a' X~ 0 .. 99 | ||
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…» | ||
TimToady | m: say 'a00' ... 'a77' | ||
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 …» | ||
masak | m: say 'a' X~ ^100 | ||
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…» | ||
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
17:27
KCL left,
andrewm joined,
andrewm left
17:28
kaleem joined
17:29
[Sno] joined,
kaleem left
17:35
pmurias joined
|
|||
masak | vendethiel: looking at it again, I think it's a bit of a stretch to call github.com/jashkenas/coffeescript/pull/3171 "hygienic". | 17:36 | |
[Coke] | reminder, only one perl grant request came in this month, please comment it if you have something to say: news.perlfoundation.org/2014/11/gra...dux-1.html (it's a p5 module that maybe we could steal some stuff from) | 17:38 | |
pmurias | arnsholt: pastie.org/9745189 | ||
arnsholt: as the paste shows the variables are declared at *compile* time | 17:39 | ||
arnsholt: it's that it's checked an initialisation time if they were set | |||
17:43
cognominal joined
|
|||
masak | pmurias: only for the very specific case of 'write before read', though. | 17:43 | |
pmurias | meant to say "it's that it's checked at runtime if they were set" | 17:47 | |
masak: what my paste was meant to illustrate is that 'if 1==0: x = 123' declares x | 17:49 | ||
17:49
dakkar left
|
|||
masak | indeed. | 17:50 | |
in other words, the scoping is per function, not per block. just like `var` in JavaScript. | |||
17:51
pecastro left
17:52
ajr_ left
|
|||
pmurias | masak: they reference manual does not consider an if statement a block | 17:53 | |
"The following are blocks: a module, a function body, and a class definition." | |||
masak | oh, that makes sense. | ||
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 | ||
masak: so my idea is that instead of using a hash table as a custom python scope, snake should keep a initalized flag | 17:56 | ||
with my assumption being that a keeping some native int flags would be much cheaper than doing hash access | 17:58 | ||
18:03
perturbation joined
18:05
alexghacker joined
18:08
khisanth__ joined
18:10
KCL_ left,
khisanth_ left
18:13
raiph left
18:14
raiph joined
18:16
kjs_ left
18:17
guru joined
18:18
guru is now known as Guest41035,
Guest41035 is now known as ajr_
|
|||
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«TrueTrue» | ||
18:18
gfldex joined
|
|||
alexghacker | From S03, === is "For objects that are not value types, their identities are their values." | 18:20 | |
18:20
xinming left
|
|||
jnthn | "is copy" dosn't mean "clone the thing" | 18:20 | |
alexghacker | jnthn, I know it doesn't do a deep clone | ||
jnthn | It means "I want it assigned into a new Scalar, which I can assign to in my sub" | ||
It doesn't do *any* clone. | |||
alexghacker | ah | ||
that's my problem | |||
(and why my deep clone attempts have all failed) | |||
jnthn | Yeah. Not sure there's a cute big of sugar for it | 18:21 | |
*bit | |||
alexghacker | the is copy is binding to the scalar holding the ref, not the ref itself | ||
18:21
xinming joined
|
|||
jnthn | Yes, that's the way to understand it. | 18:21 | |
alexghacker | jnthn++ | ||
now, to be clear, if the proto read: sub d( %a is copy ), then that would create a new hash container, correct? | 18:23 | ||
jnthn | iirc, it is compiled as if you had written %a = the_incoming_param | 18:24 | |
So yeah, i'd be a new hash container and then assign the incoming one's contents into it. | |||
uh, it'd :) | 18:25 | ||
timotimo | 478481 ← after | ||
jnthn | Being a hash container ain't legal here... :P | ||
timotimo | 478418 ← before | ||
so ... the opposite of a win? | |||
jnthn | timotimo: Is bigger better or worse? And what is the number for? :) | ||
timotimo | sum of bytes of jitted frames | ||
18:26
rindolf left
|
|||
timotimo | um | 18:26 | |
what the hell did i do | |||
18:26
FROGGS joined
|
|||
timotimo | i used the same jitlog for both invocations and got different numbers? | 18:27 | |
ah, good | |||
throwing away gotos at the end of BBs if the linear_next was the target of the goto anyway | |||
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» | ||
jnthn | Gee, nqp-j takes a while to build... | ||
moritz | if you're used to moar... :-) | ||
timotimo | m: say "(that means we saved { 478481 R- 473545 } bytes)" | ||
camelia | rakudo-moar cd9001: OUTPUT«(that means we saved -4936 bytes)» | ||
timotimo | oops | ||
m: say "(that means we saved { 478481 - 473545 } bytes)" | 18:29 | ||
camelia | rakudo-moar cd9001: OUTPUT«(that means we saved 4936 bytes)» | ||
timotimo | ~4.8 kbytes less for the instruction cache to nom sounds good | ||
moritz | r the setting? | ||
s/r/for/ | |||
m: say 4936 / 2**10 | |||
camelia | rakudo-moar cd9001: OUTPUT«4.820313» | ||
timotimo | moritz: that's just a simple tight loop | 18:30 | |
perl6 -e 'my int $n = 0; loop { $n = $n +1; if $n == 1_00_000_000 { last; } }' | 18:31 | ||
moritz: i'll check out what amount of jit output the setting generates | 18:32 | ||
oh, great! | 18:33 | ||
/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 | |||
moritz | m: say 4936 / 478481 | 18:36 | |
camelia | rakudo-moar cd9001: OUTPUT«0.0103160» | ||
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:37 | |
jnthn | Apparently, you reduced the amount of JIT output the setting makes... :P | 18:38 | |
timotimo | i don't get that far | 18:39 | |
moritz | by some 100% :-) | ||
jnthn | I'd have thought it's just "check if the goto target is the linear next" | ||
timotimo | yeah, me too | 18:40 | |
if (bb->last_ins->operands[0].ins_bb == bb->linear_next) { | |||
jnthn | Uh, you are checking is an unconditional goto instruction also, yes? | 18:41 | |
timotimo | (and only if it's a goto) | ||
yes | |||
otherwise that could be mayhem :) | |||
jnthn | Are these occuring in the code we're originally getting? | ||
timotimo | but it's very probably hard to accidentally hit the memory address of the bb's linear next | ||
jnthn | Or as a result of optimizations? | ||
timotimo | probably as a result of an optimization | ||
jnthn | ah | ||
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. | ||
timotimo | i should check that out. | ||
jnthn | Yeah. Though the code that does it is actually the longest function in the whole of the VM, I think... :) | ||
timotimo | ouch! | 18:43 | |
i'll look some other way in that case :P | |||
jnthn | :P | ||
It doesn't mean it's inherently hard. | |||
Just long. | |||
It finds the BB boundaries | 18:44 | ||
And creates instruction nodes. | |||
The later creates BBs, and finally puts them into a CFG | |||
jnthn needs le diner | 18:45 | ||
bbiab | |||
18:48
smls joined
|
|||
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).BagHash2 4 6» | ||
smls | ^^ bug? | 18:49 | |
18:50
rindolf joined
|
|||
colomon | seems like | 18:50 | |
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).BagHash2 4 6» | ||
FROGGS | o/ | 18:54 | |
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«FalseSetHash.new(2,4,6)» | ||
smls | or are elements not supposed to automatically disappear when their weight is set to 0/False ? | ||
19:03
Sqirrel joined
|
|||
colomon | they are suppose to disappear | 19:03 | |
and even if they don't, their value shouldn't be unchanged | 19:04 | ||
m: my $x = (2, 4, 6).SetHash; $x<1000> = True; say $x<4>; say $x.perl; | |||
camelia | rakudo-moar cd9001: OUTPUT«FalseSetHash.new(2,4,6,"1000")» | ||
colomon | ah | ||
that's your problem, maybe? | |||
m: my $x = (2, 4, 6).SetHash; $x{4} = False; say $x.perl; | |||
smls | oh, right | ||
camelia | rakudo-moar cd9001: OUTPUT«SetHash.new(2,6)» | ||
smls | colomon++ | 19:05 | |
colomon | yeah, not a bug, just an awkward thing | ||
smls | nah its fine, thats how object hashes that check identity with .WHICH are supposed to work... | ||
19:07
pmurias left
|
|||
timotimo | aye. | 19:14 | |
good catch, colomon | |||
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:16 | |
or Perl 6.x | 19:17 | ||
19:17
mullagain joined
|
|||
TimToady | std: my Int() %bh is BagHash = 2,4,6; | 19:18 | |
camelia | std 76ccee1: OUTPUT«ok 00:00 140m» | ||
smls | "is" ? | 19:19 | |
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 | ||
or you'd have to bind | |||
smls | cool | ||
doesn't seem to work yet, though | |||
TimToady | don't think it implemented thoguh | ||
smls | btw, why are types not coercive by default? | ||
They are in C++, aren't they? | |||
timotimo | that's a different thing | 19:21 | |
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++ | ||
timotimo | we can coerce from different types in p6 | ||
like Str to Int/Num/Bool/... | |||
smls | well thats only for things that are coded to expect/work with Cool | ||
not part of the type system itself | 19:23 | ||
moritz | though maybe with a copy constructor you can emulate it | ||
mullagain | is rakudo the standard compiler thus far? | ||
19:25
sqirrel__ joined
|
|||
moritz | mullagain: yes (though standard by emergence, not by definition) | 19:25 | |
smls | moritz: Well, methods like .Str/.Int sort of are the Perl 6 version of copy constructors, aren't they? | 19:26 | |
wait, no, the opposite | |||
mullagain | perl6 is using pthreads right? | 19:29 | |
19:29
sqirrel__ left
|
|||
TimToady | perl6 is using a hybrid model | 19:30 | |
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! | ||
smls | I like how Perl 6 lets you schedule a pice of code to be run on another thread | 19:33 | |
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:34 | ||
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. | ||
vendethiel | masak: oh, it's pretty bad | ||
19:36
PZt left
|
|||
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. | ||
mullagain | does <key> replace {key}? | 19:37 | |
vendethiel | mullagain: yes and no. key cannot be used to mean "key" anymore | ||
mullagain: so you can use {"key"} or <key>. | |||
19:37
kurahaupo1 joined
|
|||
TimToady | heh, "A New Jersey hiker, mulled to death by a bear in September..." | 19:37 | |
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} | ||
camelia | rakudo-moar cd9001: OUTPUT«(Any)bar(Any)» | ||
masak | m: sub key { "bar" }; my %h = key => "foo", bar => "bar"; say %h<key>; say %h{key} | ||
camelia | rakudo-moar cd9001: OUTPUT«foobar» | ||
masak | mullagain: ^ | ||
TimToady hopes not to be mulled to death... | 19:39 | ||
kurahaupo1 | TimToady: slowly boiled to death? | ||
TimToady | I'll have to mull that over... | ||
mullagain | haha | ||
TimToady | anyway, that popped up in Google News a bit ago | 19:40 | |
19:42
PacoLinux joined,
kurahaupo left,
anaeem1 joined
|
|||
mullagain | so rakudo is written in java? | 19:43 | |
masak | no, Rakudo is written in mostly Perl 6 and NQP. | 19:45 | |
some of the JVM backend stuff is written in Java. | |||
19:45
PacoLinux left
|
|||
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:45 | |
19:48
user3 joined,
jluis_ joined
|
|||
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 | ||
hoelzro | I think github.com/rakudo/rakudo/blob/nom/...d.nqp#L361 is missing a parameter to the current GLOBALish, and I'd like to see if inserting that fixes things | 19:49 | |
19:49
user3 left
19:50
dwarring joined
19:53
anaeem1 left
|
|||
dwarring | java interop question on SO - stackoverflow.com/questions/2715632...from-perl6 | 19:56 | |
19:59
darutoko left
|
|||
dalek | p: d0a0d50 | jonathan++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/ (2 files): Don't allocate longlit array every NFA run. |
20:00 | |
20:06
raiph left,
raiph joined
|
|||
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))» | ||
smls | :P | ||
20:19
kurahaupo1 left
20:22
kurahaupo joined
20:25
vti joined
20:26
khisanth__ is now known as Khisanth
20:30
Mouq joined
|
|||
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]]» | ||
smls | ^^ Is this the best way to deep-clone an array? | ||
20:33
kurahaupo left
|
|||
moritz | it's not deep enough, I fear | 20:35 | |
smls | ? | 20:36 | |
moritz | m: my $a = [{ a => [1]}]; my $b = $a.deepmap(*.clone).Array; $a[0]<a>[0] = 42; say $b.perl | ||
camelia | rakudo-moar cd9001: OUTPUT«[{"a" => [1]}]» | ||
moritz | seems I'm wrong | ||
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]}]» | ||
smls | so it doesn't descend into a Pair, because it doesnit count as a map'able collection? | 20:47 | |
makes sense I guess | |||
20:54
Mso150 joined
20:56
prime left
|
|||
moritz | the problem is really that it hits .clone eventually | 20:58 | |
and .clone isn't deep | |||
21:03
Mso150 left
|
|||
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]}]» | ||
smls | :) | ||
21:05
anaeem1_ joined,
Mso150 joined
21:06
kurahaupo joined
21:08
prime joined
21:11
rindolf left
21:12
raiph left
|
|||
timotimo | o/ | 21:17 | |
21:23
perturbation left
|
|||
dalek | ast: ffc87fa | usev6++ | S03-sequence/basic.t: Add second test for RT #78324 |
21:26 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=78324 | ||
21:33
brrt joined
21:34
raiph joined
21:35
vti left
21:37
prime left
|
|||
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:38 | |
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 | |
btyler: gist.github.com/tony-o/3f7ac835659b0152d1eb | |||
moritz | timotimo: I haven't done anything on rakudo.org, because I know I can't fix it if I break it | 21:40 | |
masak | TimToady: re github.com/perl6/specs/commit/f22e...b5308c5701 -- what's the rationale for character classes not participating in longest literal matching? | 21:41 | |
timotimo | i understand | ||
tony-o: yays! | |||
i like hearing that | |||
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? | ||
timotimo | yes, it is | ||
i think it could benefit from asynchronous features | 21:43 | ||
tony-o | i might try to port a templating system i wrote for p5 | ||
moritz | masak: because in the end, everything comes down to either literals or character classes | ||
tony-o | not sure yet, though | ||
timotimo | we don't need templating for farabi :) | ||
moritz | masak: and if you equate them, there's no disambiguation anymore | ||
21:44
telex left
|
|||
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 | |
tony-o: and how hard would it be to add keepalive to HTTP::Server::Async? | |||
21:44
telex joined
|
|||
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 | |
do you have a clue how hard HTTP2/SPDY is? | |||
21:47
alexghacker left
|
|||
tony-o | i don't, i was reading libmicrohttpd source earlier today though | 21:47 | |
21:48
prime joined
21:49
alexghacker joined
|
|||
tony-o | i need to read more about spdy | 21:49 | |
timotimo | spdy is being deprecated by http2 anyway | 21:50 | |
it'll mostly be interesting to find out how http2 became the way it is | |||
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 | |
21:57
jluis_ left
|
|||
moritz | masak: well, let me rephrase | 21:57 | |
masak: in a successful parse, every character of a string is consumed either by a literal or by a char class | 21:58 | ||
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. | ||
I guess what I'm asking about is what "force" made TimToady decide that `<[abc]>` differs in semantics from `[ a | b | c ]` | 22:00 | ||
("force" in the "forces acting on the problem" sense.) | |||
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]>`. | ||
FROGGS | masak: when you parse something, you usually have keywords, and these usually should be preferred over \w+ and friends | ||
masak | well, see what I just wrote. | 22:02 | |
moritz | masak: what about a..z ? | ||
there seems to be a spectrum here | |||
FROGGS | examples with one characters things does not help here | ||
masak | moritz: I'm aware that it's a slippery slope. especially since `\w` could also go inside `<[ ]>` | ||
FROGGS: disagree. `<[abc]>` is (in some sense) *literal*, but `\w` is not. | 22:03 | ||
moritz | literals, enumerations, ranges, properties, negated ranges, negated enumerations | ||
masak | moritz: right. | ||
moritz: which is why one possible answer I can imagine from TimToady is "I figured it was just easier to draw the line earlier". | |||
moritz | and it would feel equally weird to say that <[abc]> behaves differently from <[a..c]> | ||
masak: also char class vs. non-char-class is very clear line | 22:04 | ||
masak | right, that's what I mean. | ||
by "easier". | |||
moritz | masak: except that you wrote "earlier" :-) | ||
FROGGS | masak: show me a parser where you want to treat <[abc]> equally to keywords | ||
masak | FROGGS: /<[Ff]>alse/ | 22:05 | |
FROGGS | keywords are more important in the way they also define an order of the chars | ||
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 | |
FROGGS: it's very practical, whereas we have been discussing things more from a purity PoV | |||
FROGGS | masak: that slightly feels like a "misuse" of cclasses :o) | ||
22:07
kaare_ left
|
|||
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 | ||
masak | FROGGS: then will you be the one to explain to the newbie why they are different? :) | ||
FROGGS | masak: I think I prefer /False | false/ | 22:09 | |
masak | FROGGS: that is also an unsatisfactory cop-out. | ||
TimToady: will the zany `G<*n|enesis>` syntax participate in longest lit? :) | |||
FROGGS | everything is about tradeoffs... and I'd like to have the line between cclasses and literals where it is now | 22:10 | |
I hope TimToady can argue better than I can :o) | 22:11 | ||
masak | me too :) | ||
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 | ||
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 | |||
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» | ||
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 | ||
masak | alexghacker: for a mix of arrays, hashes, *and* arbitrary objects? | 22:13 | |
alexghacker | masak: not for arbitrary objects | ||
alexghacker wasn't looking for that to begin with | |||
masak | ok. | ||
alexghacker | although if the object were Iterable, then in theory deepmap would recurse into it | 22:16 | |
(exactly what that would mean for an "exotic" Iterable object that was a proxy for a database is left unsaid) | 22:17 | ||
22:17
anaeem1_ left,
ptc_p6 left
|
|||
alexghacker | cloning objects properly isn't something that can be solved generally anyway. the object has to cooperate. | 22:18 | |
raydiak | good afternoon #perl6 | 22:19 | |
22:20
denis_boyun joined
22:25
Mso150 left
22:27
denis_boyun left
|
|||
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 | |
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 left,
bartolin joined
22:33
brrt left
22:36
rurban left,
ajr_ left
|
|||
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:39 | |
22:40
gfldex left
|
|||
TimToady | raydiak: you're basically asking for the proposed Each type | 22:40 | |
22:41
FROGGS left
|
|||
jnthn | tony-o: Same as with any Supply, you subscribe to the quit event | 22:41 | |
(Given as a named argument to .tap) | |||
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:42 | |
22:43
dadada joined
|
|||
dadada | hi | 22:43 | |
raydiak | TimToady: thanks, I can stop thinking about it then | ||
dadada | so parrot is dead, yes? | ||
TimToady | parrot: say "Hi, I'm dead." | 22:44 | |
p: say "Hi, I'm dead." | |||
camelia | rakudo-parrot cd9001: OUTPUT«Hi, I'm dead.» | ||
dadada | ok, thought so | ||
Mouq | I think that's TimToady++'s cryptic way of saying "no"... | 22:45 | |
:P | |||
jnthn | .oO( Was the choice ofg "yes yes yes" as a nick when asking that question deliberate? :) ) |
||
*of | |||
Anyways, sleep time here...should have more Perl 6 time again soon, to continue the native array work. :) | 22:46 | ||
o/ | |||
TimToady | you think that's cyrillic? | ||
jnthn | TimToady: No, just translit'd :) | ||
I'm so tired I see things in all kinds of ways by this point :P | |||
TimToady | maybe it's just a dadadaist | ||
jnthn | :) | 22:47 | |
& | |||
dadada | if you really want to know my nick is inspired by this www.youtube.com/watch?v=vMZcXQCYwG0 | ||
22:49
alexghacker left
|
|||
tony-o | jnthn: github.com/tony-o/perl6-http-serve...nc.pm6#L48 | 22:50 | |
jnthn: i have that but never see it executed when i try to connect to the server and recv a 'connection refused' | 22:51 | ||
22:53
alexghacker joined
23:06
woolfy joined
23:09
lizmat joined
23:13
kjs_ joined
23:16
spider-mario left
|
|||
smls | TimToady: If Set() is a coercer, why does it take arbitrarily many arguments? | 23:17 | |
m: say Set(2, 3, 'a'=>4) | 23:18 | ||
camelia | rakudo-moar cd9001: OUTPUT«set(2, 3, a)» | ||
smls | I'm getting the feeling that subroutine forms of coercers don't really carry their weight. | 23:20 | |
23:21
woolfy left
|
|||
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:23 | |
What is the reason for having them, other than to have Int() as direct replacement of P5's int()? | 23:24 | ||
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:29 | |
23:31
denis_boyun_ joined
|
|||
raydiak | tony-o: if it helps narrow it down, examples/echoserver works fine here on your dev branch | 23:34 | |
23:45
kjs_ left
23:51
Ugator left
23:54
adu joined
|
|||
adu | hey | 23:54 | |
raydiak | hi adu | ||
adu | I have an algo question | ||
how do I write a function that takes f(x, [a, b, c]) | 23:55 | ||
and gives "<apply>" ~ a ~ "<apply>" ~ b ~ "<apply>" ~ c ~ x ~ "</apply></apply></apply>" | |||
23:55
virtualsue left
|
|||
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«1234» | ||
adu | um, what about a..z? | 23:58 | |
like maybe rv = x, then rv ~= "<apply>" ~ item ~ rv ~ "</apply>" | 23:59 |