Parrot 1.8.0 Zygodactyly released | Latest modified TT's: icanhaz.com/parrotbugs | Parrot Languages: icanhaz.com/parrotlang
Set by moderator on 23 November 2009.
00:06 bogen joined 00:12 kiwichris joined
cotto_work Yay! Short day for me tomorrow. 00:25
00:27 payload joined 00:57 abqar joined
dalek tpfwiki: Drake | PMC Documentation Guidelines 01:40
tpfwiki: www.perlfoundation.org/parrot/index...guidelines
rrot-plumage: 26e322f | japhb++ | :
[METADATA] New tcl-bridge project, vadrer++
01:45
japhb With that commit, Plumage is up to 20 projects in its metadata repo 01:50
w00t!
02:06 cconstantine joined 02:29 JimmyZ joined 02:40 gaz joined
Coke pmichaud: looks like "make test" is dumping a lot of debug output. 02:51
02:51 nopaste joined
Coke ah, found it. 02:52
nqp-rx docs? 02:56
nqp-rx?
purl nqp-rx is github.com/perl6/nqp-rx
Coke tries to find the list of register types that you can use to modify a pirop in nqp... 03:02
nqpdocs? 03:04
nqpdocs is trac.parrot.org/parrot/wiki/NQPDocs 03:05
pmichaud++ # partcl-nqp commits. 03:09
Coke finds the send to the irc log about types and adds it to the wikidocs. 03:11
03:11 nopaste joined
dalek tracwiki: v7 | coke++ | NQPDocs 03:12
tracwiki: trac.parrot.org/parrot/wiki/NQPDoc...ction=diff
03:14 ZeroForce joined
Coke tries to figure out what's wrong with: 03:15
our sub list(*@args) { return @args;
}
purl } is a brace
Coke purl: no, } is <reply> 03:16
purl okay, Coke.
Coke that should take something like list(1,2,3) and return a list with 3 elements, neh?
03:27 brrant joined 03:30 lucian joined
Coke Hey, you know what would be great? if an array stringified to the number of elements in it. :P 03:35
pmichaud: ping.
cotto It numifies to that. 03:37
Coke cotto: it also stringifies to it. 03:39
(which is most unhelpful. =-)
cotto Ah. My sarcasm detector was broken. 03:40
03:42 cognominal_ joined
Coke so writing [list] is trivial, but it's useless. =-) 03:48
can Classes in NQP override parrot vtables? 03:53
pmichaud at present, nafaik 03:57
I've been thinking about doing that
03:57 Andy joined
Coke pmichaud: I need a way to override RPA or use an HLL map so I can get something reasonable on stringification. 03:58
any clues?
purl Dee Dee Dee!
Coke thanks, Carlos.
bogen #646 (const STRING problems) – Parrot <trac.parrot.org/parrot/ticket/646> hmmm.... 03:59
pmichaud well, we can get stuff to appear in a 'tcl' hll namespace
bogen I think I can tackle this
pmichaud and then you could map
er, hll_map
Coke pmichaud: (tcl hll namespace) perfect.
pmichaud (RPA stringification) -- yeah, that's a royal pain.
Coke then I can just use my tcllist class.
pmichaud I keep running into that problem often
Tene pmichaud: i'm converting my scheme compiler over to nqp-rx, and I have a few questions... 04:00
pmichaud 02:51 <Coke> pmichaud: looks like "make test" is dumping a lot of debug output.
...is it still doing that?
Tene: shoot
Coke I didn't push fix yet.
04:00 ZeroForce joined
pmichaud yeah, I might've left some debugging in there. I was trying to get a commit in place before having to leave 04:00
Tene 1) when I use quote_EXPR, I get the delimiters included. Am I doing something wrong, or am I supposed to just pull out the quote_atom directly? 04:01
Coke pmichaud: pushed.
quite alright. =-)
pmichaud Tene: if you stringify quote_EXPR, you get the delimiters, yes.
but if you ask for the .ast, you get the actual string inside the quotes
including automatic conversions of any \\n, \\x, etc.
in other words, ~$<quote_EXPR> is what was parsed
Tene Hmm. I don't think I'm doing that anywhere, but I'll check again. 04:02
pmichaud $<quote_EXPR>.ast is the value of what is parsed
Tene 2) Looks like nqp-rx doesn't use {*} #= key, right? So how do I do setup and teardown for blocks? Converting over code that uses #= begin, #= end. 04:03
pmichaud nqp-rx does still have {*} #= key... it's just not needed. As TimToady++ says -- anywhere that uses {*} is a bit of a design smell
look for #= in NQP's grammar and you'll see it still being used for block setup and teardown 04:04
Tene What's the recommended way to do that?
pmichaud (and afaik that's the _only_ place it's being used)
to do... what?
Tene Eh, I guess I'm asking a bad question. :) 04:05
pmichaud just couldn't reliably map "that" to a concept :)
Tene steme has several action methods that make a new block and push it onto a global @BLOCKS before going through the block, and then pops off afterward. 04:06
pmichaud we still do the same in NQP
eventually I think that global @BLOCKS should be a dynamic variable 04:07
(for re-entrancy into the compiler)
Tene right.
pmichaud in NQP we've also pretty much moved "make a new block" into a single rule -- blockoid
which handles pretty much anything that acts like a block 04:08
oh, wait, that's not it.
Coke pmichaud: any pointers on adding a HLL to partcl-nqp?
pmichaud in NQP we have a special rule <.newpad> that creates a new block
Coke is it just as simple as adding a .HLL directive in the .pir startup?
pmichaud then any rule that needs a new block simply does <.newpad> to push a new block onto @BLOCKS 04:09
Coke: that's the first half
the other half is that the two PAST::Block.new lines in Actions.pm need to have :hll<tcl> added to them 04:10
Tene pmichaud: Looks like my confusion was coming from the method also being called without {*}, so there was no $key in some invocations.
pmichaud Tene: that's correct.
Coke: adding :hll<tcl> will cause any dynamically-compiled blocks to also appear in the 'tcl' hll namespace 04:11
Tene Okay, this should work. :) Thanks.
04:12 cognominal joined
nopaste "coke" at 72.228.52.192 pasted "like this?" (32 lines) at nopaste.snit.ch/18845 04:13
Coke (Parent isn't a Class.
pmichaud oh, ick.
okay, it's not quite that simple. :-( 04:14
the problem being that the PAST:: types aren't in the tcl hll namespace.
(nor should they be.)
in rakudo we work around this problem by importing the PAST types into the Rakudo hll 04:15
that's not a long-term solution 04:16
Ideally I'd like to find a clean (Perl 6 compatible) way to refer to hll namespaces using p6 syntax 04:17
I also think that the compiler grammar and actions probably belong in a hll private namespace
Tene +1 04:18
purl 1
pmichaud but I fear there are a few pieces left to work out between here and there. :|
Tene I've been thinking about that again recently. 04:19
I'm pretty confident I can get there.
Coke ok. In the meantime, I just need to not be using RPA for my arrays. is there a shortcut?
pmichaud not an easy one that I know of at the moment, since RPA's are the default for :slurpy
I suppose we could copy into some other structure, though. 04:20
Tene: I'm more concerned about syntax than mechanics at this point
Tene: I'm guessing we'd need to do something like Hash:from<parrot>
04:21 cognominal joined, cognominal_ joined
Tene pmichaud: we could just import the namespace... use Hash:from<parrot>; 04:22
There's syntax for specifying a different name to install it as locally, just don't remmeber.
pmichaud Tene: that sounds like it should be 'import' instead of 'use', though.
Tene use Hash:from<parrot>:as<ParrotHash>;
Probably.
pmichaud also, "use" probably wants to do a "load_bytecode" of some sort, in general. 04:24
or a "load_module" on a compiler object. 04:25
Coke: if you don't PAST polluting the hll namespace (which it technically already is in partcl-nqp), we could repeat the same trick that Rakudo uses for now 04:26
Tene pmichaud: Yes, and the compiler object is free to do as it wishes. I'd expect the 'parrot' compiler object to look at the Hash namespace, find stuff already there, and just return that.
pmichaud that would get you type mapping.
Tene: maybe. Even so, in the specific case of Hash there's not really a Hash namespace to be imported :) 04:27
although perhaps 'parrot' would be smart/nice enough to give you a Hash protoobject in your namespace :)
nopaste "tene" at 24.10.252.130 pasted "quote_EXPR issue for pmichaud++" (15 lines) at nopaste.snit.ch/18846 04:28
pmichaud s/if you don't/if you don't mind/
Coke (same trick) yes, that's fine for now.
without it, big chunks of partcl will fail.
Tene pmichaud: I'm definitely calling .ast there instead of stringifying the match object, right?
pmichaud Tene: where's the rule that calls it?
Tene: yes, you are.
Coke pmichaud: please +1 on TT #1332 if you like. 04:29
Tene token quote:sym<dblq> { <?["]> <quote_EXPR: ':qq'> }
pmichaud Tene: is there somewhere I can easily see the full grammar? 04:30
nopaste "tene" at 24.10.252.130 pasted "full grammar" (121 lines) at nopaste.snit.ch/18847
dalek TT #1332 created by coke++: change get_string on FPA, RPA (et al?) 04:31
04:31 kthakore_ joined
pmichaud Tene: ...and perhaps the actions? 04:31
nopaste "tene" at 24.10.252.130 pasted "the actions" (267 lines) at nopaste.snit.ch/18848
pmichaud aha 04:32
class Steme::Grammar::Actions;
you probably want to inherit HLL::Actions
otherwise you aren't getting the actions for quote_EXPR and the rest
in the latest version fo NQP (that I pushed 5 hours ago), .ast returns Undef instead of the matched string (recent spec change to S05) 04:33
*of
Tene pmichaud++ :)
pmichaud also, in your grammar, you probably want to get rid of the various {*}'s that are there 04:34
otherwise your actions get called twice
Tene Yes.
I now pass several test files. :)
pmichaud I would definitely refactor the various {*} #= begin into a <.newblock> subrule or something like that
then you no longer need the {*} #= end and can just use the default :) 04:35
Coke sighs.
I fixed up [incr] so it didn't error out on MMD. now it doesn't actually update the var.
I can't seem to make it do both. =-)
pmichaud Coke: I'll do the hll switch momentarily 04:38
need to close up a few things here first... bbi10
Coke pmichaud++
Tene pmichaud: in <let>, for example, I need to set up a block, and then I also need to add things to the start of it and put things in its symbol table before parsing the actual block... that's specific to let, so should I also create a rule to do that? <.newblock> <.letsig> ?
Coke *doh* incr is working fine, it's global that's not doing what I expect. 04:44
looks like the global is taking a /copy/ of the global, not an alias to it. 04:46
pmichaud: added a new todo which is hopefully a simple grammar update. (I tried to account for that whitespace and failed.) 05:03
05:03 gaz joined
dalek rtcl: 57ab809 | (Will Coleda)++ | t/tcl_misc.t:
Fix misc parsing test.
05:04
pmichaud back 05:07
Coke wonders why partcl-nqp isn't showing up in dalek's feed. 05:12
tene, did the tests for try not make it in? 05:14
pmichaud Coke: I think it's a feed per repository 05:15
so the partcl/partcl repository is separate from partcl/partcl-nqp
Coke pmichaud: yah, i added that.
pmichaud hmm, I don't know then.
I just pushed the hll_map changes.
Tene Coke: I never wrote tests for try. 05:16
Coke ah.
pmichaud there was some try examples in a nopaste but tests didn't make it in yet. 05:17
*were
Coke tene, can you renopaste the same?
"sample"?
nopaste "tene" at 24.10.252.130 pasted "try in NQP for Coke++" (27 lines) at nopaste.snit.ch/18849
"tene" at 24.10.252.130 pasted "expected output" (8 lines) at nopaste.snit.ch/18850 05:18
Coke and no catch yet, yes?
pmichaud Coke: (new todo) -- doesn't appear to have been pushed 05:19
Tene Coke: That's right.
Coke: I'll go add catch now, I guess.
Coke pmichaud: done. 05:20
basically, "exit ; " should work.
Tene pmichaud: I'll trade you CATCH for showing me what a refactored 'let' or 'lambda' would look like in steme: github.com/tene/steme/tree/master/src/pct/ ;)
pmichaud Tene: that'd be an excellent trade, but I seem to be fading quickly here 05:31
dalek rrot: r42802 | pmichaud++ | trunk/compilers/pct/src/PAST/Compiler.pir:
[pct/past]: Allow :pirop<opcodesig> as well as :pirop<opcode sig>.
05:32
Tene pmichaud: I'm just about done. Compiling and testing...
pmichaud Coke: whitespace before command separator should now be fixed. 05:34
Coke pmichaud++ # hll conversion
I have a fix for set a [list 1 2 3]; puts $a
pushed. 05:37
pmichaud: any ideas on global? (the var I end up with is apparently a copy, not the original) 05:38
<-- needy!
nopaste "coke" at 72.228.52.192 pasted "./pmtcl t/tcl_misc.t" (12 lines) at nopaste.snit.ch/18851
Coke (that's 10 passes before we blow up, not bad. =-) 05:39
pmichaud Coke: (1) what happens if we say "global a" and a hasn't been set yet? 05:41
Tene pmichaud: how can I check for Undef in NQP properly? 05:42
I must be misremembering: Method 'defined' not found for invocant of class 'Undef'
pmichaud Tene: currently the only good way is pir::defined($value)
Tene pmichaud: will this DWIM: unless $past.handlers() { ... }
pmichaud Parrot doesn't have a .defined method on its PMCs :-(
Tene: if WIM is that you want to check that there are handlers, likely yes. 05:43
Coke pmichaud: vivification, I think.
pmichaud Coke: I don't see any vivification in the current global sub, though.
I just see that it binds %CUR_LEXPAD{$_} to %GLOBALS{$_} 05:44
but if %GLOBALS{$_} hasn't been vivified yet, then it comes back as PMCNULL and that's what gets stored in CUR_LEXPAD
oh, wait, that's not what happens. :-( 05:45
%GLOBALS{$_} returns an Undef object, but it's not bound because %GLOBALS{$_} isn't an lvalue.
Coke the global in this case should be set before we call 'global' in a proc. 05:46
(to 0)
pmichaud: right, that was a /should/, not a /does/ 05:47
pmichaud oh...
$lexpad{$var} := pir::add__Nnn($lexpad{$var},$val);
Coke (but it shouldn't matter yet.)
pmichaud performs a rebind
Coke note that incr seems to work in the top level context. 05:48
pmichaud the := above is causing $lexpad{$var} to point to a new object
which means it's no longer the same one that %GLOBAL has 05:49
might try: pir::set__Pn($lexpad{$var}, $lexpad{$var}+$val);
Tene pmichaud: I'm running into problems with block_immediate... it's converting Blocks into Stmts, and losing the handlers in the process. I could also copy any handlers in that function, but handlers on Stmts are broken and useless. 05:50
Oh, I know... 05:51
pmichaud Tene: probably don't want to use block_immediate then
just do $block.blocktype('immediate')
Tene pmichaud: well, <block> calls it... ;)
pmichaud oh.
from blorst, yes?
Tene I just check for handlers, and don't convert if any are set.
pmichaud that seems reasonable 05:52
Coke error:imcc:The opcode 'set_p_n_n' (set<3>) was not found. Check the type and number of the arguments
pmichaud ...that's from using the set__Pn suggestion above? 05:53
Coke (i've seen this before, where there's a mismatch on the # of args given versus the error msg.)
yes.
pmichaud ...why does it think there are three args? 05:54
there's only two.
Coke exactly. :|
pmichaud oh!
set__vPn
Coke ah
at runtime, that gives another MMD error. 05:55
Multiple Dispatch: No suitable candidate found for 'add', with signature 'PPP->P'
pmichaud ugh
Coke will try to set the add to a tmp and then use set on that.
pmichaud oh, simpler:
pir::set__vPn($lexpad{$var}, pir::add_Nnn($lexpad{$var}, $val)) 05:56
better to avoid the temp, because it'll end up boxing/unboxing into the temp
(a lot of this crud is due to parrot's insufficient support for lvalue semantics... sigh)
Coke that gives a syntax error at build time. =-) 05:58
pmichaud oh, I missed a _
add__Nnn
Coke +1
purl 1
pmichaud oh, crap, that's not likely to work either :-( 06:00
Coke Ok. that still doesn't seem to work. (my global variable is still pegging at 1)
hee!
pmichaud because $lexpad{$var} is still an rvalue here.
Coke I find it very confusing that this works outside of a proc.
before + after the changes here. 06:01
pmichaud outside of a proc, the lexpad and %GLOBALS are the same hash
so any change made to lexpad is also changing %GLOALS 06:02
er GLOBALS
including rebinds
inside of a proc, the lexpad is a different hash from %GLOBALS
so a rebind of the lexpad symbol doesn't change the %GLOBALS binding
Coke right. it's only when using a global. (when it's just the lexpad for the proc, also fine.)
Tene pmichaud: Okay, CATCH is working, now just working on getting $_ and $! set. 06:03
pmichaud what we likely have to do is to switch set to use copy semantics
06:03 ZeroForce joined
pmichaud Tene: setting $! is going to be tricky -- unlike Rakudo, not every outer sub has a $! 06:03
and NQP doesn't like to add implicit vars
Tene Okay, I know what I'll do... :) 06:04
pmichaud I'm fine if we presume that the CATCH block has a $_ parameter, though.
so that the exception is available as $_ inside of CATCH 06:05
(the 'for' statement implies a $_ param on bare block bodies also, so there's precedent for this one instance of implied var, and it's always a param)
Coke: ultimately I think two things need to happen 06:08
(1) the set() function should default to doing pir::copy instead of binding
(2) the incr() function should use set() to change the value of a variable :-)
(as should any other function that wants to change a variable's value) 06:09
Tene Okay, this is a little bit evil, but let's see if it works...
pmichaud hopes for not too much evil. 06:10
Tene Well, it's approximately what you said.
yay infinite loop!
pmichaud :-)
maybe an error inside the handler that is invoking the handler again?
Tene That's exactly what it is. 06:11
pmichaud anyway, I'm really falling asleep at the kbd so I'm off to bed
Tene Goodnight, pm. :)
06:11 JimmyZ joined
pmichaud I'll look at any patch you have for CATCH tomorrow 06:11
Coke: I'll be glad to do a bit of set/global/incr refactoring tomorrow
goodnight, all 06:12
cotto night
Coke ~~
nopaste "tene" at 24.10.252.130 pasted "CATCH patch for nqp for pmichaud++" (112 lines) at nopaste.snit.ch/18852 06:15
Coke alternatively, I suppose I could eliminate %GLOBALS. =-) 06:16
(no, that doesn't help) 06:21
Tene Oops, I left a debug print in there. 06:22
I'm happy with this patch. I'll just commit it and let pmichaud revert or edit if he has issues with it. 06:25
Coke syntax in p6 for that is try { stuff; CATCH {handler} } ? 06:31
06:32 JimmyZ_ joined
Tene Yes. 06:36
although the 'try' there is superfluous if you have a CATCH in a block.
I'm working on tests right now.
and CATCH can come anywhere in the block.
nopaste "tene" at 24.10.252.130 pasted "What try/catch cases am I not testing here?" (42 lines) at nopaste.snit.ch/18853 06:41
Tene Coke: does that test file cover all usage you have in mind, at least?
Coke Tene: does the test with foo have the right sense? 06:42
(if it's blocking control exceptions, shouldn't it not return the 1?)
Tene Coke: it *ignores* control exceptions... meaning it does not block them. 06:43
Any ideas fo rbetter wording in the message?
06:43 ZeroForce1 joined
Coke allows passthrough of? 06:44
Tene Coke: So, yes, the test has the right sense.
"are not caught"
:) 06:45
pmichaud: do we want CONTROL in nqp too?
Ah, multiple CATCH blocks! 06:50
Maybe we want resuming, too?
i'm not sure why multiple CATCH blocks would be useful... oh, maybe for nested try.
Coke can you register catches for a particular type? 06:51
(ala java's catch)
Tene There's no syntax for that in Perl 6.
Coke k.
Tene The Perl 6 way to do it is with 'when'. 06:52
CATCH { when Foo { ... } when Bar { ... } default { ... } }
Coke yah, then I don't get why multiple CATCH is allowed. 06:55
nopaste "coke" at 72.228.52.192 pasted "partcl-nqp actually runs an entire partcl test!" (15 lines) at nopaste.snit.ch/18854 06:58
06:59 Andy joined 07:04 uniejo joined
nopaste "tene" at 24.10.252.130 pasted "try/catch test with multiple catch blocks and resumed exceptions" (69 lines) at nopaste.snit.ch/18855 07:06
Coke heh 07:08
Tene ? 07:09
Coke like the new test.
Tene Coke: Committed. 07:12
purl: msg japhb CATCH is committed to nqp-rx, pending pmichaud's approval of my commit.
purl Message for japhb stored.
dalek p-rx: ef7eef0 | tene++ | (3 files):
Basic implementation of CATCH and a test for try and catch.
07:14
Coke msg Infinoid "how can I get dalek to track partcl-nqp from trac.parrot.org/parrot/wiki/Languages ? 07:15
purl Message for infinoid stored.
JimmyZ dalek? 07:16
purl i guess dalek is #parrot's spammy little rss bot or (see: dalek plugins)
JimmyZ dalek plugins?
purl hmmm... dalek plugins is github.com/Infinoid/dalek-plugins/tree/master
Coke Tene: good CATCH. 07:18
-> zzz
Tene goodnight Coke
07:49 iblechbot joined 08:09 japhb joined 08:10 mj41_ joined
dalek rrot: r42803 | cotto++ | trunk (3 files):
[pprof2cg] add an initial (not-quite-working) nqp port of pprof2cg
08:14
rrot: r42804 | cotto++ | trunk/tools/dev/pprof2cg.pl:
[pprof2cg] comment out debugging code
japhb msg purl messages
purl Message for purl stored.
japhb d'oh!
Tene: excellent to hear re: CATCH. Will take a look during my next hack session. 08:15
08:45 mikehh joined 09:05 cognominal joined 09:25 bogen joined 09:45 JimmyZ joined 10:15 iblechbot joined 10:27 theory joined 10:35 theory joined 11:01 kthakore joined 11:15 payload joined 11:44 payload joined 12:03 cconstantine joined 12:46 bluescreen joined 12:48 ruoso joined 12:57 masak joined 13:20 payload joined 13:43 tetragon joined 13:44 riffraff joined 13:55 tetragon_ joined 13:56 iblechbot joined 14:03 payload joined, slavorg joined, ruoso joined 14:06 tetragon joined
Coke seen perljam? 14:19
purl perljam was last seen on #parrot 19 hours, 20 minutes and 3 seconds ago, saying: Coke: Every year I look around for that place I saw that did Cow(Pig(Turkey(Duck(Shrimp)))) several years ago. I bet it was a one-time deal.
14:52 zak_ joined
pmichaud good morning, #parrot 14:58
Coke pmichaud: hio. 15:02
15:02 payload joined 15:04 Psyche^ joined
Coke pmichaud: updated status/todo a bit. 15:20
I think it's nifty we can actually run a test file through. 15:21
pmichaud Coke: I'm working on global/set now. 15:28
and continuing to curse PIR.
(in particular, it's incredibly irregular opcode set)
*its 15:29
bah, I'm just going to write this in inline PIR. 15:30
too hard to bend NQP to do it
nopaste "pmichaud" at 72.181.176.220 pasted "global works in partcl-nqp (for Coke++)" (15 lines) at nopaste.snit.ch/18858 15:36
15:39 bogen joined 15:46 patspam joined
Coke pmichaud: woot! 15:49
(woot woot)
I certainly don't mind some inline PIR. better than "all PIR" 15:50
pmichaud yeah... PAST needs to have a way to be able to specify constant keys
15:51 payload joined
pmichaud probably will need to add a 'K' operand type to the signature 15:51
Coke pmichaud: added in the t/ and lib/ files we need from partcl 15:55
pmichaud \\o/
Coke is that "YAY" ?
pmichaud yes
Coke =-)
pmichaud head with two arms outstretched above it
Coke ^_^; 15:56
dalek rrot: r42805 | pmichaud++ | trunk/compilers/pct/src/PAST/Compiler.pir:
[pct]: Add 'copy' opcode to %piropsig.
Coke does nqp provide a way to iterate over the characters of a string? 16:04
Coke chuckles at masak's meme. 16:10
mikehh All tests PASS (pre/post-config, smoke (#30181), fulltest) at r42804 - Ubuntu 9.10 amd64 (g++ with --optimize) 16:13
pmichaud nqp doesn't have a built-in mechanism, no. 16:25
Coke pmichaud: k. i just went with a barebones split for now. 16:26
NotFound A string iterator?
pmichaud yah, I think Parrot knows how to iterate strings, though.
nopaste "coke" at 72.228.52.192 pasted "pmichaud++ - this fails to parse, probably because the block is too eagerly evaluated." (3 lines) at nopaste.snit.ch/18859 16:27
Coke (from t\\tcl_misc.t)
nopaste "pmichaud" at 72.181.176.220 pasted "parrot string iteration" (10 lines) at nopaste.snit.ch/18860 16:28
Coke oh, it JFW? 16:29
spif.
pmichaud: fixing the backslash-newline thing will help us get started on a lot more tests, btw. 16:30
pmichaud okay.
moritz that's not quite specced Perl 6 behaviour :-)
pmichaud moritz: yes, it's unfortunately a place where NQP will have to deviate from Perl 6 :-(
at least for a while. 16:31
Coke pmichaud++
NotFound That reminds me a question: will be a good idea to add an operator $P = iter $S ? 16:34
Looks like no :D 16:39
Coke is there a stringIterator for a string instead of a String? 16:40
I imagine boxing is required.
pmichaud I suppose it could be done w/o boxing, but I don't see it as being an important feature. 16:41
string iteration is pretty rare at the moment anyway, and there's no much cost in boxing a $S prior to iterating it
NotFound Yes, just avoidig an op and a register. His usefulness will depend on how frequent is the operation.
Coke so, nah. 16:42
NotFound Given the few interest, I assume that not much frequent.
Coke pmichaud: seems that you can't name the topic in a for loop over a string.
(for $a $thing) doesn't work, but (for $thing) does.)
(I can work around this. just noting) 16:43
pmichaud ??
do you mean for $str -> $a { ... } ?
Coke ah. newfangled sytax. danke. 16:44
pmichaud note that the newfangled syntax also allows n-at-a-time iteration 16:45
for @list -> $a, $b, $c { ... } # grab 3-at-a-time from @list
16:45 ruoso joined 16:47 slavorg joined 16:51 nopaste joined
Coke pmichaud: updated [split] to use that string iteration trick. 16:52
compare that to runtime/builtin/split.pir
(and we could probably slim it down if we had block labels. Do we? =-)
pmichaud not yet 16:54
Coke (not a priority. it's already several hundred lines shorter. =-) 16:57
pmichaud ....do you need backslash+newline in braced words also, or are quoted strings and barewords good enough for now ? 17:04
ehhh, I'll do braced word also 17:06
dalek nxed: r216 | julian.notfound++ | trunk/winxed.winxed:
add a simple heuristic to locate he stage0 compiler
17:10
dukeleto 'ello 17:25
dalek nxed: r217 | julian.notfound++ | trunk/examples/parser.winxed:
assignment operator in example parser
17:29
17:29 nopaste joined
pmichaud Coke: pushed backslash+newline handling (I think) 17:31
mikehh All tests PASS (pre/post-config, smoke (#30182), fulltest) at r42805 - Ubuntu 9.10 amd64 (gcc with --optimize)
17:42 nopaste joined 17:45 ruoso joined
Coke yup, that unblocks t/cmd_expr.t 17:55
pmichaud++
17:56 payload joined
Coke pmichaud: nifty. I imagine that'll be faster than the original, as I really was doing it as a separate pass. 17:58
18:06 mikehh_ joined
cotto_work good morning 18:11
Coke ~~ 18:13
dukeleto good moroning
cotto_work morons dukeleto 18:14
japhb "Good moroning to all, and to all a good knucklehead." 18:15
Coke wonders why dev.perl.org/perl6/ has the synopses so far away from teh A & E.
japhb Because at this point, they are? ;-)
Coke then the syn should be highlighted and not on the bottom. 18:16
Coke wonders how to die in nqp.
japhb pir::die() would probably work
Coke pir::throw the b.... ok.
18:19 joeri joined
Tene pmichaud: I committed CATCH last night. 18:20
Coke tene++ 18:21
Tene: so if i /want/ to catch control exceptions, am I best of just cutandpasting? 18:23
"best of"
"best off"!
Coke glares at the f key.
Tene Coke: leave off the handle_types_except bit 18:25
nopaste "coke" at 72.228.52.192 pasted "tene++, does this look right to you?" (16 lines) at nopaste.snit.ch/18861 18:26
Coke right, "cut and paste and <that bit>" as opposed to trying to manipulate the builtin try/catch. 18:27
Tene oh, I misunderstood.
I'll add CONTROL for you, then.
nopaste "coke" at 72.228.52.192 pasted "(whoops, return the retval, not "ok")" (16 lines) at nopaste.snit.ch/18862 18:28
Coke oooh. that would be quite nice of you.
Tene: is $_ a parrot Exception PMC? 18:37
(in CATCH/CONTROL) ?
(in NQP)
(looking at the test, looks like you did get $! to work, and that it at least ISA exception. danke.) 18:41
Tene Coke: Yes, it's a parrot exception PMC 18:47
Coke: just adding a test for CONTROL
Coke woot.
nopaste "coke" at 72.228.52.192 pasted "partcl-nqp's new catch, assuming I have the syntax right." (31 lines) at nopaste.snit.ch/18863 18:48
Coke that look sane?
18:49 mikehh_ joined
Tene Coke: pushed 18:49
cotto_work pmichaud, what kind of plans do you have to make nqp-rx generate smarter pir, if any? 18:50
Coke If I install nqp-rx, will that overwrite the version installed by parrot?
Tene Coke: that looks sane to me.
Coke Tene: need to update the test plan. 18:53
dalek p-rx: 7387be6 | tene++ | (3 files):
Add CONTROL blocks
Coke (planned 7, ran 8)
Tene Coke: Thank you. Pushed the fix. 18:55
pmichaud: there's currently a problem with try/control, in that a CONTROL block in a try {} will disable the try's default ignore handler.
pmichaud cotto_work: I do expect to try to generate smarter pir, yes. However, the structure of Parrot doesn't allow for a lot smarter PIR. 18:56
(I'm hoping parrot will change that... but I don't expect it to happen anytime in the near future.) 18:57
cotto_work ok. How could Parrot enable smarter code generation? 18:58
Tene The fix isn't too bad, but I haven't done it yet.
cotto_work It sounds like that might fit in with Lorito.
pmichaud cotto_work: well, one of the big stumbling blocks at the moment is that lexicals can only be PMCs
so anything that goes into a lexical ends up having to be boxed into a PMC
an even bigger stumbling block is that Parrot doesn't have a good lvalue model or assignment semantics 18:59
it tends to confuse "bind" with "assign"
at least, it does that for most of the default PMC types
there's also not a good reference model 19:00
for keeping track of object references
as a result, the code that nqp generates tends to have to be somewhat pessimistic, such as continually refetching lexical and global symbol tables because of the possibility of a symbol being rebound 19:01
Coke pmichaud,tene: > puts [list [catch barf var] $var]
1 {Could not find non-existent sub barf}
whee. 19:02
cotto_work That explains some of the generated code then.
Coke pmichaud: any issue with switching partcl-nqp to build with "nqp" instead of "parrot-nqp" for now? 19:03
(then I don't have to ping you to cut a new 'release' =-)
pmichaud cotto_work: I do plan to have an option whereby code can say "assume this lexical/symbol isn't being rebound" 19:04
but since parrot doesn't have a good assignment model, most folks end up doing rebinds
partcl-nqp just went through this yesterday (until I fixed it this morning) whereby symbols were being re-bound to new PMCs instead of changing the value of an existing multiply-bound PMC 19:05
cotto_work What's the difference between assignment and binding?
pmichaud assignment changes the value of an existing PMC 19:06
binding causes a symbol table entry to point to a PMC
so, for example
$P0 = box 1
$P1 = $P0
these are examples of binding
if after the above, I do: $P0 = box 3
then $P1 ends up still being bound to the PMC containing 1
and $P0 is bound to a new PMC containing 3 19:07
okay so far?
cotto_work yes
pmichaud $P0 = box 1
$P1 = $P0
assign $P0, 3
in this case, $P0 and $P1 still point to the same PMC, and the value of that PMC has changed to 3
still okay?
cotto_work yes
pmichaud that's the difference
now then, let's look at something like 19:08
$P0 = new ['ResizablePMCArray']
$P0[0] = 1
$P1 = $P0[0]
in this case, $P1 and $P0[0] are pointing to the same PMC (containing 1)
but if we then do...
$P0[0] = 3
that's a binding, not an assignment 19:09
such that $P1 refers to the old PMC (1), while $P0[0] refers to the new one (3)
in other words, changing the value in the array has broken the bind
moritz pmichaud: this is becoming an FAQ... you should put that on a wiki page or so
pmichaud moritz: well, I have a few hours car ride today, perhaps I can type it up.
but I also plan to do a NQP/compiler tutorial
Coke pmichaud: is t/sanity.t working for you? 19:10
pmichaud Coke: it was as of my last push
cotto_work Thanks.
pmichaud where it gets *really* nasty is with 19:11
$P0 = find_lex '$a'
'foo'()
if the "foo" subroutine does store_lex '$a', $P99 to put a new value in lexical $a
then when we get back from 'foo', $P0 no longer points to the PMC associated with $a
dalek p-rx: ae0666c | tene++ | t/nqp/44-try-catch.t:
Update test plan
pmichaud because store_lex does a bind
and not an assign 19:12
cotto_work Then $P0 will have an out-of-date value
pmichaud exactly
so, every time we need access to $a, we end up having to do a re-fetch
because it's possible some other operation will have re-bound it to a different PMC
dalek kudo: 2eb38b5 | moritz++ | perl6.pir:
alias Object and Mu, as suggested by jnthn++; wins us back quite a few tests
19:13
pmichaud ideally there would be an opcode that makes it easier to do assignment
there is an opcode called 'assign', but it tends to do weird things with the built-in PMCs
for example 19:14
$P0 = new ['ResizablePMCArray']
store_lex '$a', $P0
which sets $a to be a RPA
now we want to do the equivalent of $a = 3 -- i.e., change it to an Integer 3
$P1 = find_lex '$a'
assign $P1, 3 # oooops!
cotto_work That changes the length to 3, doesn't it? 19:15
pmichaud what we want is $P1 to be an Integer 3
right
so the 'assign' opcode doesn't do what we want here
late last year we added the 'copy' opcode to try to do this
so we'd have 19:16
$P1 = find_lex '$a'
$P2 = box 3
copy $P1, $P2 (replace $P1 with $P2)
19:16 pjcj joined
pmichaud but it's horribly inefficient, because it involves making a clone of $P2 and then copying that structure into the PMC header for $P1 19:16
but so far it's about the best we can do
everything gets worse when we start talking about aggregate access 19:17
because there's not a copy $P0[0], $P2 opcode yet
and this leads to allison's comment that it really should be the PMCs/vtables that determine behavior instead of opcodes 19:18
(which is where the model completely breaks down)
cotto_work There's a lot conspiring to prevent good code generation from nqp. 19:19
Thanks you for that explanation. 19:20
pmichaud sure thing!
dukeleto 'ello
pmichaud ultimately it's that Parrot (vtable and core types) doesn't have a good container/value/lvalue model 19:21
or, at least, one that doesn't map well to the HLL's we're targing.
*targeting
NotFound BTW that pmc header copying is done independently in several different places.
pmichaud Coke: yes, my copy of partcl passes sanity.t 19:26
Coke pmichaud: ok. either my updated catch or using nqp-blead.
dukeleto: hello 19:30
pmichaud: would you mind if I cut a release of nqp-rx into parrot?
dalek kudo: 2fc0a98 | moritz++ | src/setting/Object.pm:
implement Object.notdef

autovivification returning Failure, not Mu.
19:31
pmichaud Coke: no, I don't mind at all. 19:32
anyone can do it :)
I don't feel that's something I need to keep control over :)
moritz it's good to keep the bus number high 19:33
Coke nqp-rx has wrong deps. (make -j3 causes some stuff to get built 3 times.) 19:34
Coke look into that later.
"will"
pmichaud -j3 doesn't work well with the bootstrapping 19:35
we can get it to maybe work with -j3, but I fear the makefile becomes far more complicated as a result 19:36
I'd rather have a simpler makefile.
(if it can be done while keeping the makefile simple, I'm all for it)
Coke eh. I have plenty of other makefile sto clean up. =-)
dalek nxed: r218 | julian.notfound++ | trunk/examples/parser.winxed:
add operators == and != and redo operator + in example parser
19:37
Coke pmichaud: do I need a commit bit on nqp-rx to do this? 19:40
(I assume (4) commit files in src/stage0
is for the nqp-rx repo itself.)
19:41 cognominal joined
dalek nxed: r219 | julian.notfound++ | trunk/examples/parser.winxed:
add parens parsing to example parser
19:42
pmichaud Coke: you don't _have_ to commit the src/stage0 files to copy them into parrot, but it'd be a good idea 19:49
that said, you now have nqp-rx commit privs
Tene pmichaud: are you comfortable with me assuming you'll review my commits to nqp-rx and revert any problems? 19:55
pmichaud: the check to prevent CONTROL from breaking try is to add a loop that walks over the handlers, checking if they're all handling only control exceptions. Is that fine to add, or is that beyond the complexity level you want in nqp? 20:00
Coke how do I switch my checkout to point to the push-able repo?
Tene Coke: you can just edit .git/config
Coke tene++ 20:01
Tene There are git commands to do it, but that's easier. :)
pmichaud Tene: I'll review your commits and revert, yes.
Tene: as long as tests pass and we don't break anything else, I'm not too concerned at this point.
Tene Okay, great. I'll try not to work on it until tonight, so I can get some $job work done. :) 20:02
pmichaud I don't know when I'll have a chance ot review -- we're about to leave for thanksgiving family visit (3 days)
I should have good wifi connectivity there, though
and I've already warned everyone that I plan to be hacking/coding :)
dalek p-rx: 294d493 | (Will Coleda)++ | src/stage0/ (3 files):
rebuild stage0 after tene++'s try/CATCH/CONTROL additions.
20:04
Coke wonders why that didn't come through as coke.
(does each project have its own credits file?) 20:05
(from dalek's POV)
pmichaud I would think so.
time for us to leave here -- I'll bbl
Coke ~~ 20:08
dalek rrot: r42806 | coke++ | failed to fetch changeset:
Update nqp-rx with try/CATCH/CONTROL work from tene++
20:12
Coke "failed to fetch changeset:" ? 20:17
Tene delicious changeset... 20:18
cotto_work it's an rss goof
the commit looks fine
Coke sighs as "make test" is still failing for him in partcl-nqp, and he doesn't have time fo figure out why 20:22
20:47 ruoso joined
dalek nxed: r220 | julian.notfound++ | trunk/examples/parser.winxed:
function call without args in parser example
21:01
21:02 bluescreen joined 21:22 iblechbot joined
dalek tracwiki: v1 | cotto++ | WhyDoesNQPGenerateInefficientCode 21:39
tracwiki: first version, direct copy/paste from irc, definitely needs reworking
tracwiki: trac.parrot.org/parrot/wiki/WhyDoe...ction=diff
tracwiki: v2 | cotto++ | WhyDoesNQPGenerateInefficientCode
tracwiki: trac.parrot.org/parrot/wiki/WhyDoe...ction=diff
21:45 Andy joined 21:49 allison joined 21:51 nopaste joined
dalek nxed: r221 | julian.notfound++ | trunk/examples/parser.winxed:
function call with args in parser example
22:08
22:19 donaldh joined 22:29 theory joined
dalek kudo: f151334 | moritz++ | src/setting/ (2 files):
get rid of undef in the setting
22:53
Tene pmichaud: if I define new protoregex variants during the parse, is it likely to work correctly? 22:58
22:59 patspam joined
Tene pmichaud: I'm hoping to be able to do macros in my scheme parser by having the action method for the macro definition generate a new grammar rule and action method and install them into the namespaces. 22:59
23:02 mikehh joined
kthakore um hi 23:04
leto: hi
purl privet, kthakore.
kthakore leto: you mentioned there where a couple of ppl to talk to for hacking on PCC ? 23:05
oh well some other night then 23:08
Tene kthakore: What about PCC? 23:10
kthakore: I did some of the PCC refactor. 23:11
kthakore Tene: oh hello
Tene: I am at a lost for time. But I am upgrading blitzkost's to the new PCC stuff 23:12
Tene: I will talk to you later
Tene kthakore: allison is the best to ask, but she is not around so much right now.
kthakore: bye 23:13
allison Tene: you can point people at trac.parrot.org/parrot/wiki/PCCMigrationNotes as a start on upgrading to the new PCC 23:20
kthakore allison: I have looked at that 23:34
allison: Tene in blitzkost I get this issueā€˜struct parrot_interp_t’ has no member named ā€˜current_args’ 23:36
allison: the wiki link says not to use C structs anymore and use
Parrot_pcc_get_signature(interp, ctx);
but how do I get cur_args? 23:37
or the equivalent?
Tene: that was my question? is there a place that explains the PMC * usage a little better? 23:38
23:40 xenoterracide joined, plobsing joined
allison kthakore: there is no current_args anymore 23:47
kthakore allison: ahh ...
allison you're looking for 'current_sig' in the current context 23:49
kthakore ok
allison: I am going to have to understand the logic before I proceed
allison: is there a page that explains signature usages in pmc? 23:50
allison kthakore: a signature is a PMC that stores all the arguments to a call
kthakore ok
allison digging for the best resource to hand you 23:51
kthakore so in blizkost I am assuming they are trying to get arguments from p5 -> parrot calls?
allison: thank you.
leto: let me know ... I am super new to vm hacking 23:52
allison kthakore: yes, if they're grabbing current_args then they were likely doing some argument munging 23:53
kthakore allison: ok. 23:54
allison kthakore: okay, the documentation on CallSignature itself (src/pmc/callsignature.pmc) will give you how to pull information out of the CallSignature object, which is likely all you'll need
kthakore allison: I have to head back to sdl for a while but I will try again later. Thanks!
allison++ <-- patience with newb guy 23:55
allison: caio
allison no problem
pop back if you have more questions
kthakore allison: sure
allison (I'm on UK time, which is off for most of the team)
kthakore allison: I am on whenever I get to hack time which is off from the rest of the planet :p
allison kthakore: :) 23:56
kthakore allison: oh ! src/pmc/call... is extacly what I need! Thank you
dalek tracwiki: v3 | samlh++ | WhyDoesNQPGenerateInefficientCode 23:58
tracwiki: Reformat for easier reading
tracwiki: trac.parrot.org/parrot/wiki/WhyDoe...ction=diff
allison kthakore: excellent! 23:59
purl EGG-see-lent!
kthakore heh