»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by moritz_ on 25 June 2010.
00:00 justatheory left, Juerd left 00:03 sbp joined, cono left 00:04 ash___ joined
dalek ecza: 2aafefe | sorear++ | Niecza/Grammar.pm6:
Add a NIL parser.
00:05
00:07 ash_ left, ash___ is now known as ash_ 00:11 justatheory joined, Juerd joined, PerlJam joined, sykes_ joined, Solarion joined, sunnavy joined, jnthn joined, buu joined, yves__ joined, farmer.freenode.net sets mode: +o jnthn 00:15 Ambiguity left 00:28 ash_ left
dalek ecza: 756f31f | sorear++ | (7 files):
Split Compiler up by classes
00:29
00:32 PerlPilot joined 00:33 Guest87395 left 00:37 PerlJam left 00:39 songmaster joined 00:44 isBEKaml left, azert0x left 00:46 azert0x joined, ash_ joined 00:48 stepnem joined 00:57 masonkramer left, masonkramer joined 00:58 Sarten-X left 01:01 amkrankruleuen left 01:07 meppl left 01:09 azert0x left 01:11 justatheory left, Juerd left, sykes_ left, Solarion left, sunnavy left, jnthn left, buu left, yves__ left 01:15 azert0x joined, azert0x left, azert0x joined 01:19 synth left 01:21 whiteknight left 01:22 justatheory joined, Juerd joined, sykes_ joined, Solarion joined, sunnavy joined, jnthn joined, buu joined, yves__ joined, farmer.freenode.net sets mode: +o jnthn 01:25 azert0x left 01:30 azert0x joined 01:33 synth joined 01:38 sunnavy left 01:39 sunnavy joined 01:46 bjarneh joined 01:56 ashleydev left 01:57 ashleydev joined, ashleydev left 02:03 synth left 02:04 synth joined 02:10 justatheory left 02:16 synth left 02:17 azert0x left, agentzh joined, synth joined 02:28 bjarneh left 02:33 redicaps joined
lue anyone around to help with a PIR compilation bug? (will post to gist) 02:34
redicaps Hello perl6, what dose $*variable means? Where can I find the documentation for this "*"? 02:36
02:37 azert0x joined, azert0x left
redicaps Hmmm, I found it, $*foo dynamically overridable global variable~~ 02:39
tylercurtis redicaps: it's used for the equivalents of many of the special globals in Perl 5. 02:41
phenny tylercurtis: 01 Jul 23:54Z <sorear> tell tylercurtis to address phenny
02:41 Ambiguity joined
redicaps tylercurtis: Thanks 02:42
sorear phenny: ask TimToady what $*INVOCANT_IS is for - I thought method calls were exactly the same as sub calls 02:44
phenny sorear: I'll pass that on when TimToady is around.
tylercurtis There's also $.foo for public accessors of attributes of an object, $!foo for private attributes. $<foo> for the named capture in the match result that's bound to $/($<foo> is equivalent to $/{'foo'}). There's a few others, too.
perlcabal.org/syn/S02.html#Names_and_Variables and scroll down a little bit and you'll find a list. 02:45
lue gist.github.com/460851 — maybe someone has PIR magic... 02:48
02:50 patspam left 02:51 TiMBuS joined
TimToady sorear: INVOCANT_IS sets $<args><invocant>, which suppresses adding such a call to the mysteries 03:01
phenny TimToady: 01 Jul 13:32Z <sorear> ask TimToady In the interests of pmurias & azawawi wanting to build installs, how would you feel about me moving src/perl6 into the Perl6::STD:: p5 namespace?
TimToady: 02:44Z <sorear> ask TimToady what $*INVOCANT_IS is for - I thought method calls were exactly the same as sub calls
TimToady re Perl6::, I'd have to think about it and read the backlog 03:02
std: foo(1,2,3)
03:02 synth left
p6eval std 31528: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'foo' used at line 1␤Check failed␤FAILED 00:01 113m␤» 03:02
TimToady std: foo(1: 2,3)
p6eval std 31528: OUTPUT«ok 00:01 110m␤»
TimToady see, no error
unfortunately, still don't have time to backlog 03:03
03:05 jaldhar joined, synth joined
sorear TimToady: What does that syntax mean? 03:09
tylercurtis "If the first positional is followed by a colon instead of a comma, it is marked as the invocant in case it finds itself in a context that cares." 03:11
sorear What does that mean? 03:12
03:12 eternaleye left 03:14 azert0x joined
lue it means you could do, call it either xyzzy($a, $b, $c) or $a.xyzzy($b, $c) [IIRC] 03:14
03:15 justatheory joined 03:16 synth left 03:19 bjarneh joined
tylercurtis sorear: here's a better citation for that perlcabal.org/syn/S06.html#Invocant_parameters 03:19
foo(1: 2, 3) is another way of saying 1.foo(2, 3). S06 actually implies that 1.foo(2,3) is actually converted to foo(1: 2, 3) internally. 03:21
If I'm reading it correctly.
ingy sorear: fyi, the difference between rule, token and regex is in S06, not S05: perlcabal.org/syn/S06.html#Subrouti...de_objects 03:22
I just found it :)
03:23 azert0x left
sorear ingy: S05:2045 also defines it 03:27
03:33 Guest23195 joined 03:37 eternaleye joined
pugssvn r31529 | sorear++ | [Cursor] Be a little less eager to drop exceptions on the floor 03:42
03:46 synth joined 03:51 stakishi joined
spinclad masak, arnsholt: re gist.github.com/458738, consider .../dud/e and .../dude/f: .../dude will get mkdir'd but not .../dud . want a &path-prefix not &string-prefix /me thinks. 04:03
(note: still backlogged, dunno if this was noted already)
04:05 stakishi left
spinclad (alternatively, just uniquify and mkdir them all.) 04:05
dalek ecza: ea7b75e | sorear++ | (3 files):
Start building the Actions connector
04:13
ecza: 2b08263 | sorear++ | (2 files):
Bring actions up to comp_unit.
04:19
04:20 synth left 04:29 synth joined 04:33 bjarneh left 04:51 perl_babe joined 04:52 perl_babe left
dalek ecza: 5c415c9 | sorear++ | (2 files):
Translate setting WIP to parsed-Perl6 - parser not yet ready!
04:55
sorear NIL is officially the ugliest language I've ever designed 04:56
04:57 mberends left 05:02 quester_ joined
quester_ . 05:09
05:10 ash_ left, Mowah joined 05:17 lkk- joined
sorear pmichaud: Do we have any clue yet about how compiler-used helper lexicals should work? (I know you were complaining about &reducewith not long ago) 05:22
05:26 c1sung joined, synth left 05:33 synth joined 05:40 yinyin joined 05:47 xinming_ is now known as xinming 05:51 songmaster left 05:54 ashleydev joined 06:00 Su-Shee joined 06:04 tylercurtis left, tylercurtis joined 06:05 uniejo joined, dual joined 06:16 justatheory left 06:25 synth left 06:26 synth joined 06:29 dimid left 06:30 dimid joined 06:37 justatheory joined 06:39 yinyin left 06:42 justatheory left 06:45 yinyin joined 06:49 agentzh left 06:52 tylercurtis left 06:53 tylercurtis joined
sorear huh 07:05
<.obs('Object', 'Mu as the "most universal" object type')>
What version of Perl had Object?
moritz_ previous Perl 6 iterations 07:07
like, until a year ago 07:08
sorear keeps forgetting he's 10 years late to the part
y
07:13 redicaps left, mberends joined
dalek ecza: 6b89c19 | sorear++ | Niecza/ (2 files):
Fix parsing of line-oriented NIL declarations
07:19
ecza: 02b0c15 | sorear++ | Niecza/Actions.pm:
Suppress multiple warnings for missing action methods
ecza: 1863ead | sorear++ | Niecza/Grammar.pm6:
Allow parsing double-quoted strings in NIL
ecza: 0dc20f4 | sorear++ | Niecza/ (2 files):
Assorted action methods; merge num and decint
ecza: 53e6a3d | sorear++ | (2 files):
Implement yada operator parsing; use sorries for NYI
sorear maybe if I'm going to use dalek I should make bigger commits, huh? 07:20
moritz_ no 07:21
07:23 rgrau joined
mathw One of the joys of git is little, self-contained, sensible commits 07:25
07:29 masak joined
masak oh hai from a bus! 07:29
sorear Hello masak on a bus, hello masak on a plane 07:30
masak tylercurtis: no, I wasn't aware of Lisps handling &eval even when doing native-code compilation. I'd sure like to have it explained to me somtime how that works.
07:32 masak`` joined, ashleydev left
sorear all (ok, 99%) &eval means is that you have to bundle a compiler 07:32
tylercurtis indeed. 07:33
masak`` so it's native code, but the executable is not really slimmed?
sorear demand paging ftw
masak`` oh well, as long as it's fast...
sorear the compiler tends to be in its own shared library anyway 07:34
so it doesn't bloat the executable
tylercurtis what sorear said.
I was writing that in a more lengthy way and then he says it much more concisely and clearly.
sorear and modern operating systems will load shared libraries lazily, one page fault at a time
masak`` tylercurtis: I know, that sorear guy is amazing!
sorear oh please. :) 07:35
mberends masak``: I wish you a good masakthon!
07:35 masak left 07:36 masak``` joined
masak``` mberends: you mean here on the bus, or when I arrive at jnthn's place? :) 07:36
mberends masak```: both :) 07:37
masak``` hm, if I get more backticks than this, I might decide to go dark.
tylercurtis masak```: masak with no ticks seems to now be available.
masak``` who here could help me set up a Yapsi p6eval target, by the way? 07:38
07:38 masak``` is now known as masak
masak .oO( nick with no tick ) 07:38
I'm guessing either "moritz_" or "diakopter", or both. 07:39
07:40 masak`` left
masak now that we have loops, it suddenly feels worth it to add Yapsi to p6eval. 07:40
and then I could do this, and show y'all what needs to be fixed ASAP. :)
yapsi: my $a = 3; while --$a { say my $b; $b = 5 } # prints Any\n5\n, which is wrong 07:41
oh, and I can't actually write the comment there, because we don't parse comments :P 07:43
07:46 masak` joined 07:49 quester_ left, agentzh joined, masak left 07:53 masak` is now known as masak
moritz_ masak: I can help, but probably not this weekend 08:13
masak that's ok. there's no rush.
moritz_ masak: it helps if you write a shell script that git pull's yapsi, and rebuilds it 08:17
assuming a ~/yapsi/ dir or so
masak moritz_: it'll need to have access to an 'alpha' executable for the time being. should it use the one that p6eval uses for the 'alpha:' target, or should it get its own? 08:18
moritz_ the existing one is fine 08:20
masak ok. I'm just going to assume a path for it; can change it later.
moritz_ ~/rakudo-alpha/perl6
masak thanks.
moritz_ on second thought, it's probabl ~/rakudo-alpha/parrot_install/bin/perl6 08:21
but I can symlink if needed
get an executable named 'alpha'
masak it would help slightly, but it's not strictly necessary. 08:22
moritz_ ~/rakudo-alpha/parrot_install/bin/alpha
done
masak thanks :)
08:24 Ross joined 08:34 tadzik joined 08:36 thebird joined
jnthn masak: oh hai 08:37
08:37 masak` joined
jnthn
.oO( the continual wifi fel must really tick masak off )
08:37
tylercurtis masak`: I know I'd be bananas if I relied on SIC being the same between releases, but how must does it change between releases?
masak` jnthn: :)
08:37 Ross left
masak` jnthn: not sure a 'fel' can be continual as can a 'fail'... :) 08:38
tylercurtis: unpredictably and depending on current needs.
jnthn masak`: details details :P
08:40 pmurias joined, masak left
arnsholt masak`: Is there something in particular keeping Yapsi from using master? 08:42
08:42 dakkar joined
pmurias sorear: ping 08:43
08:43 masak` left
dalek ecza: 2c4d2c9 | sorear++ | (3 files):
Add many insn: actions; implement labels & fix methods.
08:43
ecza: 0df3528 | sorear++ | Niecza/ (2 files):
Implement CLONE:, COPY:, and LEXICALS:
pmurias sorear: if i'm loading a custom core how do i generate the .lex file? 08:46
sorear (Minor nit: you don't. .lex files are hand-written; the files you generate are .syml 08:49
)
I think you need to call STD->parsefile('filename', setting => 'NULL') after making sure the file contains a YOU_ARE_HERE statement 08:50
the parse will spit out a .syml file as a side effect
this is how CORE.syml is generated
pmurias so how does ./std CORE.setting know that it should load NULL.lex? 08:54
sorear because std contains a special case for the filename "CORE.setting" 08:56
08:56 proller joined
sorear if you are using a custom setting, you need to make the parsefile call yourself 08:56
pmurias writes a script to do that 08:58
sorear: have you seen hoopl (lambda-the-ultimate.org/node/3906)
sorear I think so 09:00
09:00 lkk- left 09:01 tylercurtis left
pmurias sorear: as both niecza and mildew are written in perl5 it might make sense to port that over to enable writting cool data flow optimalisations 09:03
09:08 tadzik left
pmurias sorear: how can i make STD find my MildewCORE.pm6.syml? 09:08
sorear it needs to be in syml/ under your STD5PREFIX path 09:09
then pass setting => 'MildewCORE' to parse(file)
iiuc
pmurias my STD5PREFIX is the src/perl6 09:13
fixing $other stuff &
09:20 eternaleye left
sorear How closure-like is the block of a class statement? 09:23
jnthn Very in the case of e.g. an anonymous class 09:25
dalek ecza: 63766d1 | sorear++ | Niecza/Actions.pm:
Simplify and rationalize handling of quote-like operators
ecza: 43d684c | sorear++ | (2 files):
Implement a fake type inferencer for methods/fields/indexers
ecza: 8048577 | sorear++ | (3 files):
Implement the rest of the NIL ops
09:26 azert0x joined
jnthn rakudo: my @c; for 1..5 -> $x { @c.push(class { method m { $x } }); }; @x>>.m>>.say 09:26
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Symbol '@x' not predeclared in <anonymous> (/tmp/pFxJIJSkun:11)␤»
jnthn rakudo: my @c; for 1..5 -> $x { @c.push(class { method m { $x } }); }; @c>>.m>>.say
p6eval rakudo 3d2cb8: OUTPUT«5␤5␤5␤5␤5␤»
jnthn oh schiese, the closure bug
Anyway, if Rakudo didn't have busted closures that should work. 09:27
(as in, print 1,2,3,4,5)
sorear out 09:31
09:31 yinyin left
sorear this is wonderful, I'm actually feeling productive :> 09:31
but I must sleep now
dalek ecza: 83fe3c0 | sorear++ | (2 files):
Drop unused and unimplemented signatures
09:58 cygx joined 10:04 masonkramer_ joined 10:06 masonkramer left, masonkramer_ is now known as masonkramer
cygx phenny: tell 10:06
copy + paste fail ;)
phenny: tell ash_ try.rakudo.org is somewhat functional: hit try.rakudo.org:8090 to create a new session; you can input text and see it displayed twice (most likely only after a manual refresh); copy your sid and insert it at test.html to simulate polling for updates 10:08
phenny cygx: I'll pass that on when ash_ is around.
cygx phenny: tell ash_ don't create too many sessions, though: the backend currently needs a manual restart to get rid of them 10:09
phenny cygx: I'll pass that on when ash_ is around.
10:25 agentzh left
bbkr rakudo: say Inf.ceiling ~~ Inf.floor 10:36
p6eval rakudo 3d2cb8: OUTPUT«1␤»
10:36 cosimo joined 10:39 ruoso joined 10:49 Chillance joined
pmurias ruoso: hi 10:51
ruoso: what would be a good way specifing which SETTING should be used for a given file?
10:54 pnate joined 11:25 mryan joined 11:26 DemoFreak joined 11:28 clintongormley joined
DemoFreak renormalist: ping :P 11:29
mryan pong :-) 11:30
DemoFreak ;) 11:31
11:36 mryan left 11:41 cono joined 11:44 sftp joined, tadzik joined 12:23 envi^home joined 12:33 timbunce joined
mathw Afternoon 12:34
jnthn o/ mathw
12:36 masonkramer left 12:37 masonkramer joined 12:38 pmurias left 12:39 pmurias joined 12:41 mberends left 12:42 envi^home left, envi^home joined 12:48 literal joined, zed_ joined 12:49 zed_ left
pmurias TimToady: ping 12:50
mathw jnthn: hey. What's happening? 12:51
pmurias is the OUTER in the outermost block the outermost block? 12:53
TimToady the outermost block is CORE 12:57
UNIT::OUTER is SETTING 12:58
pmichaud good morning, #perl6 12:59
mathw o/ pmichaud 13:00
colomon \o 13:01
jnthn mathw: Hot weather. 13:06
mathw: And getting my appartment tidied a bit in prep for $weekend-hackathon
mathw cooler here today
\o/ hackathon
is it a rakudo hackathon?
pmichaud jnthn: ooooh, can I come to the hackathon?
jnthn pmichaud: Of course! ;-) 13:07
13:07 sundar joined
jnthn mathw: I suspect I'll be doing some Rakudo hacking. I also hope to look at pls a bit too, since it's creator will also be at the hackathon. :-) 13:08
mathw decides that SSL is too much effort, and everyone should just not have any secrets
pmichaud ....wow
round trip to CPH, leaving today, is only US$1300
mathw bargain
jnthn CPH is only a 45 minute train ride then 5 minute walk to here. ;-) 13:09
pmichaud right
is there a closer airport? ;-)
mathw does the flight come with free deep-vein thrombosis?
pmichaud but I could potentially be in CPH tomorrow at 13h20 :-)
jnthn Geographically, I believe there is.
In terms of time to get from it to my place, probably it'd take longer though. 13:10
pmichaud right
jnthn Not to mention that last time I checked out where you could get to from Malmo airport, there was 5 flights a week to Iraq and none to the UK...
pmichaud anyway, interesting to know that it would indeed be possible for me to get there on short notice. :)
jnthn Yes :-)
mathw The modern world 13:11
I still find it odd that I could get up right now, walk down to the railway station and get on a train for London, walk across the station and get a train to Paris.
Well, I could if my passport hadn't expired
jnthn mathw: I did Eurostar a week ago today :-)
mathw I did it once
jnthn mathw: Though to Brussels rather than Paris.
mathw in... err... 1999 13:12
and that was to Brussels
jnthn It's like Paris, but no big tower, noisier and they're not on strike.
;-)
mathw lol
I've never been to Paris
or anywhere else in France, other than passing through on the way to Brussels
But I liked Brussels
pmichaud did a tour of France in 1998. 13:13
jnthn The things I've enjoyed most in France are (a) meeting the Perl mongers there and (b) that modern art gallery
mathw Although not as much as I liked Munich
jnthn er, in Paris
pmichaud note, not the "Tour de France"
mathw two people from my office are doing something related to the tour de france
jnthn mathw: Oh, Munich has excellent beer!
mathw etape du tour or something like that
which seem sto involve cycling up two mountains
sounds painful 13:14
jnthn: so my friends told me
oh and I liked Stuttgart when I went there for GUADEC
jnthn Good hearty noms too.
mathw oh yes
the noms were excellent
jnthn misses being in Central Europe, but at least will get to holiday there later on this year :-)
mathw the first night in Munich was the first time I encountered that regional speciality of a large lump of pig cooked in beer, served with potatoes and lard 13:15
jnthn omnomnom
mathw I can't remember what it's called, but it's GOOOD
13:17 uniejo left
mathw is now hungry again, despite having been to Brown Betty's for lunch 13:17
pmurias TimToady: when using a custom CORE i get a infinite loop when looking &say up 13:18
jnthn mathw: Heh, made me hungry too :-) 13:19
pmurias i'm using STD->parsefile('MildewCORE.setting',settting=>'NULL',tmp_prefix=>'tmp/') to generate it 13:20
TimToady CORE isn't supposed to have an OUTER 13:21
pmurias TimToady: am i generating it right? 13:22
13:27 plobsing joined
TimToady you can look at the generated symbol tables in /syml 13:28
you probably need to tweak STD.pm6 line 1941 13:30
it's hardwired to 'CORE' 13:32
pmurias TimToady: keeping the NULL core should be harmless right? 13:36
jnthn pmichaud: How's the closures going? 13:38
pmurias TimToady: changing that line helped but i don't know why 13:40
13:49 literal left
cygx phenny: tell ash_ I added some JS code to poll for new messages/status changes; it's working, but a bit ugly - I need to think about how I want the 'public' interface to look 13:50
phenny cygx: I'll pass that on when ash_ is around.
pmichaud jnthn: it's going okay
jnthn: when would one not want the signature to be generated lazily? i.e., under what circumstances do we call create_code_object with $lazy set to zero? 13:51
13:52 literal joined, PerlPilot is now known as PerlJam
jnthn pmichaud: I think type thunks may not want to be lazily generated 13:55
I forget if there was actually an issue there 13:56
pmichaud I can see that there might be, if we need a signature before something gets invoked.
jnthn Yeah
I have vague memories of something "interesting" going on there. 13:57
pmichaud: Looks like we don't for pblocks at the moment
pmichaud Given that I'm now attaching the lazysig directly to the Parrot sub object instead of the dynamically-created Code wrapper, would you see a big hit from attaching lazysig during the compilation unit's loadinit?
jnthn pmichaud: But I think there's no good reason for that.
pmichaud in the case of pblocks, it's because sometimes they're immediate-called and so we don't keep a Code wrapper to generate the sig. 13:58
jnthn pmichaud: If you're doing it from the compilation unit's overall loadinit I think tht's OK
pmichaud: oh, that's the one
pmichaud anyway, I now have it so that one can generate a llsig without needing a Code wrapper.
jnthn pmichaud: The expense I wanted to avoid was having *loads* of loadinit blocks to invoke
pmichaud well, we also wanted to avoid creating the signatures
but yes
jnthn Oh yes, but I meant that's why not to do lazy sig attachment in a laodinit :-) 13:59
erm, in a loadinit for the block
pmichaud right
I'm worried about the case of: BEGIN { foo(); }; our sub foo() { ... }
although I guess in that case the 'our' ends up occurring before the BEGIN. Maybe. 14:00
jnthn well
depends
If we're meant to run BEGIN as soon as we've parsed it (we are) I can't see how that'd work. 14:01
pmichaud oh, that's likely a good point as well.
okay then, our sub foo() { ... }; BEGIN { foo(); }
we have to make sure that &foo has its signature (lazy or otherwise) attached before the BEGIN block executes.
14:01 JimmyZ joined
pmichaud but again, I'm guessing the 'our' handling might take care of this already. 14:02
jnthn BEGINs are generally awkward.
pmichaud regardless, it'll be relatively easy to refactor when/if we get there.
jnthn Refactoring to get really awesome BEGIN handling, OTOH, is decidedly less easy. 14:03
14:07 dual left 14:10 clintongormley left, literal left
pmichaud jnthn: I have a question about Actions.pm:3026 14:11
oh, wait, it might be a different number in master
(I'm in a branch)
just a sec
Actions.pm:3037
pmurias TimToady: would adding a null attribute for settings that should be removed (the NULL one), be ok? 14:12
jnthn pmichaud: phone, moment.
pmichaud jnthn: no rush
14:12 literal joined 14:15 ash_ joined 14:16 mberends joined, patspam joined 14:19 Ambiguity left
jnthn my $lazy_name := make_lazy_sig_block($expr<past_block>); 14:24
pmichaud: That one?
pmichaud: That whole chunk of code in where_blockify is dealing with an ordering issue I believe (shoulda commented it as such). 14:25
pmichaud: Basically, the loadinit can be too late
(for where blocks)
14:26 clintongormley joined
jnthn pmichaud: But if you've done an "always lazy sig, then simplify for immediate blocks" approach then you can probably toss this extra check. 14:26
And that area can become simpler
The problem was that it was not building lazy sigs for the pblocks though
And for where we really needed them to beat some ordering issues into submission. 14:27
14:33 skids joined
pmichaud okay, ordering issue tells me a lot 14:33
all of that stuff is likely to get a significant refactor/simplification 14:34
jnthn It'd not surprise me if that issue evaporates as a result of your refactors, yes
pmichaud I'm thinking of combining add_signature and create_code_object
14:36 justatheory joined
pmichaud actually, immediate blocks end up not needing simplification either :-) 14:37
since the lazysig is now attached to the Parrot sub itself and evaluated upon invocation
jnthn pmichaud: Right, but you build a wrapper for them? Or not? 14:40
pmichaud jnthn: haven't gotten to that part yet :-) 14:41
probably won't build a wrapper.
14:42 isBEKaml joined, sundar left
jnthn ok 14:42
14:52 JimmyZ left 14:56 patspam left 14:57 jaldhar left, plobsing left 15:03 ashleydev joined 15:04 macdaddy joined, macdaddy is now known as Guest83880 15:20 pyrimidine joined 15:26 Ross joined 15:27 isBEKaml left 15:32 bbkr joined 15:35 patspam joined, rv2733 joined, eternaleye joined 15:39 gbacon joined 15:52 thebird left 15:54 thebird joined 16:02 cygx left 16:03 bbkr left 16:04 bbkr joined 16:09 timbunce left 16:14 bbkr left, timbunce joined 16:15 bbkr joined 16:16 dual joined 16:27 Guest23195 left 16:37 alester joined
ash_ when you make a sub class, like class Foo is Bar { }; does that call 'compose' in Bar's ClassHOW? 16:47
phenny ash_: 10:08Z <cygx> tell ash_ try.rakudo.org is somewhat functional: hit try.rakudo.org:8090 to create a new session; you can input text and see it displayed twice (most likely only after a manual refresh); copy your sid and insert it at test.html to simulate polling for updates
ash_: 10:09Z <cygx> tell ash_ don't create too many sessions, though: the backend currently needs a manual restart to get rid of them
ash_: 13:50Z <cygx> tell ash_ I added some JS code to poll for new messages/status changes; it's working, but a bit ugly - I need to think about how I want the 'public' interface to look
sorear ash_: no 16:48
16:48 Mowah left, Mowah joined
ash_ does it call ClassHOW's compose? 16:51
sorear on Foo
16:53 Mowah left 16:58 TiMBuS left
ash_ so, Foo.^compose is called sometime during class Foo is Bar { } ? 17:00
17:01 dakkar left
sorear in niecza, it's called at the closing brace 17:05
17:05 thebird left 17:06 cdarroch joined, cdarroch left, cdarroch joined
ash_ rakudo: class Foo { }; class Bar is Foo { method ^compose { say 'yes'; }} 17:07
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤A method named 'compose' already exists in class 'P6metaclass'. It may have been supplied by a role.␤»
ash_ sad day oh well, i'll keep trying
sorear: if i were to try to add a phaser to roles called COMPOSED that is called when you compose a role into anything, where do you think that would go? 17:08
17:08 Mowah joined
ash_ i think i could add the call to the ^compose method, to fire the phaser 17:10
17:12 tylercurtis joined
PerlJam ash_++ 17:15
17:38 meppl joined 17:41 Lorn left 18:11 revdiablo joined
colomon phenny: tell masak I sent a pull request to LastOfTheCarelessMen last night, and I see he has pulled my changes. So I think Vector and ABC are now officially ufo-friendly. Probably still do not work otherwise, alas. 18:12
phenny colomon: I'll pass that on when masak is around.
pmichaud the signature and closure refactor is becoming painful. :-| Not as painful as lists, but still painful. 18:19
18:20 Schwern joined
PerlJam pmichaud: What's painful about it? 18:20
pmichaud the original factoring has lots of dependencies
and a ton has been built on top of those specific dependencies 18:21
PerlJam you're in a maze of twisty passages, all different? :) 18:22
Just think though ... once the refactor is done, the universe will be righter for the next time.
pmichaud sure, that's the way it usually is.
if it isn't, then there's little point in doing the refactor :) 18:23
jnthn pmichaud: Painful?
PerlJam pmichaud: but you're not just refactoring ... you're righting the universe :)
pmichaud jnthn: yeah. I just get untraceable errors at different points. 18:24
18:24 masak joined
masak \o/ 18:24
phenny masak: 18:12Z <colomon> tell masak I sent a pull request to LastOfTheCarelessMen last night, and I see he has pulled my changes. So I think Vector and ABC are now officially ufo-friendly. Probably still do not work otherwise, alas.
masak colomon: progress. nice.
jnthn pmichaud: Congrats. :/
masak mberends: just back from a nice Thai meal. we can now say 'elephant' (the name of jnthn's beer) in Thai, tone and all :) 18:25
masak backlogs
jnthn masak: Huh, I didn't remember what tone it was, just that it was a nice beer. -)
pmichaud: Specifics?
pmichaud on phone
masak jnthn: in Mandarin nomenclature, it was tone 3.
jnthn ash_: No, .compose does not get called up the hierarchy. 18:26
ash_: (nor shold it) 18:27
*should
ash_ okay
pmichaud jnthn: it's just when I try to move the sig initialization around, I get "Null PMC" errors.
(and it's not clear where they're coming from) 18:28
jnthn pmichaud: Suggest getting out a C debugger and setting a breakpoint in null.pmc
pmichaud: In case they're coming from the C parts
pmichaud well, I'm turning on PIR backtraces again to see if it helps.
jnthn Also worthwhile
I usually disable those when debugging guts. :-)
pmichaud Most of the other refactoring has gone fairly well -- only a little bit of breakage in and around roles at the moment. 18:29
ash_ is there a place that is called during inheritance?
pmichaud ohhhh, I see the difficulty. Ickiness. 18:31
sorear hello masak
masak ash_: that seems to be a frequently-ish asked question.
ash_: I don't think there is.
sorear: hi! 18:32
pmichaud bbiab
jnthn ash_: No
ash_ masak: well, maybe i can add one, i am trying to prototype a phaser for INHERITED and COMPOSED
masak ash_: ah, then it was probably you who asked last time :) 18:33
jnthn ash_: Here's how I'd implement it.
masak I recall there being talk about those phasers.
ash_ yea, i talked about them
jnthn ash_: The INHERITED and COMPOSED phasers register with the metaclass.
ash_: Then in the .^compose it calls some method to fire the relevant phasers up the hierarchy.
(you could put the code in .^compose itself, but factoring it out is a bit neater) 18:34
rakudo: unlink 'README' 18:35
p6eval rakudo 3d2cb8: ( no output )
jnthn ...oops ;-)
sorear rakudo: say slurp("/etc/passwd") 18:36
p6eval rakudo 3d2cb8:
..OUTPUT«root:x:0:0:root:/root:/bin/bash␤daemon:x:1:1:daemon:/usr/sbin:/bin/sh␤bin:x:2:2:bin:/bin:/bin/sh␤sys:x:3:3:sys:/dev:/bin/sh␤sync:x:4:65534:sync:/bin:/bin/sync␤games:x:5:60:games:/usr/games:/bin/sh␤man:x:6:12:man:/var/cache/man:/bin/sh␤lp:x:7:7:lp:/var/spool/lpd:/bin/sh␤mail:x:8:8:m…
jnthn rakudo: say &unlink.signature
p6eval rakudo 3d2cb8: OUTPUT«Signature()<0x42e3d00>␤»
pmichaud feels to me as though "INHERITED" and "COMPOSED" should be submethods, not phasers. 18:38
something along the lines of BUILD
ash_ well, what would be self for those methods? 18:40
jnthn That could also work I guess
But...what ash_ said.
pmichaud do you expect them to have a self? 18:41
I mean, even as phasers? What would self be for a phaser?
jnthn pmichaud: Well, it wouldn't have one
pmichaud right
masak use.perl.org/~Mark+Leighton+Fisher/journal/40430 # a new perl module! woot!
ash_ $_ would be the target they are being mixed into
I wasn't sure if they'd have a self
pmichaud anyway, phaser just feels wrong for some reason. 18:42
ash_ maybe I'll just email the language mailing list and think about it a bit more
jnthn pmichaud: It kinda fits. It's a block that's run at a special time.
pmichaud well, technically BUILD is the same :-)
jnthn Well 18:43
We can probably agree it should have CAPITALS whatever it is. ;-)
BUILD has a fairly obvious invocant though.
pmichaud anyway, I've noted my discomfort :-)
jnthn I guess if it's a submethod the invocant is just the type object of the class that we made that inherited from it. 18:44
It's Liskov-compliant. :-)
18:46 gbacon left
pmichaud jnthn: so, if I convert all sigs to be lazy would that likely be a win or a lose? 18:48
(assuming that we can set up the lazysigs in a single :load :init) 18:49
jnthn pmichaud: Should be fine 18:50
pmichaud: Perhaps a small win.
pmichaud well, it's be a win for consistent handling of blocks :) 18:51
I'm curious if it's a performance win or lose
jnthn Well, we gotta build it at some point
It's more about when we pay. :-)
More at startup, or more later on.
PerlJam are INHERITED and COMPOSED specced somewhere or is this one of those implementation-first things? 18:52
pmichaud PerlJam: they're speculative.
PerlJam sure, but are the speculation written anywhere? 18:53
pmichaud gist.github.com/461743 # for jnthn++ -- what the lazysig loadinit looks like
PerlJam: no.
ash_ ah, found my old gist gist.github.com/392673 from when i last talked about it
pmichaud jnthn: so, we end up with one :load :init sub for the entire compilation unit -- inside of that :load :init sub is one setprop instruction for each block in the unit 18:54
jnthn pmichaud: That should be efficient. :-)
pmichaud the main cost would be that all of the subs would receive prophashes fairly early
jnthn Right. 18:55
But if allocating a hash is super expensive, well, we have many bigger problems. ;-)
PerlJam I don't really have a feel for why you would need to hook into the inheritance mechanism with INHERIT, but it seems to me that COMPOSE would be good for automatic conflict resolution
sort of a enough-rope kind of thing
pmichaud we also now have a place where we can do unit-scoped :loadinit things, instead of having to attach them to a block 18:56
we may be able to exploit that as well to remove a few :loadinits.
jnthn Possibly, yes 18:57
pmichaud (can't do it where order-of-initialization matters greatly, or where something needs to be scoped within an outer block)
pmichaud tries the radical "make all sigs lazy" patch 18:58
18:59 gbacon joined
ash_ PerlJam: a use for INHERIT i can think of is (for instance) a database ORM that has a class that represents an abstract table might use one so when you subclass it to define your specific table, a callback that is called when the class is inherited would give you the ability to hide a lot more from the end uses, as they wouldn't have to manually register their tables with some object manager 19:01
PerlJam ash_: if COMPOSE and INHERIT are to be phasers, I don't think they should take parameters, but rather glean everything from the environment somehow. That seems to be how the other phasers work.
jnthn That probably suggests they want to be (meta-)?methods. 19:02
ash_ yeah
thats a good argument against them being phasers 19:03
pmichaud yes, that's the other reason I was thinking more along the lines of submethods.
ash_ i don't remember why i wanted them to be phasers, so... it probably wasn't that big of an issue... 19:04
PerlJam ash_: I'm not sure I buy your ORM example since even though there are things you want to happen automatically, you'll also want to be able to customize for the cases where the proper conventions aren't followed. 19:05
ash_ ruby on rails ActiveDirectory does it
PerlJam ash_: i.e. sometimes you *want* to manually register your tables
ash_ they use the inherited callback to register which objects represent database tables 19:06
pmichaud objects?! or classes?
ash_ DataMapper does it with what would be effectively COMPOSE
PerlJam ash_: but do you really need to hook into "inherit time operations" to do that?
ash_ pmichaud: classes i meant, not specific instances 19:07
PerlJam ash_: or do you just need to inherit from a class that makes good use of introspection?
ash_ well, the reason they do it that was is you can load the class definitions, then know right after loading them the database table defintions, if you put it in like BUILD then you'd have to instantiate an object for each database table before you'd know 19:08
pmichaud class submethods could be called at composition time, not at instance creation time, though. 19:09
PerlJam ash_: also, if I remember my rails enough, the things you're talking about are done via ordinary subs (or maybe methods) that happen to execute as the class is being built. We already have that without an INHERIT hook
ash_ the self.inherit hook in ruby executes at the last "end" in a class definition 19:10
19:11 Lorn joined
pmichaud jnthn: with my latest changes, refactoring suddenly became much less painful again. :-) 19:11
PerlJam ash_: Hmm. 19:12
jnthn pmichaud: yay :-)
pmichaud: Am hacking on some S12 bits ATM, hopefully should be well clear of what you're working on. :-)
pmichaud jnthn: I hope so, yes. As long as you're not dealing with create_code_object, add_signature, make_block, etc., we should be fine. :) 19:13
jnthn no no
with luck, not even touching Actions.pm :-)
pmichaud bind?
jnthn Pondered it then realized...nah
pmichaud any of the pmc classes?
the dynops? ;-)
jnthn pmichaud: No, I'm just re-instating class Foo is rw { ... } implying the attributes are is rw by default
19:14 mantovani joined
jnthn Should be all in traits.pm and the meta-model if I do it right. ;-) 19:14
pmichaud okay, that might affect things a bit, since attribute initialization is thunk-based.
but probably not.
jnthn Unlikely.
ash_ PerlJam: I just checked, thats how they used to do it, apparently they don't use the inherit callback in the most recent version, i am not sure how its done now (but back around 2.0 they used the inherit callback) 19:15
github.com/rails/rails/blob/v2.0.1/...se.rb#L300
PerlJam ash_: thanks 19:17
ash: but if it's called just before the last end, we can already do class Foo { ... some-func(); } now. Is there some advantage to being able to put some-func() anywhere within the class def? 19:18
ash_ PerlJam: ah, they just have a special class that they delegate the descendants to now, github.com/rails/rails/blob/master/...ker.rb#L23 19:19
PerlJam: i don't understand what you mean, are you saying, instead of having a callback, just have people put a sub call in the body of the class definition? 19:20
PerlJam sure
ash_ to me, having an automated way is cleaner but i suppose it results in the same thing 19:21
if people remember to do it
PerlJam Perl should have enough static information to know the class at that point and have enough introspective ability to look up the inheritance tree
ash_ but this is for looking down the inheritance tree not up 19:22
PerlJam (and you can already put it anywhere, but I was assuming that it's important to know the method defs that came before it :)
pmichaud PerlJam: the point is to put the phaser/submethod into the base class, not the derived one. 19:23
and it's automatically triggered whenever a new class is derived/composed from it.
(maybe you're accommodating this already; I don't see it though)
lue ohai 19:24
PerlJam no, I guess I was thinking that the class body would be executed on each instance creation, but that's not the case.
(that's why we have BUILD, etc after all)
ash_ in this particular example, thats useful because you can say "AbastractDatabaseTable.decendants>>definition" and know all of the database tables you need to make
pmichaud also, you want it to happen at composition time, not at instance creation time.
ash_ my hyper op might be wrong there
jnthn >>.
pmichaud ash: >>.
ash_ ah, yup thought so 19:25
i keep forgetting to do >>. or do .>> for whatever reason
masak loliblogged! use.perl.org/~masak/journal/40431
jnthn lol
lue can anyone mind checking this, and seeing what I got wrong? gist.github.com/460851
masak (kind of a long one today. I was on a bus and got bored.) 19:26
has a happy ending, though. :)
jnthn Glad you were able to keep busy somehow. ;-)
masak :)
pmichaud lue: I would put := in with assign.pir 19:28
actually, scratch that.
:= has to go into the setting.
because there are other entries for := already in the setting.
19:29 patspam left
PerlJam I guess that's why I asked for a spec ... I don't really understand INHERIT :) 19:29
lue wonders where the setting is.
pmichaud src/core/operators.pm
PerlJam COMPOSE makes some sense though 19:30
masak PerlJam: neither of them are actually in the Spec. :)
ash_ PerlJam: gist.github.com/392673 is kinda how i thought it would work
PerlJam ash_: that illustrates the what, but not so much the when. 19:31
ash_ ah good point
lue ah. well, that's why I was asking about checking for a variables rw-ness using P6! I thought of putting it there. :) 19:32
PerlJam It seems like INHERIT and COMPOSE are just special cases of "class definition time"
and should they fire before or after the body of the class has been processed? 19:33
(I'd say before)
masak std: class A { is Int } 19:34
p6eval std 31529: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'is' used at line 1␤Check failed␤FAILED 00:01 111m␤»
pmichaud masak: nice post. fwiw, I decided a few days ago that Rakudo's implementation of &circumfix:<{ }> is incorrect, since it assumes hash.
masak hm, guess one has to specify in the header what the parents of a class are.
pmichaud: sounds like it should assume closure, yes.
at least from the spec. 19:35
it's a "closure-until-proven-hash" thing.
pmichaud masak: if it exists at all. :-)
lue I really don't want to fill the entire infix:<:=> sub in the setting with a giant Q:PIR block .oO(all those labels...). Hrm...
pmichaud but yes, closure-until-proven-hash.
lue: you're doing far more work in := than needs to be done, I think.
masak pmichaud: in what cases does it not exist at all? :)
19:36 patspam joined
pmichaud lue: for one, it's not necessary to check on STORE 19:36
masak S12:143. TimToady ^
jnthn pmichaud: Hmm...
masak TimToady: either S12 or STD.pm6 should be updated :)
lue Well, admittedly, I just transcribed most of it from assign.pir....
jnthn pmichaud: It seems that we don't know how to handle get_pmc_keyed on a Perl 6 Array. 19:37
pmichaud anyway, I think we got rid of the notion of "is Foo" being accepted inside the class body.
jnthn pmichaud: Can we make it do so?
pmichaud: I'm hitting it where NQP code encounters a Perl 6 object and then cries. :-)
er, a Perl 6 Array
pmichaud jnthn: if you just want to have it forward to postcircumfix:<[ ]>, I'm okay with that.
much easier now that postcircumfix:<[ ]> takes a single argument, too :)
jnthn pmichaud: Should I do it just for Array for now?
pmichaud: Or put it in Mu.pir with the others and see what that does? 19:38
pmichaud you could do it in List.
jnthn OK
pmichaud I'm not sure if it'll survive in Mu.
it's very likely to end up in Any.
jnthn Me either
19:38 pyrimidine left
pmichaud In fact, I'm thinking that postcircumfix:<[ ]> in general is likely to move out of Positional and into Any. 19:38
ash_ what would Positional imply then? 19:40
pmichaud bindable to @-sigil
ash_ ah, thats useful 19:41
tylercurtis masak: very awesome paragraph: "Or like me coming to visit you, but instead of leaving my phone number, I activate one half of an entangled-pair portal in your living room and take the other half with me." 19:42
19:43 meppl left
pmichaud masak: speaking of TheDamian, I have a shiny new implementation of IO::Prompt for rakudo that he'd like to contribute to the pool of modules. 19:44
masak pmichaud: nice!
pmichaud masak: what's the best way for me to go about making that available? (My proto-fu is very low, although I expect to raise it in the next week)
masak there's one in there already, I think.
by, hm, omega?
pmichaud ....probably not like this one. :)
masak probably not. :) 19:45
but the issue of name collision still arises.
jnthn :auth<TheDamian>
masak theoretically, yes.
jnthn ;-)
Rakudo can take it. :P
masak pls can't, yet.
jnthn oh pls!
masak neither can proto, afaik. 19:46
pmichaud let me see if it's IO::Prompt or IO::Prompter
Damian changed the name of his p5 module to IO::Prompter
so perhaps the p6 module is the same.
masak that'd help.
masak hopes to have :auth working soon-ish in pls.
pmichaud IO::Prompter 19:47
\o/
masak \o/
jnthn just gave masak++ a round tuit ;-)
masak jnthn: tack :P
jnthn The joy of meatspace
tylercurtis masak: the mention of "infix:<||>" in the bit on implicit closures shows up as "infix:". 19:48
masak ooh, moritz_++ already redirected proto.perl6.org -> modules.perl6.org \o/
tylercurtis: thanks, fixing.
pmichaud gist.github.com/461824 # a taste of what IO::Prompter can do 19:49
masak tylercurtis++: fixed.
pmichaud: whoa. 19:50
pmichaud so, in this instance it prompts for an amount (must be numeric), a rate (must be 0..1), a term (must be int), and a description (must be non-empty)
when it's able to fill in all of the params, it executes the block.
The prompt says "Enter an amount: ", "Enter a rate: ", "Enter a term: ", etc. 19:51
which it gets by introspecting the signature of the block :)
_sri kraih.com/tpf-clean-sri.png # cleaned up
masak jnthn++ # TheDamian's module rests a lot on siggie introspection
jnthn So does Zavolaj. 19:52
;-)
masak pmichaud: we just figured out all you just described :P
sri_++ # TPF logo
ash_ jnthn: btw, my nci changes are almost done, so... if those are all figured out then you can build any signature (in theory) with libffi dynamically 19:53
pmichaud anyway, the module needs cleaning up for rakudo master branch
I guess I'll just stick it in a github repo and see who comes to fork+fix :)
lue gets visions of CPAN6... 19:54
pmichaud now then, let's see how badly I've broken spectests in my branch
jnthn pmichaud: List.pir: 19:55
(It's temporarily named "List" to avoid conflict with existing
List classes while we convert to the new list model.)
Fossil?
pmichaud fossil.
jnthn I'll donate it to a museum.
pmichaud it was temporarily named "Lyst", but then I did :1,$s/Lyst/List/g :-)
masak told ya! :)
pmichaud I still need to go back and add copious comments and documentation to the files. 19:56
masak .oO( the hackathon is wonderful, with y'all were here )
pmichaud who's there?
masak hm, let's see...
there's jnthn...
and me...
that's it. :)
PerlJam sounds like that's more than enough :)
pmichaud EIWANNABEINEUROPE
reminder: Rakudo hackathon in Pisa on August 3 19:57
masak ah, a region-dependent error message. :)
ash_ pmichaud: don't we all...
PerlJam ash_: I don't!
pmichaud argggh, fails.
I wonder if those are closure fails.
jnthn looks forward to having closure on those 19:58
lue How do I get variables passed to a sub into a Q:PIR block?
masak .oO( come closure... )
PerlJam lue: find_lex('$var')
lue ah. dankon.
masak nedankinde!
ash_ PerlJam: well, europe is the one continent i haven't been to... (and Antartica...)
jnthn find_lex '$var'
$P0 = find_lex '$var' 19:59
PerlJam yeah, what jnthn said
I never seem to be able to remember specifics
ash_ rakudo: my $a = 3; Q:PIR { .local pmc a␤ a = find_lex '$a' ␤ say a }
p6eval rakudo 3d2cb8: OUTPUT«3␤»
20:00 pmurias left, Schwern left
masak rakudo: sub foo { Q:PIR { .local pmc foo␤ foo = find_lex '&foo' ␤ say foo } }; foo() 20:00
p6eval rakudo 3d2cb8: OUTPUT«foo␤»
masak huh.
lue thinks of the day when you can write assignment and binding in pure P6... 20:01
masak lue: you can in Yapsi :) 20:02
and in Rakudo alpha.
and in Pugs, probably.
jnthn rakudo: class Foo { has $!x; has $!x; } 20:03
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Can not re-declare attribute $!x at line 11, near "; }"␤»
lue multi sub infix:<=>($a, $b) { $a = $b;}; :)
20:05 Schwern joined
jnthn rakudo: class Foo { has $.x is readonly; } 20:05
p6eval rakudo 3d2cb8: ( no output )
lue grr, same error as before. :(
masak arnsholt: ping
lue for some reason, := refuses to be coded. :=( 20:06
jnthn :=( 20:08
pmichaud rakudo: sub foo($x) { -> { say $x } }; $b = foo(3); $c = foo(4); say $b();
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/41FiSL3ERJ:11)␤»
pmichaud rakudo: sub foo($x) { -> { say $x } }; my $b = foo(3); my $c = foo(4); $b();
p6eval rakudo 3d2cb8: OUTPUT«4␤»
lue here's the line (in src/gen/perl6-actions.pir) that always causes a failure: 20:09
.const 'Sub' $P7022 = "286_1277921755.74026"
pmichaud that's not the line causing a failure.
masak pmichaud: so, when's IO::Prompter coming online?
:)
pmichaud masak: later tonight, I guess.
masak \o/
pmichaud once I've done closing closures.
masak \\\ooo///
colomon \o/
jnthn masak: Shall we stay up and wait for IO::Prompter? ;-) 20:10
pmichaud hint: "No."
jnthn ;-)
pmichaud it may be very late tonight.
masak jnthn: that's Texan "tonight" o.O
lue the problem is, it just _happens_ to be in generated files the problem occurs in /o\
masak jnthn: it's probably later than most other "tonight"s :P
jnthn And bigger.
lue (methinks it's not my bind code anymore)
masak jnthn: and in ASCII.
pmichaud lue: the line numbers reported for errors in PIR are generally not correct.
lue that's just *better*! :=) 20:11
masak by the way, for those who are following the pls saga: over Thai food, jnthn++ suggested that I change the build semantics for project dependencies -- right now, things work in lockstep, building everything before running tests, etc. jnthn suggested doing like CPAN: installing all deps before building the dep-ing project. 20:12
so I'll refactor pls to do that now, if no-one protests loudly.
lue well then, you only hear silence from IRC :) 20:13
masak for some definition of 'silence' :) 20:14
pmichaud what if someone other than "no-one" protests? ;-)
20:14 jnthn is now known as no-one
no-one I protest! 20:14
20:14 no-one is now known as jnthn
pmichaud proceed if none(@perl6) ~~ *.protests 20:14
masak jnthn: right, I'll just go ahead then. 20:15
pmichaud can I protest later if it doesn't work out? ;-)
masak pmichaud: absolutely. :)
pmichaud: wow, junctions, smartmatching *and* a whatever closure. and the brain parses it instantly! scary! 20:16
20:17 rv2733 left
jnthn std: my @perl6; proceed if none(@perl6) ~~ *.protests 20:18
p6eval std 31529: OUTPUT«ok 00:01 114m␤»
masak oh, and 'proceed' too! that's a code flow exception.
pmichaud :-)
jnthn Wow, soon most English will be easily translatable to Perl 6.
masak I know! let's make a poem, and call it "Black P..." oh wait
20:18 timbunce left 20:19 timbunce joined
lue Perl 6 already has more pronouns than English! 20:19
(just look at %_)
dalek ecza: 1729265 | sorear++ | (2 files):
Implement my class Foo { ... }
masak lue: just like "operators are akin to prepositions", eh? :P
lue $_ doesn't matter, I'm not one of @_. However, %_'s a good thing. 20:20
pmichaud locally:
> sub foo($x) { -> { say $x } }; my $b = foo(3); my $c = foo(4); $b();
3
jnthn <3 20:21
lue (oh hell, now what do we call &_ ? aaah! *hair pull*)
pmichaud mostly I've been refactoring and ripping out code
masak lue: also, what would you call ::_ ? and $^_ ?
pmichaud I don't think I added anything new.
lue .u stop
phenny U+002E FULL STOP (.)
pmichaud I love it when fixing bugs makes code smaller. :-)
lue .u octogon
phenny lue: Sorry, no results for 'octogon'.
pmichaud .u octagon
phenny pmichaud: Sorry, no results for 'octagon'.
masak pmichaud++ # apparently removing the right code :) 20:22
.u stop in the name of octagon
phenny masak: Sorry, no results for 'stop in the name of octagon'.
jnthn If we remove everything, there won't be any bugs, just not yet implemetned stuff.
lue well of course, that's because you sweep bugs out of the corner, freeing space.
jnthn ;-)
masak jnthn: that'd be AWESOME.
lue .u glome
phenny lue: Sorry, no results for 'glome'.
masak jnthn: think of the potential!
jnthn masak: Like in the early days, when we could boast NO FEATURES! 20:23
It was so zen!
pmichaud this is not "sweeping bugs out of the corner". This is reimagining the world in which bugs simply do not exist in the first place. :)
masak jnthn: a fresh start! a... a redesign!
pmichaud: now I'm scared :P
lue Absolutely nothing in Rakudo comes without surprises! ;)
jnthn So you re-wrote Rakudo in Newspeak?
pmichaud lue: that's for sure. "Null PMC" is nearly always a surprise.
masak lue: absolutely nothing in Rakudo comes without the lack of multple negations... NOT! 20:24
alester Null PMC droppin' the phat beats.
pmichaud "nearly nothing..." :-)
lue
.oO(PMC is P6's version of the devil)
masak jnthn: Gilead Bracha has a programming language called Newspeak.
lue "why did my copy of rakudo have to die()? Curse you PMC!!!!"
pmichaud runs a spectest.
masak s/Gilead/Gilad/ 20:25
pmichaud jnthn: what's the purpose of the 'proto' property on Code objects? 20:26
jnthn pmichaud: It's how the multi-dispatcher knows "this is the proto"
pmichaud: But protos will change epicly in a bit
pmichaud could that be done with an attribute instead?
jnthn Probably - it dates back directly to the days when we din't have wrappers, fwiw. 20:27
But don't waste tuits on cleaning it up unless it helps you otherwise. (more)
spec changes mean protos need to also change a lot.
pmichaud okay, won't waste the tuits unless I need to then. 20:28
jnthn And be much more than "just a flagged routine"
PerlJam rakudo doesn't autovivify multi-level data structures yet, does it? Like my @a; @a[3][5] = 7; 20:30
pmichaud PerlJam: that's next on my list. 20:31
I need closures to work first.
PerlJam ah, pmichaud++
pmichaud because those get done by my $x but WHENCE({ ... })
and that closure in the WHENCE needs to capture the right values.
20:32 bjarneh joined
pmichaud basically: 20:32
my $x but WHENCE({ self.defined || &infix:<=>(self, Array.new); pir::set__vQiP(self!fill, $pos, $x); }); 20:33
which creates the array if needed and then binds the element :-)
lue (would 楽土's API outline just about every method in src/ ?) 20:34
20:35 Trashlord joined 20:37 Improv joined
jnthn er, that pir::set ? v? 20:38
sorear void 20:39
std: sub &* { ... } # What does this mean?
p6eval std 31529: OUTPUT«ok 00:01 110m␤»
PerlJam every time I see pir::foo__xxxxx(...), I wish it were nqp::foo(...) now 20:40
lue
.oO(every time I see pir in .pm files, I wish it weren't there) :)
PerlJam lue++
jnthn erm, yes, but the set opcode doesn't have a void variant? :S
sorear it doesn't need one 20:41
set__vQiP resolves to set__p_i_p 20:42
Improv Is this the best place to get some very basic perl6 help? (know p5, starting to learn p6 syntax)
sorear yes
pmichaud set__vQiP translates into set $P0[$I1], $P2 20:43
PerlJam Improv: certainly
pmichaud it's "void" because it doesn't allocate a new register for the result.
sorear pmichaud: is Q new? I can't find it in my checkout
pmichaud it's new-ish, yes. I added it sometime early last week.
jnthn pmichaud: oooh!!!
That was WANT for ages 20:44
Is it doc'd somewhere?
pmichaud in the past sources, yes. :) 20:45
Improv When I do fpaste.org/ZQcI/ I get a get_pmc_keyed not implemented in class '' error
pmichaud Q indicates a keyed pmc, the letter that follows identifies the type of key
Improv Thing is, I am closely following examples I found on the web
pmichaud so we also now have pir::exists__IQi
jnthn pmichaud: ohawesome :-) 20:46
pmichaud which translates to $I0 = exists $P1[$I2]
PerlJam Improv: not sure the "Array of Int" bit is implemented yet.
pmichaud Array of Int _was_ implemented, but it broke when someone merged in the new list/iterator improvements.
it needs to be fixed again.
Improv Aha. Good to know. 20:47
pmichaud if you get rid of the "of Int" it will likely work out okay.
PerlJam Improv: my Int @bar; should work.
pmichaud fsvo of "work"
PerlJam oh, maybe not
pmichaud at the moment I don't believe it actually typechecks the values.
Improv Actually, providing any type at all causes it to break
PerlJam my @bar; then :)
Improv but removing the type works 20:48
pmichaud correct.
masak makes a voiceless alveolar lateral fricative
lllllhhhhh!
jnthn Also note that my Array of Int @bar probably doesn't mean what you want it too.
PerlJam masak: I thought you said it was voicelesS?
Improv Ok, good to know it's not something stupid I'm doing and is a rough edge in the language
masak PerlJam: ... ... !
jnthn masak is decidedly not voiceless :P
pmichaud rough edge in the implementation, yes.
Improv jnthn: Oh, does the type of an aggregate apply to all members of the aggregate rather than describe the aggregate itself?
pmichaud Improv: correct, 20:49
so my Array of Int @bar; means that @bar contains Arrays of Int
Improv Gotcha.
pmichaud (since @bar is already an Array)
while my Array of Int $bar; would constrain $bar to being an Array of Ints
PerlJam Improv: are you aware of the Perl 6 book?
tylercurtis You can do my @bar is Array of Int for something closer to my Array of Int $bar, right? 20:50
Improv PerlJam: No - wasn't sure the language was at a state yet where it'd be good to buy books about it yet
20:50 ashleydev_ joined
jnthn Improv: It's just a PDF for now, so no expense or risk to trees. ;-) 20:51
github.com/perl6/book/
Improv jnthn: Cool - where can I snag that baby?
PerlJam Improv: it's not a book you buy yet, but it is on github. You might check it out and give us some feedback from someone who's trying to learn the language.
Improv Nice, thanks
pmichaud waits for the spectest run to finish....
Improv I can give you feedback from an experienced-but-weird perl5 programmer :) 20:52
20:52 ashleydev left, ashleydev_ is now known as ashleydev
pmichaud We like feedback. 20:52
jnthn We like weird.
pmichaud Some of us even stick microphones directly in front of speakers in order to produce more feedback.
masak We like Perl 5 programmers!
Improv Actually it was very jarring needing a space before () in my elsifs
that is highly irritating
pmichaud you don't need the parens.
masak Improv: did you get an informative error message? 20:53
pmichaud it becomes much less irritating when you don't need the parens at all :-)
Improv Parenths make me happy
masak Improv: it'll pass :P
pmichaud you can keep the parens, yes.
masak Improv: we don't mind forcing people into new habits, but we like to do it nicely if we can :)
Improv When I don't have the space, it tells me "unable to parse blockoid, couldn't find final '}'
pmichaud but you do need that space. Otherwise Perl 6 thinks you're wanting to call the elsif(...) function.
yeah, I need to fix that error message.
masak std: if 42 { ... } elsif("OH HAI") { ... } 20:54
p6eval std 31529: OUTPUT«===SORRY!===␤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/IxDXST3gPj line 1:␤------> if 42 { ... }⏏ elsif("OH HAI") { ... }␤ expecting statement_control␤Parse failed␤FAILED 00:01 108m␤»
pmichaud btw, just as a head's up, I'm expecting that we'll have monthly Rakudo Star releases for the first few months after July 29.
Improv Anyone who would write a function called elsif() is probably making an entry for the obfuscated perl contest
pmichaud Improv: we just have a general rule that anything immediately followed by parens is a function call. 20:55
Improv That's fair - makes writing the parser easier I'm sure
masak ...except when it isn't.
Improv I'll get used to it
pmichaud writing the parser is basically impossible without it. :)
PerlJam Improv: it's not so much about the parser as it is about keeping things regular for the programmer
pmichaud PerlJam: it's about the parser, too. :)
Improv PerlJam: Perl5 was fine without the need for that space
masak std: sub foo($a) {} # this is not a function call...
p6eval std 31529: OUTPUT«ok 00:01 109m␤»
lue rakudo: say 3 + #`(comment!) 3 20:56
p6eval rakudo 3d2cb8: OUTPUT«6␤»
lue :D
PerlJam pmichaud: sure, but the rule is all part of the regularization of Perl that makes it easy for the humans.
er, easier
Improv although language features have always been easily confused with method calls in C-family languages
[particle] perl 5's parser is not sane.
jnthn ash_: Any work on callbacks in with the NCI goodness? :-)
Improv particle: True. It is lovable despite that.
20:57 ashleydev left
PerlJam perhaps I just like to look at Perl 6 through the lens of a human eye rather than a machine eye ;) 20:57
pmichaud is it just me, or does T::H 3 no longer tell you how many tests you actually failed?
masak Improv: in many languages, one can do $object #`(note the space here) .method
Improv: not so in Perl 6.
ash_ jnthn: on 64 bit computers it works fine, passes all the nci tests, even compiles rakudo
i have a problem on 32 bit computers i am fixing now
Improv Oh, hey, why doesn't perl6 complain then about if() ? It's only upset about elsif()
masak rakudo: if()
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Missing block at line 11, near ""␤»
pmichaud Improv: implementation bug.
std: if() 20:58
masak submits rakudobug
p6eval std 31529: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'if' used at line 1␤Check failed␤FAILED 00:01 107m␤»
masak heh.
Improv pmichaud: ..... Ok.. somehow this is amusing
masak another one of those preferably turn-off-able warnings.
pmichaud masak: sure, you can turn off the warning by declaring if. :-)
masak worksforme. 20:59
pmichaud std: sub if() { "you say so"; }; if();
20:59 javs joined
p6eval std 31529: OUTPUT«ok 00:01 109m␤» 20:59
PerlJam Improv: btw, in case you missed it. Jul 29. Rakudo Star. An early adopter distribution of Perl 6 built on Rakudo
masak pmichaud: no, I meant if it had warned against if() there.
Improv Hmm. There are a LOT of code samples on the web with if()
PerlJam blames pugs!
Improv PerlJam: so maybe it's premature for Redhat to have started shipping perl6?
pmichaud no, not premature. 21:00
open source is all about recognizing that some products get released before their complete.
Rakudo Star falls into that category.
*they're
hmmm... quite a few fails in spectest but overall not too bad.
afk, commuting 21:01
pugssvn r31530 | jnthn++ | [t/spec] Test that is readonly on an attr overrides a class-wide is rw.
Improv Umm... so.. I imagine there's little chance of convincing you to .. err.. extend the if() bug so that elsif() works too? ^_^
masak jnthn: nice!
PerlJam Improv: very little :)
Improv: so ... you're using a redhat supplied rakudo and didn't build it yourself? 21:02
Improv PerlJam: Yeah - last time I built it myself was maybe a year or so ago and it didn't do a lot
ash_ what version is it? do you know? 21:03
PerlJam heh, I was just about to ask that
Improv rakudo-0.0.2010.06_2.5.0.x86_64
masak Improv: I urge you to try without the parentheses for a week or two, see if you get used to it. mberends said in a talk once that people -- even those who resist at first -- usually come back and say "ok, without is actually nicer"
PerlJam oh, not too old even
ash_ ah, thats pretty recent, i didn't know people were already distributing packages for it
sorear Improv: the parser engine rakudo uses doesn't implement longest-token-takes-precedence lexing very well yet
Improv PerlJam: They've been dropping new versions into their yum repositories fairly often
PerlJam redhat++ (for a change)
sorear \w+( function call is supposed to take precedence over if syntax, always 21:04
Perl5 worked because elsif was a keyword in Perl5
Improv masak: Not a lot of chance of that - I preferred parentheses in Perl5 fairly often when unnecessary - helps me read my code
masak Improv: what sorear said. Perl 6 basically has no keywords.
sorear Perl6 has no keywords and no distinct lexer; the language is specified using a regex 21:05
PerlJam heh
sorear this makes extending the Perl6 grammar much easier, since you can do it with regexes
masak Improv: I do that too. but in the case of 'if' statements et al, I prefer to adhere to Perl 6 convention, which is definitely sans parens.
lue afk
masak sorear: and not only regexes, but OO regexes! o.O
multi-dispatching inheriting LTM goodness! 21:06
Improv masak: I'll consider it, although given that I am a firm believer in Whitesmiths coding style, I'll probably never fit into Perl6 convention entirely :)
PerlJam if you read "the language is specified using a regex" and the only regex you've used are non-perl6 that will seem nigh impossible :)
ash_ rakudo: sub if { say 'got ya' }; if(2); 21:07
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Missing block at line 11, near ";"␤»
jnthn ash_: OK, great. Will it allow general callbacks?
ash_: 'cus before Parrot only allowed them with certain magic signatures
tylercurtis PerlJam: which is why it's probably a bad idea to tell Perl 5 programmers that Perl 6's grammar is specified as a regex.
It might scare them away.
ash_ not yet, with libffi i could allow any signature for callbacks, but for now (and until the end of the GSOC) i am not woking on callbacks just yet 21:08
Improv Perl5 programmers are not likely to be scared by regexen
PerlJam commute &
tylercurtis Improv: Not even regexen complicated enough to parse Perl? 21:09
jnthn ash_: OK
sorear Perl5 programmers are likely to be scared away by the concept of a 4,000 line regex
jnthn ash_: I think mberends++ would really like them. ;-)
Improv tylercurtis: Love of regexen is a big part of why Perl5 programmers use perl
jnthn ash_: Since it opens the way to GUI dev. ;-)
21:09 Su-Shee left
sorear Personally I'm scared by 1,000 1-line perl5 regexes 21:09
ash_ jnthn: ya, i want to get them working, but for now, i am busy enough with the other parts of my GSoC, but they are completely in the realm of possibility, I just don't have time yet to do them 21:10
Improv That, and being people who like being courted by Scheme and ObjC at the same time ;)
tylercurtis would probably have been terrified if he had realized that Perl 6 is parsed by a regex before learning about Perl 6 regexes. 21:11
ash_ sorear: thankfully grammars help that, hopefully one day you won't see 1,00 1-line regexs, just grammars
tylercurtis But then, I've not programmed much Perl 5.
Improv tylercurtis: Did you do much with the /x modifier to regexen?
jnthn ash_: OK, great. 21:12
Improv If you have to do something very long, /x allowed you to use whitespace and comments in your regex, letting you break it apart and document it
jnthn Improv: It's the default. 21:13
ash_: out of interest, what was the other half of your grant beyond NCI?
I remember reading it, but my memory is like a sieve. :-)
ash_ a runcore based on the llvm that compiles parrot bytecode into native code or JIT's it
Improv Thanks for the help all - I'll take a look at the Perl6 "book", and I'll look forward to that preview release too. 21:14
sorear Google thinks it's possible to write a JIT for Parrot in 1.5 months?
tylercurtis Improv: I've not done much Perl 5. And outside of rules(where whitespace is turned into \s+(or something similar), Perl 6's regexen allow whitespace by default.
sorear That's crazy talk.
21:15 Improv left
ash_ sorear: i am not writing the jit, the llvm already has one 21:15
i just have to translate parrot byte code into llvm byte code, which is not as scary as it sonuds
sounds*
sorear ash_: llvm provides a IR -> x86 JIT, you need to write a PBC -> IR JIT 21:16
yes that
jnthn You oculd probably get a good start and a performance win by even being able to JIT branches and leaving everything else to be JITted as a function call to the op sub, mind. 21:17
And slowly work from there.
sorear How would just branches help? 21:18
(We are talking about branch_eq et al right?)
[particle] sorear: google thinks tpf's mentors who voted on the proposal think it's worth funding the opportunity for a student to attempt the project
jnthn sorear: The control flow is probably the only thing you can't easily just do as function calls.
sorear phenny: ask TimToady What does sub &* {} mean?
phenny sorear: I'll pass that on when TimToady is around.
jnthn Well, maybe that's not totally true, but... :-) 21:19
It's where I'd start, anyway.
21:20 Schwern left
jnthn std: sub &* {} 21:24
p6eval std 31530: OUTPUT«ok 00:01 110m␤»
jnthn ew
rakudo: sub &* {}
p6eval rakudo 3d2cb8: OUTPUT«===SORRY!===␤Confused at line 11, near "sub &* {}"␤»
jnthn So am I. ;)
21:24 tadzik left
pmichaud back again 21:27
jnthn rakudo: role Foo { }; subset Bar of Foo where 42;
p6eval rakudo 3d2cb8: ( no output )
masak rakudo: role R {}; subset S of R; 1 ~~ S
p6eval rakudo 3d2cb8: OUTPUT«Null PMC access in invoke()␤ in 'ACCEPTS' at line 1␤ in 'infix:<~~>' at line 322:CORE.setting␤ in main program body at line 11:/tmp/cQRWsJjdsN␤»
21:29 ashleydev joined
dalek kudo: 4715825 | jonathan++ | src/builtins/List.pir:
Support get_pmc_keyed_int in List so we can has interop with Perl 6 arrays and
21:31
kudo: ac5e926 | jonathan++ | src/core/traits.pm:
Implement trait_mod:<is> for rw on packages. Not checked for yet.
kudo: 085fac8 | jonathan++ | src/builtins/List.pir:
Remove a fossil.
kudo: dbde7cf | jonathan++ | src/metamodel/ClassHOW.pir:
Under-construction class type objects should at least be able to say they're
kudo: 7dbad1c | jonathan++ | src/Perl6/ (3 files):
Do not assume that lack of is rw on an attribute means no accessor, and

