»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
ab5tract_ now that CompUnitRepos are shaping up, maybe we could automatically store compiled versions of whatever you've been running with perl6 00:00
do some sort of CRC check against the file to see if it has changed and needs to be re-compiled
panda look is and awesome feature 00:01
00:01 vendethiel left
ab5tract_ *an 00:01
00:02 tinyblak joined
ab5tract_ AlexDaniel: don't despair. just create a META.json/META6.json and use the existing panda tooling. `panda look` is an easy way to get examples of those files 00:03
AlexDaniel ab5tract_: not today, I guess 00:04
ab5tract_: I thought there would be some really easy way to do that
ab5tract_: but if not, ok, I don't need it right now :)
ab5tract_ yeah, there is. META.json is like ~20 lines
;)
probably even less
AlexDaniel ab5tract_: not easy enough :) at least for today 00:06
ab5tract_ fair enough.
ugexe you can precompile a file by doing perl6 --target=mbc --output=lib/File.pm6.moarvm lib/File.pm6 00:08
or you can use CompUnit.precomp 00:09
AlexDaniel ugexe: hm, but this still means that the main file is not precompiled? Do I get it right? 00:14
ugexe there has to be a perl6 entry point
AlexDaniel For example, if I do perl6 --stagestats test.p6 where test.p6 is just say 'hello' it says that 0.169 is spent on Stage parse 00:15
ugexe so there will (as of right now anyway) be a non-compiled point that gets run
00:15 pecastro left
AlexDaniel so I'm thinking, if spends so much time on that, is there any way to skip that? 00:15
if it* 00:16
Ulti pyrimidine: are you in Dublin atm?
ugexe you can precompile your script, but then you have to 'use lib "your-script"' in another script to actually invoke it 00:17
liely defeating the purpose
AlexDaniel any reason why this entry point cannot be precompiled as well? 00:18
00:22 mohij_ joined, mohij left 00:25 pecastro joined, vendethiel joined
AlexDaniel Here doc.perl6.org/type/Proc it says that I can pass IO::Pipe or IO::Handle as :in(). But how can I pass a Str? Or is there any way quick way to create IO::Handle from Str? 00:39
looks like a common problem – pass string as stdin 00:40
00:46 vendethiel left
ugexe IO::Handle has both print and say methods. also write 00:47
but im not sure you can pass your own pipe into Proc yet 00:48
00:50 cognominal left 00:51 cognominal joined, pyrimidi_ joined, cognominal left
pyrimidi_ Ulti: couldn't make it this year, BOSC was awesome from a distance tho 00:52
01:06 pyrimidi_ left 01:16 rmgk_ joined, rmgk is now known as Guest60214, Guest60214 left, rmgk_ is now known as rmgk 01:17 Hor|zon joined 01:19 colomon left, aborazmeh joined, aborazmeh left, aborazmeh joined 01:20 colomon joined 01:22 Hor|zon left 01:24 colomon left 01:25 virtualsue left 01:27 tad_ joined 01:30 colomon joined 01:36 tad_ left 01:45 ilbot3 left 01:47 ilbot3 joined 01:51 pyrimidi_ joined 01:53 tinyblak left 01:55 cognominal joined 01:57 adu joined 01:59 pyrimidi_ left 02:00 skids joined
Quom m: my $s = "OH 819"; for $s { s:g/(\d){}/{chr(64 + $0)}/; .say } 02:00
camelia rakudo-moar 81d173: OUTPUT«OH III␤»
Quom Very strange
02:06 tinyblak joined 02:10 vendethiel joined 02:11 atroxaper joined
AlexDaniel Quom: so it is using the last number? 02:13
02:14 noganex joined 02:16 atroxaper left
Quom AlexDaniel: Yeah, IDK what's going on there. Some kind of optimization gone wrong 02:16
m: my $s = "OH 819"; for $s { my $/; s:g[(\d){}]=chr(64 + $_); .say }
camelia rakudo-moar 81d173: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏OH 819' (indicated by ⏏)␤ in block at /tmp/ic2riGE_eq:1␤␤»
Quom m: my $s = "OH 819"; for $s { my $/; s:g[(\d){}]=chr(64 + $0); .say }
camelia rakudo-moar 81d173: OUTPUT«OH HAI␤»
02:17 tinyblak_ joined, noganex_ left
Quom m: my $s = "OH 819"; for $s { my $/; s:g[(\d)]=chr(64 + $0); .say } 02:17
camelia rakudo-moar 81d173: OUTPUT«OH HAI␤»
Quom Well, there's a workaround
AlexDaniel m: my $s = "OH 819"; $s ~~ s:g/(\d)/{chr(64 + $0)}/; $s.say; 02:18
camelia rakudo-moar 81d173: OUTPUT«OH HAI␤»
AlexDaniel Quom: what about this?
02:19 colomon left 02:20 tinyblak left 02:22 colomon joined
AlexDaniel m: my $s = "OH 819"; for $s { s:g/(\d)/$0/; .say; } 02:24
camelia rakudo-moar 81d173: OUTPUT«Use of Nil in string context in code at /tmp/7uxTWAuEqS:1␤Use of Nil in string context in code at /tmp/7uxTWAuEqS:1␤Use of Nil in string context in code at /tmp/7uxTWAuEqS:1␤OH ␤»
AlexDaniel why is it Nil?
02:25 adu left 02:27 kurahaupo joined, kurahaupo left 02:32 gfldex left, nys left 02:33 kurahaupo joined 02:35 zostay joined
ugexe because you are calling say on something that doesnt match fir the first3 iterations 02:36
02:39 adu joined
AlexDaniel ugexe: what kind of iterations? 02:42
ugexe oh i see i missed the semicolon 02:43
AlexDaniel hmmm which semicolon 02:44
ugexe at the end of the regex. like .say was getting called every time the cursor advanced and the match fails 02:49
AlexDaniel anyway, why $0 is Nil if it clearly matched something? 02:51
ugexe it looks like its due to replacing something with itself
im not sure how the guts of all that work, but seems like its removing the reference to the \d, then trying to replace it with the now non-existant variable? 02:52
AlexDaniel m: $_ = "OH 819"; s:g/(\d)/$0/ for $_; .say;
camelia rakudo-moar 81d173: OUTPUT«Use of Nil in string context in code at /tmp/fUrNgIJEki:1␤Use of Nil in string context in code at /tmp/fUrNgIJEki:1␤Use of Nil in string context in code at /tmp/fUrNgIJEki:1␤OH ␤»
AlexDaniel m: $_ = "OH 819"; s:g/(\d)/$0/; .say; 02:53
camelia rakudo-moar 81d173: OUTPUT«OH 819␤»
AlexDaniel so it does not work in "for", otherwise it is ok
someone has to report that 02:55
but don't think that I can find the right words for this...
02:57 [Sno] left, [Sno] joined 02:59 aborazmeh left 03:00 aborazmeh joined, aborazmeh left, aborazmeh joined, kurahaupo left, ponbiki joined 03:03 dj_goku left 03:06 Hor|zon joined, bjz left 03:08 AlexDaniel left 03:10 Hor|zon left 03:19 amurf joined 03:23 vendethiel left 03:24 amurf left 03:28 BenGoldberg left
dalek kudo-star-daily: 439729b | coke++ | log/ (8 files):
today (automated commit)
03:34
rl6-roast-data: 83daaee | coke++ | / (9 files):
today (automated commit)
03:38 aborazmeh left 03:51 vendethiel joined
ugexe m: $_ = "OH 817f9"; s:g/(\d){}/$0/ for $_; .say; 03:52
camelia rakudo-moar 81d173: OUTPUT«OH 999f9␤»
ugexe must initialize the newly replaced match so no warning 03:54
then the regex is just doing a global replace on \d, and the last digit is 9 so that is the last around of replacements 03:55
ShimmerFairy still finds using s/// and friends in any way other than stuff ~~ s/// or stuff.subst() kinda weird :) 04:05
04:20 khw left 04:44 vendethiel left
kanl m: my ( $a, $b ) = < z ab >; say $a leg $b; say $a.succ leg $b 04:45
camelia rakudo-moar 81d173: OUTPUT«More␤Less␤»
kanl i suppose this is the case in any language. 04:46
is there already a "flavor" of strcmp that takes the length of string into consideration? 04:48
if there's none, cmp and leg are certainly overloadable, i suppose.
04:53 vendethiel joined 04:55 Hor|zon joined 04:57 atroxaper joined 04:59 Hor|zon left 05:02 atroxaper left 05:14 firefish5000 left
japhb .tell FROGGS Something weird is going on with -I and the REPL. If I `perl6 -Ilib -MSomeModule -e'use-the-module()'` it works. But if I `perl6 -Ilib -MSomeModule` and enter `use-the-module()` in the REPL, it fails. Examining @*INC in both cases shows 'file#lib' in the first case, but not the second! 05:15
yoleaux japhb: I'll pass your message to FROGGS.
05:17 vendethiel left
ugexe looks like the -M isnt needed to reproduce. doing 'use lib "lib"' works as well 05:21
05:33 TEttinger left 05:39 firefish5000 joined 05:49 kaare_ joined 06:03 vendethiel joined 06:05 kurahaupo joined 06:24 vendethiel left 06:28 vendethiel joined 06:44 ribasushi joined, Hor|zon joined 06:46 firefish5000 left 06:49 Hor|zon left, kurahaupo left 06:57 amurf joined 07:01 amurf left 07:03 geekosaur left 07:04 geekosaur joined 07:05 FROGGS joined 07:14 darutoko joined 07:15 vendethiel left
[TuxCM] o/ 07:15
yoleaux 11 Jul 2015 19:56Z <lizmat> [TuxCM]: the semicolon in $^r<legs> < 8; is not needed
[TuxCM] (already removed)
07:22 tinyblak_ left, vendethiel joined 07:25 geekosaur left, geekosaur joined 07:26 tinyblak joined 07:29 telex left 07:30 telex joined, liztormato joined
liztormato waves from a very busy AMS 07:32
07:32 skids left 07:33 tinyblak left, gfldex joined 07:36 liztormato left 07:39 tinyblak joined 07:41 tinyblak left 07:44 tinyblak joined, diana_olhovik joined 07:45 Hor|zon joined 07:46 vendethiel left 07:49 Hor|zon left 07:51 geekosaur left 07:52 geekosaur joined 07:56 vendethiel joined
[TuxCM] if I get a Callable or Routine as argument, is there an inspection method to see what is inside the Callable/Routine? 07:57
$callable.introspection.perl ~~ /flubberway/ and warn "Don't use the flubber magic inside your hooks!"; 07:58
.perl returns "#`(Sub|94399136) ... }" or "#`(Block|124079568) ... }"
08:16 atroxaper joined 08:18 vendethiel left, cfa left 08:21 atroxaper left 08:39 vendethiel joined 08:56 tinyblak left 08:59 bin_005_j_j_v joined 09:01 bin_005_j_j left 09:02 vendethiel left 09:10 rindolf joined
[TuxCM] test 50000 45.301 45.213 09:12
test-t 50000 44.422 44.334
09:13 spider-mario joined 09:20 vendethiel joined
masak good antenoon, #perl6 09:21
09:22 adu left, laraiito joined
laraiito hello how can i install rakudo? 09:23
moritz laraiito: hi; please see rakudo.org/how-to-get-rakudo/ 09:24
09:24 TEttinger joined 09:25 RabidGravy joined
RabidGravy marning! 09:27
09:28 tinyblak joined
[TuxCM] .tell lizmat github.com/Tux/CSV/commit/6f392834...a0b5372e6c 09:29
yoleaux [TuxCM]: I'll pass your message to lizmat.
[TuxCM] All tests successful. 09:31
Files=25, Tests=19672, 60 wallclock secs ( 2.60 usr 0.14 sys + 152.48 cusr 1.35 csys = 156.57 CPU)
09:34 Hor|zon joined 09:38 tinyblak left 09:39 Hor|zon left 09:48 espadrine_ joined 09:49 vendethiel left 10:05 ppant joined 10:08 tinyblak joined 10:14 ppant_ joined, leont joined, ppant_ left 10:17 azawawi joined
azawawi hi 10:17
10:17 ppant left 10:18 ppant joined
azawawi any idea why rakudo stopped generating panda.bat after a rebootstrap? 10:18
10:24 baest_ joined 10:26 baest left 10:27 azawawi left 10:28 diana_olhovik left 10:34 nys joined, TEttinger left 10:41 tinyblak left 10:42 virtualsue joined 10:45 xinming_ joined, beastd joined 10:48 xinming left 10:59 vendethiel joined 11:11 AlexDaniel joined 11:15 ppant left 11:16 cschwenz joined
cschwenz o/ #perl6 11:16
11:16 Psyche^_ joined 11:17 leont left 11:18 FROGGS left 11:19 Hor|zon joined 11:20 Psyche^ left, vendethiel left 11:24 Hor|zon left 11:26 cschwenz left 11:28 BenGoldberg joined, AlexDaniel left 11:29 AlexDaniel joined 11:31 meisl joined, tinyblak joined, meisl left 11:37 aborazmeh joined, aborazmeh left, aborazmeh joined 11:38 pecastro left 11:40 pecastro joined 11:43 rurban joined 11:45 laraiito left 11:47 vendethiel joined 11:52 atroxaper joined 11:57 atroxaper left 12:23 aborazmeh left 12:24 aborazmeh joined, aborazmeh left, aborazmeh joined 12:25 bin_005_j_j_v left 12:32 BenGoldberg left 12:33 BenGoldberg joined 12:34 vendethiel left 12:35 Hor|zon joined
RabidGravy is there any notion of "write only" attributes or methods? I'm looking at a weird API that only provides functions to set some parameters (the id3tag stuff in libmp3lame if you are interested.) 12:37
timotimo you can return a Proxy from the method that returns a Failure when read from, for example 12:39
or maybe better: Empty
it often surprises people how often the FETCH part of the proxy gets called when doing seemingly harmless things
i'm not sure if FETCH will also be called when you only want to assign to, not actually read from the "attribute"
RabidGravy it did indeed suprise me :) 12:40
12:40 Hor|zon left 12:42 raiph joined 12:43 aborazmeh left 12:53 tinyblak left
RabidGravy does an experiment 13:00
yeah, or fake it up with a state variable: 13:01
m: class A { method f() returns Str is rw { state Str $a; Proxy.new(FETCH => sub ($) { $a; }, STORE => sub ($, $val) { $a = $val } ) } }; my $c = A.new; $c.f = "boo"; say $c.f
camelia rakudo-moar 81d173: OUTPUT«boo␤»
timotimo hmm. why do we build a new Proxy object every time anyway? 13:02
RabidGravy I don't know, but it seems to work 13:03
timotimo but that's not write-only any more :) 13:05
13:07 lichtkind joined
RabidGravy faking it also works for me ;-) 13:09
moritz m: class A { has $.f is rw; submethod BUILD() { my $a; $!f := Proxy.new(FETCH => sub (|) { $a }; STORE => sub ($, $val) { $a = $val }) } }; my $x = A.new; say $x.f; $x.f = 42; say $x.f 13:10
camelia rakudo-moar 81d173: OUTPUT«Too many positionals passed; expected 1 argument but got 3␤ in submethod BUILD at /tmp/TZoXFqXRAZ:1␤ in block <unit> at /tmp/TZoXFqXRAZ:1␤␤»
moritz m: class A { has $.f is rw; submethod BUILD(|) { my $a; $!f := Proxy.new(FETCH => sub (|) { $a }; STORE => sub ($, $val) { $a = $val }) } }; my $x = A.new; say $x.f; $x.f = 42; say $x.f
camelia rakudo-moar 81d173: OUTPUT«Too many positionals passed; expected 1 argument but got 3␤ in submethod BUILD at /tmp/ycYqOn9kbB:1␤ in block <unit> at /tmp/ycYqOn9kbB:1␤␤»
moritz m: class A { has $.f is rw; submethod BUILD(|) { my $a; $!f := Proxy.new(FETCH => sub (|) { $a }, STORE => sub ($, $val) { $a = $val }) } }; my $x = A.new; say $x.f; $x.f = 42; say $x.f 13:11
camelia rakudo-moar 81d173: OUTPUT«(Any)␤42␤»
13:17 aborazmeh joined, aborazmeh left, aborazmeh joined 13:19 tinyblak joined 13:35 colomon left
BenGoldberg Maybe there should be some sort of syntactic sugar for creating a Proxy which will be reused? 13:48
13:54 nnms joined 14:05 xinming_ left
RabidGravy moritz, yeah I like that one but I think my actual code would have to be more like: 14:07
m: use NativeCall; class A is repr("CPointer") { my $f; my Str $a; method f() returns Str is rw { $f }; submethod BUILD() { $f = Proxy.new(FETCH => sub ($) { $a; }, STORE => sub ($, $val) { $a = $val } ) } }; my $c = A.new; $c.f = "boo"; say $c.f
camelia rakudo-moar 81d173: OUTPUT«boo␤»
RabidGravy because CPointer
and then I'd start wanting to insert the lexicals dynamically because there are a bunch of these and I'd want to do it with a trait and It would all start going downhill rather rapidly ;-) 14:10
ah, no wait 14:14
14:24 molaf joined, Hor|zon joined 14:25 nightfrog left 14:26 nightfrog joined 14:29 Hor|zon left 14:35 rindolf left 14:40 verzz joined, verzz left 14:43 verzz joined 14:49 colomon joined 14:51 rindolf joined 15:05 kaare_ left
ugexe you are suppose to bind to the Proxy 15:06
15:10 danaj joined, vendethiel joined, khw joined
RabidGravy ugexe, yep but in the kind of CPointer classes I'm dealing with there b'ain't nowhere to bind the Proxy 15:20
15:25 verzz left 15:29 atroxaper joined 15:33 BenGoldberg left, atroxaper left 15:40 BenGoldberg joined 15:46 aborazmeh left 15:50 tinyblak left 15:57 AlexDaniel left
ugexe ah. i did not know you could not have attribute storage with the CPointer classes 16:00
16:01 vendethiel left, spider-mario left
RabidGravy yeah, it's kind of weird because it'll let you define the class like that only to crap out when you instantiate it 16:02
16:10 Hor|zon joined 16:11 vendethiel joined 16:14 tinyblak joined 16:15 Hor|zon left 16:21 verzz joined 16:26 lucasb joined 16:27 colomon left
lucasb This ticket about executing a directory as a script name made me remember that rakudo doesn't know how to read named pipes 16:35
perl6 <(echo say 42) 16:36
perl6 -e 'say @*ARGS.shift.IO.slurp' <(echo hi)
16:36 rindolf left 16:41 kaare_ joined 16:47 kaare_ left
RabidGravy lucasb, you *can* but it's a PITA: perl6 -e 'say @*ARGS.shift.IO.open(:bin).read(10).decode' <(echo hi) 16:51
16:51 kaare_ joined
RabidGravy same with any "special" file that it can't tell the size of up-front 16:51
lucasb RabidGravy: cool. I didn't know about that. Thanks 16:54
RabidGravy It's somewhat less than fabulous, but if it was a common enough pattern you could stick it in a module or augment IO::Path or something 16:58
17:05 rurban left 17:15 skids joined 17:22 adu joined 17:23 araujo_ joined, araujo left 17:26 [Sno] left 17:27 [Sno] joined 17:28 lichtkind left 17:30 rindolf joined 17:31 dylanwh left 17:37 dylanwh joined 17:43 lichtkind joined 17:47 FROGGS joined 17:48 molaf_ joined 17:49 telex left 17:50 telex joined, amurf joined 17:51 molaf left 17:53 tinyblak left 17:54 amurf left 17:59 Hor|zon joined 18:04 Hor|zon left 18:13 verzz left 18:21 spider-mario joined 18:25 raiph left, raiph joined 18:46 domidumont joined
dalek Iish: d8caa54 | lembark++ | .gitignore:
ignore editor cruft
18:50
Iish: 8b3eb92 | lembark++ | t/ (3 files):
use PG environment variables to configure connection; update POD to avoid user having to pre-create hardwired database and user
18:52 domidumont left 18:53 tinyblak joined 18:56 zakharyas joined 18:59 tinyblak left, ggoebel2 left 19:00 ggoebel joined 19:05 atroxaper joined 19:08 rurban joined 19:10 atroxaper left
dalek kudo/nom: 7b65907 | (Nick Logan)++ | src/core/CompUnitRepo/Local/Installation.pm:
bin/basename postfix loop flattening