is specified, and to look to any provided default. Also, a little re-ordering of metaclass code gen.
kudo: fdf7bb9 | jonathan++ | src/metamodel/Attribute.nqp:
If the attribute doesn't explicitly have rw or readonly specified, fall back and
kudo: f9e5226 | jonathan++ | src/metamodel/Attribute.nqp:
Unbreak attribute introspection for .rw.
kudo: 7017d2b | jonathan++ | t/spectest.data:
Turn on S12-class/rw.t.
saaki golly
masak jnthn++ # commit flood troll!
jnthn And that's *before* I open a beer! 21:35
pmichaud ooooh, one small fix and a lot of the failing tests are passing again. :-) 21:36
ah, here are some failz
21:40 Patterner left
colomon woah, that's a lot of patches! 21:44
21:45 constant left 21:50 ciphertext joined, ciphertext_ left, Psyche^ joined, Psyche^ is now known as Patterner 21:52 meppl joined 21:55 constant joined, constant left, constant joined 21:59 cdarroch left 22:01 Improv joined
Improv Hey, are there nightly builds of the perl book? 22:01
22:03 masonkramer left, masonkramer joined 22:04 Ross left
Improv Turns out if I want to have Pod-PseudoPod-LaTeX 1.1x, I need a newer version of Module::Build and if I want that I need to remove Perl itself (yay horrible dependencies) 22:05
22:05 Schwern joined
Improv and I can't build the Perl6 book without that 1.1x version of Pod::PseudoPod::Latex 22:05
sorear Don't use system package managers to install perl modules ever. 22:06
Improv sorear: These were already installed.
I can't remove Module::Build without removing my Perl5 22:07
sorear Don't remove Module::Build then
cpan -i Module::Build
Improv Soooo just overwriting my old one?
sorear cpan -i Pod::PseudoPod::LaTeX
no
cpan installs into /usr/local
tylercurtis alternately, download one of the released versions of the book. 22:08
github.com/perl6/book/downloads
sorear shadowing your old one, as it were
Improv That sounds much simpler.
Ahh, especially given that I get a LaTeX prompt when running make now. 22:09
tylercurtis On a related note, are there still plans for a printed version for Rakudo *?
Improv err.. a TeX prompt.. 22:10
Thanks again. Bon soir. 22:11
22:11 Improv left 22:13 gbacon left
masak tylercurtis: yes, I think so. I don't think the book is ready enough to ship in time for R*, though. 22:16
22:16 alester left 22:22 jeir joined 22:23 jeir left
sorear Niecza is now capable of end-to-end operation 22:25
start with Perl 6 code, run it through a subclass of STD with special glue-coding extensions, convert to niecza-ast with action methods, convert that to C#, compile, run 22:26
all that's left is features
dalek ecza: 69dbc62 | sorear++ | (5 files):
Implement subs in actions system
ecza: 2f77be0 | sorear++ | (2 files):
Switch Makefile to using the new parser!
22:27 javs left
masak sorear: wow, cool! 22:27
jnthn Nice :-)
masak sorear: so, which features will you be focusing on?
sorear next I'm going for the object system 22:28
1. unbreak classes 2. implement methods 3. implement single inheritence 4. implement Any, Mu, and Cool 22:29
after that comes numerics (2+2), and control flow
I'm still behind yapsi in a couple ways...
masak heh. with the current Yapsi development speed, we might see OO stuff in Yapsi this time next year :)
Yapsi doesn't have 2 + 2 yet either. 22:30
I'd love it for Yapsi to have a STD backend.
sorear s/back/front/?
jnthn Isn't STD more of a frontend?
tylercurtis masak: You have if, though. And --.
masak oh yes. frontend. 22:31
masak is so tired he's thinking backwards :)
tylercurtis: the ++, -- and 'say' constructs are faked for now so that there's something to test. they will all be replaced when we have real subcalls.
pmichaud jnthn: ping 22:32
jnthn pmichaud: p0ng 22:33
tylercurtis masak: I know. But it's something, nevertheless.
masak tylercurtis: yes, I'm surprised it's come this far, actually. and the PR seems to work well, too :) 22:34
24 downloads in as many hours!
pmichaud jnthn: can you help me understand the package-scoped code at Perl6/Actions.pm:1138 ?
jnthn maybe ;-)
jnthn checks
pmichaud specifically the multi part of it
sorear masak: hah. Right now, real subcalls are about /all/ niecza has 22:35
jnthn pmichaud: Starting "# Otherwise, package scoped; add something to loadinit to install them." ?
pmichaud yes.
sorear incl. closures, protolexpads 22:36
but no signature binder yet. you have to drop down into NIL to look at arguments
sub say { Q:NIL { =[0] @ unwrap:String .plaincall/1:Console.WriteLine null:Variable } }
jnthn pmichaud: $symbol_holder is in this case holding the block of the package.
It's just a PAST::Block 22:37
pmichaud: We check if it's a multi-sub
pmichaud: If it is, we need to tweak the code to add the candidates
pmichaud: Essentially we compile to a chain of method calls to a Perl6MultiSub (that each return the P6MS itself) that each add some candidates 22:38
Was just a neat way to do the code-gen.
tylercurtis Aww. It turns out that the cperl-mode.el from the pugs repo doesn't actually properly handle Perl 6 POD.
22:38 Patterner left, eternaleye left, proller left, DemoFreak left, araujo left
jnthn pmichaud: That's the if $symbol_hoolder...chunk 22:38
pmichaud: The rest is just installing the symbol
22:38 rjbs joined
rjbs What's the / twigil for? 22:39
tylercurtis M-x fundamental-mode again I guess.
jnthn Actually @PACKAGE[0].block is $symbol_holder here...
ash_ rjbs: you mean $/ ?
jnthn rjbs: Example? I don't think there is / twigil - do you mean $/
In that case $/ is the match object 22:40
pmichaud $past[0] gets special treatment if it's a multi?
jnthn Right
masak a / twigil would be awesome :)
jnthn pmichaud: More specifically
pmichaud: It gets special treatment if we already installed multis there
tylercurtis masak: for what?
masak tylercurtis: slashing, obviously :)
rjbs I must mean $/
22:40 dimid left, Juerd left, rjbs left, sykes_ left, Solarion left, jnthn left, buu left, yves__ left 22:41 m6locks joined, phenny joined, cxreg joined, frodwith joined, wolverian joined, Woody2143 joined, zachy joined, lest_away joined, ingy joined, meteorjay joined, araujo joined, proller joined, DemoFreak joined, eternaleye joined, Patterner joined, rjbs joined, dimid joined, Juerd joined, sykes_ joined, Solarion joined, jnthn joined, buu joined, yves__ joined, farmer.freenode.net sets mode: +voo phenny ingy jnthn, pmichaud_ joined
pmichaud_ jnthn: okay, here's the problem I'm facing. 22:41
If we have:
jnthn STD can also do that for you if you can get that running
rjbs hanks!
^T
pmichaud_ package XYZ {
rjbs I have Rakudo. 22:42
pmichaud_ our sub abc() { ... }
}
we have to bind XYZ::&abc twice
we bind it once at startup, as now
jnthn &XYZ::abc ?
pmichaud_ we have to bind it again, when the package block executes
jnthn Oh?
pmichaud_ Yes.
at the beginning of the package block, all of the nested blocks get recaptured 22:43
jnthn Rationale?
Ah.
pmichaud_ and the existing &XYZ::abc will be pointing to the wrong block.
jnthn Ah...I'm starting to see
pmichaud_ (this is also explicitly mentioned in S04, btw :) 22:44
jnthn So we need to emit two things?
pmichaud_ yeah, something to create the code object at loadinit
and something to create another one at the beginning of the package block
masak pmichaud_: where in S04?
pmichaud_ both of them binding to &XYZ::abc when they're created
jnthn OK
Then push the smae thingy onto @BLOCK[0] too? 22:45
pmichaud_ yeah
but I'm not sure how the multi case gets handled.
jnthn Ah
It'd...end up making two Perl6MultiSub objects if you just do that... :S
That's perhaps OK though.
pmichaud_ at this point in the code, what exactly is $past ? 22:46
jnthn pmichaud_: Line 1112 is important to understand this.
pmichaud_: There's two cases. (more)
1) We never created a Perl6MultiSub. In this case we do what's done starting at 1112 22:47
pmichaud_ masak: key text surrounds "At run time, when such a subroutine is cloned, an additional binding is done at clone time to the same symbol table entry that the original was bound to."
rjbs Aha, $/ is the retval of the last regex match.
masak pmichaud_: ah, I think I remember that part. it's near the end.
jnthn 2) We already made one, so we just add the current sub it to the existing PAST node and $past := 0; and then we do nothing later on. 22:48
pmichaud_ jnthn: that feels very ouchie.
Tene I remember having trouble wrapping/replacing a sub from a trait handler a while back. Not sure if it's relevant to what you're working on, though. I was trying to implement "is cached". 22:49
jnthn pmichaud_: How so?
pmichaud_ package XYZ { our multi sub abc() { ... }; our sub def() { our multi sub abc(Int $x) { ... } } }
jnthn Yes, that case is exactly what 22:50
@BLOCK[0].symbol($name, :scope('package') );
Exists to handle.
oh dammit
$past[0] := PAST::Var.new( :name($name), :scope('package'), :viviself($past[0]) );
What ^^ exists to handle
Basically, if we already installed a Perl6MultiSub, add the candidates from this block.
Otherwise, auto-vivify a new Perl6MultiSub PMC. 22:51
*vivify
pmichaud_ here's what I don't see.
when something calls def(), I have to get a new &XYZ::abc
since that's a Perl6MultiSub, I need to have the MultiSub replace that one element. 22:52
22:52 rjbs left
jnthn How's it meant to know which element? 22:52
Is it even the same Parrot Sub?
pmichaud_ it's a clone of the Parrot Sub with a new outer context.
jnthn So how would we link up what it already has with what's meant to replace it? 22:53
pmichaud_ it's okay if we rebuild the entire Perl6MultiSub PMC with the new set of subs
jnthn Or if you're asking "is there an easy way to do that already" then simply, "no"
OK, but how'd we know about the rest of them other than this one?
pmichaud_ well, that's what I was curious about here. 22:54
jnthn I mean, I don't see how you can know which candidate you want to "replace"
That feels...odd.
pmichaud_ but I can know the set of current candidates
so I can build a new Perl6MultiSub PMC from that, I think.
jnthn Yes, but how will you eliminate the one you're "replacing"? 22:55
Or do you mean you statically known them?
jnthn is a bit confused
pmichaud_ I'm confused to, because I don't understand the MultiSub creation code here.
*too
but when we enter def(), we do a capture_lex on its inner abc candidate 22:56
jnthn But capture_lex doesn't make it a different Parrot sub, no?
It only changes its outer pointer?
pmichaud_ correct, it doesn't.
jnthn So why does the Perl6MultiSub need updating?
pmichaud_ because the Perl6MultiSub references a Code object
and that Code object contains a copy of the abc(Int) sub that was in existence at compile time. 22:57
jnthn Right, which references the Parrot Sub which goet capture_lex'd?
pmichaud_ Code objects no long reference the actual parrot sub. They have to reference copies.
22:57 timbunce left
pmichaud_ *no longer 22:57
jnthn OK, but why are they different Parrot Subs?
Oh
They *always* make a copy on creation?
pmichaud_ yes.
that's really what Code.new() means.
jnthn oh ouch
pmichaud_ it means "take a closure"
jnthn OK, *now* I understand why you're finding this painful.
I hadn't really appreciated that you'd changed that. 22:58
pmichaud_ yes, I started out by trying to copy Code objects, but then I realized "Wait. Code.new() really means 'capture a closure'."
it all works _great_ except for this one case.
jnthn The current multi creation code doesn't really help you out here.
It relies on the assumption that's now broken. 22:59
22:59 pmichaud_ left
jnthn ...was it something I said? 22:59
pmichaud I'm still here -- that was my netsplit shadow.
jnthn oh!
I didn't think I'd been that offensive. ;-)
Honestly though, I think we need to re-think the multi creation in light of this rather than trying to patch up what we have. 23:00
23:01 Schwern left
jnthn As for how to do this... 23:01
First, a question. Do we *only* have problems with package-scoped multis?
(lexically scoped ones work OK in the new model?)
23:02 pmichaud1 joined
pmichaud1 argggggh 23:02
23:03 Juerd left, dalek left, PerlJam left
jnthn feather fail? 23:03
pmichaud1 yes, everything but package-scoped subs seems to work.
yes, feather fail.
jnthn OK
23:03 pmichaud left
jnthn pmichaud1: Do you have any way at all to know that two Parrot subs today originally were cloned from the same Parrot sub? 23:04
23:04 hugme left
pmichaud1 I can certainly put one in place. 23:04
jnthn The real tricky thing here is that we can't just re-build the multi.
23:04 Util left, pugssvn left
jnthn Because we need to update *part* of it. 23:04
e.g. some of the subs
And without having a unique way to identify them, that's kinda hard. 23:05
pmichaud1 if the multi knew all of the (original) Parrot subs that were used to create it, could it rebuild from that?
jnthn Only if it can link them back to the things it has now
Something feels very messy here though.
pmichaud1 oh
I think I know the answer.
actually, I'm certain this is wrong, but it might work for now. 23:06
jnthn I mean, we can probably find a way to pick through the candidates and swap out some of them
But...ew. :-)
pmichaud1 I don't understand "link them back to the things it has now"
you mean to the code objects it has now?
jnthn pmichaud1: Are you envisioning that we already ahve a Perl6MultiSub set up and we want to update some of the Code objects in it?
That is, some of its candidates? 23:07
With the capture_lex'd ones we have at the moment?
pmichaud1 let's back up a second
let's say that I have 23:08
jnthn That's probably a good idea. :-)
pmichaud1 my $x = &multi_sub;
and then a bit later I invoke XYZ::def, which causes a new &multisub candidate to appear (i.e., it has to replace one of the originals) 23:09
I'm pretty sure that $x has to continue to refer to the old set.
which means that the symbol &multisub has to be bound to a new Perl6MultiSub object.
we get at that behavior one of two ways 23:10
either we recognize whenever &multisub is being used in an rvalue context, and take a clone of it then 23:11
or we have &multisub be rebound to a new set whenever one of its candidates change
*changes
(more)
so far, we've been fairly successfully avoiding the "copy on rvalue/assignment" behavior for nearly everything 23:12
i.e., assignment simply involves changing a pointer to an immutable value
jnthn (sorry, masak and I were distracted translating beer cans...reading :-)) 23:14
pmichaud1 and what I have now will work fine with package-scoped subs as well
i.e., if I have my $y = &package_sub;
and then later we invoke a scope that rebinds &package_sub, $y still successfully captures the old closure.
jnthn Yes 23:15
But will the re-binding find all the candidates?
I guess yes, it can.
pmichaud1 let me look at the code a second further
jnthn *nod*
pmichaud1 I really think I need to understand the chain
jnthn OK
Let me try and be a bit clearer
There are really 3 cases 23:16
1) We never encountered a multi in this package anywhere yet. In this case we need a new Perl6MultiSub.
2) We have encountered it, but not in this block - maybe due to package augmentation introducing new subs. We bundle the candidates together for this block, but then add them to the existing candidate. This what the lookup handles with that PAST::Var (and the vivify handles case 1). 23:17
23:17 dalek joined, pugssvn joined
jnthn 3) We've encountred other multi candidates in the package block we're compiling, so we just add them to the existing PAST node, which we stuck in .symbol 23:18
Those are the three cases.
Note when I say "in this block" I mean the package block.
The other "fun" we hit is
package foo { multi x() { }; }; augment package foo { multi x($y) { } }; 23:19
That's what (2) is
23:20 dalek left
pmichaud1 ..and that's what 23:20
$past[0] := PAST::Var.new( :name($name), :scope('package'), :viviself($past[0]) );
handles?
jnthn Precisely.
23:20 Util joined
jnthn $past[0] holds a PAST node that instnantiates Perl6MultiSub 23:21
pmichaud1 I understand that this converts $past[0] into a package-scoped variable lookup
23:21 dalek joined
pmichaud1 I don't see where it's previous value gets joined with the existing MultiSub 23:21
jnthn :viviself($past[0])
Oh
pmichaud1 if there's an existing MultiSub, the :viviself doesn't get used.
23:21 PerlJam joined
jnthn $past := PAST::Op.new( 23:21
:pasttype('callmethod'),
:name('set_candidates'),
PAST::Op.new( :inline(' %r = new ["Perl6MultiSub"]') ),
$past 23:22
);
set_candidates actually adds to the existing candidate set.
Rather than replaces it.
So if it finds a Perl6MultiSub that already has candidates, it will add these candidates to it.
pmichaud1 ah, and this is why rebuilding is problematic.
jnthn Right.
pmichaud1 okay, the problem becomes simple then. 23:23
jnthn Thus why I think we need to re-think this a bit.
Just keep in mind that the augment case also has to be handled too.
pmichaud1 no problem.
jnthn OK
pmichaud1 the key to finding subroutine uniqueness is :subid
23:23 bjarneh left
jnthn Do we has that at runtime? 23:23
(I forget.)
If so then yes, it's easy. 23:24
pmichaud1 so we modify set_candidates (which is really "add_candidates") so that it replaces any entity that has the same subid as whatever we're adding.
23:24 bjarneh joined
pmichaud1 Yes, subid is a property of the Sub. 23:24
and clones have the same subid.
jnthn Then it's easy.
23:24 bjarneh left
pmichaud1 (this is how phasers work, btw, to make sure that we don't re-execute the same phaser more than once) 23:24
jnthn OK 23:25
pmichaud1 ...but even better than replacing 23:26
we can make MultiSub "immutable"
jnthn And it makes a new one.
pmichaud1 so that set_candidates returns a new MultiSub with the changes
right.
jnthn wfm
pmichaud1 I don't know if it's worth looking into, but I suspect it also means we could eliminate a lot of multi-construction code in the compiler.
jnthn Possibly 23:27
pmichaud1 i.e., we wouldn't need to keep track of $symbol<multis>
whenever we encounter a new multi, we just call the add_candidate method and rebind.
jnthn It's worth doing that bit just for generating better code, imo
pmichaud1 "better code" in the sense of "less runtime expense"?
jnthn Right
And shorter
pmichaud1 but this would also eliminate the augment problem. :-) 23:28
jnthn We don't have one today afaik. ;-)
pmichaud1 so maybe we do it within a block, but don't worry so much about the case of across blocks
jnthn Right
Oh, we don't try that today
Well, we try within a package
But not over augmented ones 23:29
Anyway, I think we know the way forward.
pmichaud1 correct. I think I can get it from here.
jnthn OK 23:30
The Perl6MultiSub hacking should be simple
pmichaud1 ...and this will mean that things like my $x = &multisub; will work properly too :-)
jnthn There's some really fun code in there but none of it is what you have to change. ;-)
Yes, seems win all around. Hopefully. :-) 23:31
pmichaud1 this model of closure handling is sooooo much cleaner than anything we've had previously. 23:32
jnthn :D
23:35 azert0x left
sorear BEGIN { %foo{now} } := 2; # What should I do in response to this? 23:35
23:35 Juerd joined
jnthn weep 23:36
pmichaud1 jnthn: I might need to switch the $symbol_holder to be block-scoped instead of package-scoped (just like lexicals) 23:37
23:37 ashleydev left
pugssvn r31531 | jnthn++ | [t/spec] Bring a spectest in line with latest method scoping spec. 23:37
jnthn pmichaud1: OK
pmichaud1: If you're doing that just kill symbol_holder
pmichaud1 it will simplify things a lot, and I don't think there's a huge win to be had worrying about 'our multis' nested below the package scope
jnthn since it'll always be the smae thing.
pmichaud1: Yes, in most cases they're in the same block. 23:38
pmichaud1 If we try to do it across the package, then I have to manage the creation of Code objects (which is currently block scoped, to correspond with closure creation) 23:39
so it's easier to manage the multis across the block as well.
s/across/within/
afk, dinner 23:40
jnthn *nod*
23:46 ashleydev joined 23:54 Psyche^ joined 23:58 Patterner left, Psyche^ is now known as Patterner, masak left