Fixes generating bin/ files
19:23
kudo/nom: 2e612ac | FROGGS++ | src/core/CompUnitRepo/Local/Installation.pm:
Merge pull request #467 from ugexe/patch-10

bin/basename postfix loop flattening
19:34 meisl joined
meisl hello #perl6 19:34
RabidGravy coo, another Sunday another patch for a twenty year old perl 5 module 19:36
19:36 TEttinger joined
RabidGravy but hey! I got a patch from a debian packager :-) 19:37
19:38 atweiden joined 19:45 brrt joined 19:48 Hor|zon joined 19:49 zakharyas left
atweiden i'm having an issue with piping grep results to .map that i don't know how to debug 19:52
i have a hash that looks like this: gist.github.com/atweiden/fa517c175...ets-p6-L74 19:53
when part of this hash is grep'd for PostingUUIDBalanceDelta < 0, there are two results:
[DEBUG] %balance_delta_by_posting_uuid.grepped (UUID.new(bytes => Buf[uint8].new(111, 181, 100, 39, 223, 191, 71, 97, 129, 161, 204, 111, 4, 189, 161, 89), version => 4) => -24.0, UUID.new(bytes => Buf[uint8].new(37, 20, 99, 73, 34, 100, 69, 86, 145, 199, 55, 38, 149, 12, 199, 71), version => 4) => -24.0)
but when I pipe %balance_delta_by_posting_uuid.grep to .map, here: gist.github.com/atweiden/fa517c175...ts-p6-L116
there is no output, and no buckets are instantiated
19:53 Hor|zon left 19:55 adu left 19:57 ilbelkyr is now known as bcode
meisl brrt: thx for hinting at Aho paper on Tree matching, it's a great inspiration for me (site.iugaza.edu.ps/hzaq/files/2010/...ming,.pdf) 19:59
brrt you're welcome meisl :-)
what are you trying to do with it? 20:00
20:00 ilbelkyr joined
meisl :) well, I was thinking of implementing it, in p6 or nqp, and continued thinking of how to implement it in a purely functional way 20:01
brrt: guess you're gonna implement it in C, for the JIT stuff? 20:02
brrt yes. actually, the aho paper mentions a preprocessor
meisl hmm, but the preprocessor stuff isn't really crucial, IMHO. Just to get the "prologue" stuff from the patterns in 20:03
brrt since i'm already knee-deep in preprocessor-land 20:04
i might do that as well :-)
i'm not 100% sure on how to do it, though
meisl do what as well?
hoelzro could someone explain to me how to unpack a nested list in a for loop parameter? my attempt is gist.github.com/hoelzro/ab8b7df7f225b71b1f17, but it's not working, and I'm wondering if it's because of GLR stuff 20:05
meisl (write a preprocessor?...)
atweiden issue resolves itself with for %h.kv -> ... gist.github.com/atweiden/fa517c175...kv-p6-L118
brrt well, the way i understand it, they build pattern matching tables at compile time? i think i might do that. preprocessing has worked out nicely enough in the moarvm - to - expression-tree - translation
but to be totally blunt, i'm not that far yet 20:07
20:08 bin_005 joined, darutoko left
meisl well, I'd say they build a tree matching automaton from their "twig" specs (which'd be a "slang" or else some p6 OO API). This then is *run* on an actual tree (QAST for me, MAST for you) 20:08
so yes, the step from twig spec to automaton is a compilation 20:09
brrt i'm actually working below the MAST level
meisl oh, what is it then? 20:10
brrt well, long story short
i use an IR with a (virtual) register model
meisl so you first translate MAST to that IR and only on that you'd do the tree-matching in order generate machine code? 20:11
brrt i call it the 'expression tree', which is misnomer because it's a DAG that contains statements ^^
actually, it's deeper than that still
meisl sure 20:12
brrt i use the spesh graph, which is the internal representation used for 'spesh' optimizations
meisl i c
brrt spesh stands for, among other thing, type specialisation
but it does also other things like inlining
from that spesh graph we compile the expression tree, per basic block, from per-instruction templates 20:13
meisl "templates" as in the Aho paper?
(since these aren't necessarily "per-instruction") 20:14
brrt no, this is just for the translation from moarvm bytecode to the IR presentation, so those are per instruction
these templates represent little tree structures which are pasted in to make a big structure 20:15
this tree structure is then iterated over
during that iteration, i suppose the tree-matching automaton is supposed to run
lucasb hoelzro: for @a -> ($first, *@rest) { ... } # but 'for @a -> [...] {}' also work 20:16
brrt but before that, and using in principle the same iteration mechanisms, i aim to do live range calculations, possibly (local) register allocation, common subexpression elimination
hoelzro huh, I could've sworn that using () would take more than one value from the top level list
lucasb: thanks! 20:17
brrt for most of these things, i know how to do them; for the automaton, i do not (totally)
20:17 bcode left
meisl yes, it's a really smart combination of things smart in themselves already 20:18
brrt that is true in general of compiler stuff :-) 20:19
also precisely what makes it a bit tricky
meisl why not use the same concept all the way thru, ie use (a variant of) such an automaton for the mbv -> IR step as well? 20:20
(mbc, moar bytecode, -> IR)
brrt basically, because moar bytecode lives on a higher level 20:21
meisl it's still a tree, isn't it? 20:22
brrt the way i see it, the aho tree-matching algorithm is moving from a lower level (each and every load, address calculation, store, etc explicit) to a higher level
thus, a tile represents multiple steps in the IR 20:23
on the other hand, the moarvm -> expression tree translation represents a lowering; a moarvm-level operation is translated into machine-level operations 20:24
for the first thing, you want to find the best way to split a tree into fewer (larger) pieces; for the last thing, you want to expand a single piece into multiple smaller pieces 20:25
meisl well, it has several aspects I think. for 1 it let's you rewrite trees while abstracting away the actual recursion and also a good portion of the matching
brrt the goal is to find the commonality between the various operations that moarvm bytecode cannot represent
(the commonality, that is) 20:26
meisl another aspect is the dynamic programming, that is the "auto-optimization" that is kinda built-in (sorry, can't put it in a better right now)
it is not, however, tied to one particular level, IMHO 20:27
brrt hmm 20:28
ok, let me put it this way 20:29
when you translate a tree, you can either move up, down or stay at the same level of representation
meisl hmm, let's say "level of abstraction", ok? 20:30
brrt moving up means the nodes of the output represent larger parts of the input, moving down means the input is represented in multiple parts of the output
right
s/the input is represented in/each node in the input is represented as/ 20:31
potentially, yes, i could represent two related input nodes (moarvm instructions) as a single IR-level template 20:32
meisl but it's not as simple as just "more nodes in tree", right?
brrt well, it's much simpler if you either expand or shrink, not do both at the same time :-)
meisl (going down, that is)
brrt and moreover, any and all relations between the two moarvm instructions will still be present in the lower-level representation 20:33
if they've become obscured, that probably means their relation wasn't that strong to begin with 20:34
meisl sure, it must have the same semantics (= effect)
(or maybe I didn't understand "relation" properly...?)
brrt so it's not entirely obvious to me what the benefit would be of matching multiple moarvm instructions as a unit to a set of expression tree operations 20:35
no, i think we both have the same idea :-)
meisl ok, maybe we should have a (really) small example of mbc -> IR? 20:36
brrt oh, sure, take a look at 20:37
github.com/MoarVM/MoarVM/blob/even...t/exprlist 20:38
these are the templates in s-expr format
meisl (studying)
brrt e.g. add_i translates to (add $1 $2) - the translator takes the $1 and $2 moarvm instruction operands, and converts them to the register-model 20:39
i.e. inserts loads (if needed)
20:40 kaare_ left 20:41 raiph left 20:42 atweiden left
brrt decommute & 20:42
20:42 brrt left
FROGGS .tell jnthn I think MVMExceptionBody needs an MVMObject *label, so the payload can be used for: LABEL.leave(42) 20:46
yoleaux 05:15Z <japhb> FROGGS: Something weird is going on with -I and the REPL. If I `perl6 -Ilib -MSomeModule -e'use-the-module()'` it works. But if I `perl6 -Ilib -MSomeModule` and enter `use-the-module()` in the REPL, it fails. Examining @*INC in both cases shows 'file#lib' in the first case, but not the second!
FROGGS: I'll pass your message to jnthn.
meisl brrt: ? 20:47
FROGGS: sorry to bother you - how about an Windows .msi for Rakudo* 2015.06? 20:51
FROGGS meisl: yes, seen your gh issue... will do that tomorrow evening
meisl woow, great! :D++ 20:52
20:54 adu joined, adu left 20:56 lucasb left
FROGGS :o) 20:57
20:59 colomon joined
meisl still haven't managed to get smart/knowlegdeable enough to build it on my own... 20:59
japhb FROGGS: Any idea why the REPL is special WRT -I? 21:03
FROGGS japhb: not yet, and need to shutdown my laptop now :o( 21:04
japhb Ah, fair enough.
21:04 espadrine_ left
FROGGS see you tomorrow 21:04
21:04 FROGGS left
geekosaur scope? 21:04
japhb geekosaur: Meaning the REPL's outer scope isn't being set properly? 21:05
geekosaur Haven't we had a number of problems of that sort, where the scope of the REPL isn't what something else expects? 21:06
not that I am familiar with any of that code
21:08 lizmat joined
lizmat waves from PDX 21:09
yoleaux 09:29Z <[TuxCM]> lizmat: github.com/Tux/CSV/commit/6f392834...a0b5372e6c
vendethiel wave at lizmat
21:09 colomon left
lizmat vendethiel o/ 21:10
21:10 colomon joined
ugexe japhb: looks like it doesnt process any compiler options 21:10
perl6 --ll-exception -e 'die' is another example
japhb o/ lizmat
ugexe: Oh, hmmm. That's fairly broken, methinks. 21:11
Anyone remember why that (lack of) behavior was chosen?
meisl *meisl tries out third-person-thingy 21:13
...and fails
21:15 raiph joined
geekosaur "/me ..." 21:19
that youc lient displays it with a leading * isn't what is significant (look carefully at where the "*" is...)
21:22 ggoebel2 joined 21:23 ggoebel left
meisl thanks geeosaur 21:25
meisl apologizes & thanks gee*k*osaur 21:26
21:28 amurf joined
BenGoldberg wonders what a geeosaur would be. Prehistoric clarified butter? 21:28
Oh wait, that's ghee. Nevermind.
21:29 brrt joined
japhb BenGoldberg: That was before the 'h' was added. 21:32
21:32 amurf left
japhb Maybe it's a prehistoric teenager that says "Gee, ya think?!" all the time. 21:33
21:37 Hor|zon joined
brrt \o 21:39
meisl: had to leave the train, sorry :-) 21:40
21:40 Juerd joined
meisl np, hello back :) 21:40
skids
.oO(a flock of pink flamingos can peck a gheeosaur clean in under 30 seconds)
21:42
yoleaux 11 Jul 2015 11:55Z <timotimo> skids: moritz is keeping github.com/moritz/perl6-all-modules
meisl brrt: gave me a while for meditation - but, to be honest, it's quite a bit to grok for me...
21:42 Hor|zon left
brrt ok, which point do you want to know 21:42
meisl ok, 1st: I can kinda guess "template: " but what's "macro: "? 21:44
21:45 Juerd left 21:47 Juerd joined, beastd left 21:49 rindolf left
brrt macro: defines a macro in the template preprocessor; it defines a tree that is spliced - with some arguments - directly into the templates in which it is used 21:50
for example, p6obody calculates the address of the body of a MVMP6opaque object 21:51
this is used in multiple different instruction templates
meisl brrt: so eg the p6obody macro is used in the template (matching?) sp_p6ogetvt_o? 21:55
(used/expanded)
lizmat tries to stay awaek
*awake (there you go) 21:56
brrt yes,
:-)
it's sunday evening nearly 12 o clock
lizmat japhb: what (lack of) behaviour are we talking about
brrt i'm only awake because of memory corruption :-P
lizmat brrt: almost 3pm here in Portland
brrt hmmm
lizmat and I'm only awake because I should be :-)
brrt also a good time for a nap :-)
lizmat I'm afraid a nap will bring me to 9pm or so... and then I'm really floating in time 21:57
brrt time is relative :-) 21:58
meisl brrt: it's rather late over here as well, so... - you choose
brrt i can explain more if you wish :-)
are you familiar with lisp/scheme?
meisl ok fine, thx
let's take the ^func macro instead, it looks less intimidating 21:59
brrt let's 22:00
hmmm 22:01
meisl am I right in that "^func" does NOT map to an mbc node, whereas the thing after a "template:" does?
brrt the if in p6obody should be an ifelse, or i should rename ifelse to if and rename the single if to something else
yes, that is exactly right 22:02
the ^func macro translates to a constant node with as first argument the name of the function referenced and as second argument the pointer size 22:03
a constant node has no children, just arguments, the constant in question and the size of it
in bytes
meisl ...translates to an *IR* node, right?
brrt ptr_sz expands to MVM_JIT_PTR_SZ which is defined as sizeof(void*)
yes, an IR node
meisl ok, now I'm trying to understand the template for "say": it references the ^func in its s-expr 22:04
brrt so for instance, in the template for say, it expands to (const (&CONST_PTR MVM_string_say) ptr_sz)
meisl :)
brrt the &foo syntax is somewhat special, it expands to a C-level macro (or 'function call') 22:05
like sizeof() and offsetof() and ALIGNOF etc
e.g. (&foo bar baz) yields foo(bar,baz)
the CONST_PTR macro simply casts the given pointer to uintptr_t, which is 64 bits, and fits into a single IR node 22:06
meisl so I can read the template for "say" just as if "^func" was literally replaced by "(const (&CONST_PTR ,a) ptr_sz))", with an appropriate ",a" (just textual substitution, preprocessor-like)? 22:07
brrt hmm, yes, somewhat; it's actually AST-level substitution ,but it comes to the same thing
meisl yeah, sure. "textual" isn't quite appropriate 22:09
brrt it's indeed just spliced in
without such a macro, jit expressions become really unwieldy very fast
these lists are compiled to a linear array that represents the tree by using (relative) indices 22:10
relative to the start of the list, that is 22:11
meisl ok ok. but actually it appears to me that the Aho alg already supports this kind of "splicing in", you know
that is, I think you do not need to reproduce it by introducing the separation between "macro:" and "template:" yourself 22:12
(and thereby - if I'm right - need no extra preprocessor) 22:13
brrt hmmm 22:15
i'm not sure we're talking about the same thing, now
the way i understand the aho/johnson algorithm is that the input is a tree, the output is a set (list) of 'tiles' that cover the tree, and the trick is to find an 'optimal' covering 22:16
whereby optimal typically means 'with the lowest possible memory usage/register usage/instruction count
and it does this by bottom-up matching the tree to certain patterns 22:17
fine; but the problem the exprlist compiler solves is a different one
the input is a basic block of moarvm instructions; that is, a linear sequence
the output should be a graph of machine-level operations that encodes the relationship between values 22:18
these relationships are encoded simply by linking from use to definition 22:19
meisl not sure either :) - anyways, I think it's got even more: a) matching against *complex* subtree patterns (written as s-expr, btw), b) the ability to rewrite the subject tree and re-visit it again and c) as a "side-effect", emit "tiles" (actual code-gen)
22:20 bin_005 left
meisl additionally, one can switch at will from bottom-up to top-down, anywhere in the subject tree 22:21
...as I said, very clever combination of very cleverly crafted pieces - and all under the assumption that I didn't get the paper completely wrong... :) 22:23
brrt hmmm, i don't think you got it wrong 22:24
meisl at least not completely.. I hope
brrt or, not entirely at least :-)
meisl as you mention again "linear sequence" vs "relationship between values" - we're still talking about a *tree" repr of the moarvm instructions, aren't we? 22:27
brrt if you ask complex questions, you'll get complex answers 22:29
meisl sure :)
brrt the spesh graph is basically a control-flow-graph (a graph of basic blocks)
spesh basic blocks contain linked lists of instructions 22:30
instructions are annotated with facts, that come from logging, and operands are ssa-namespaced, meaning that every value has a unique ssa-definition-name 22:31
meisl ssa?
brrt single static assignment
meisl ok
brrt it's a long story; the point is that these ssa-names implicitly define a tree, but that i disregard that information (for now) 22:33
and that i make the implicit tree explicit
meisl sorry if it's a dump q: so with the spesh graph we've already taken then step from *expressions* ("functional") to "procedural"?
22:33 BenGoldberg left
meisl ("procedural" meaning the explicit instructions how to calculate the expression) 22:34
brrt actually, the other way arround; the moarvm bytecode is procedural; the spesh graph makes it somewhat-functional (SSA) and the expression tree compiler (builder) makes it 'functional' in a way different from the way spesh does it
meisl oh 22:35
cognominal If I have a variable (really a constant) specifying a signature, is it possible to use it to specify a subsignature in a signature? 22:36
brrt compared to the moarvm bytecode, the expr tree achieves two things 22:37
a): it translates from a memory-to-memory model (from the inteprreter) to a register-to-register model, thereby making loads and stores explicit 22:38
b): it links use directly to definition
22:39 kurahaupo joined
brrt both of these together allow a code generator to make decisions on how to calculate something based both on where it's coming from and on how it will be used 22:39
meisl brrt: I'm afraid I need a break from the details