Camelia, the Perl 6 bug

IRC log for #parrot, 2008-07-10

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:09 AndyA joined #parrot
00:23 dalek r29216 | jkeenan++ | trunk:
00:23 dalek : [configure]  Refactor code from auto::pack::runstep() into _set_format(),
00:23 dalek : _pack_test(), _set_packtypes().  Then test these internal subroutines.
00:23 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29216
00:39 pmichaud jonathan: (for scrollback reading)  As of right now I don't know how far I'll get with signatures/refactorings before tomorrow -- it might be safer to hack on something else if convenient, but I also don't want to block you from getting things done.  That's about the best answer I have at the moment.
00:44 bacek_ pmichaud: I did some investigations about #56650.
00:45 bacek_ Problme is: Parrot_oo_register_class uses ResizableStringArray for class name. But mmd (actually mmd_distance) uses plain string. So it just can't find proper multy sub
00:46 bacek_ And my parrot's knowledge are not so strong to fix it...
00:53 ewilhelm joined #parrot
00:53 ewilhelm left #parrot
01:02 Eevee joined #parrot
01:04 dalek r29217 | jkeenan++ | trunk:
01:04 dalek : Add two tests to complete coverage of all conditions.
01:04 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29217
01:04 pmichaud bacek_: mine aren't strong enough to fix it either.  I don't know when it'll get fixed.
01:08 bacek_ oh...
01:11 TiMBuS joined #parrot
01:38 Whiteknight bacek_, did you post a ticket about it?
01:38 Whiteknight I could take a look at it with some more details
01:39 bacek_ Whiteknight: rt#56650
01:40 bacek_ I's pmichaud's original ticket
01:40 Whiteknight oh, okay
01:40 bacek_ Whiteknight: poblematic functions is mmd_distance and mmd_cvt_to_types
01:46 Whiteknight so we want mmd_distance to be able to take a PMC array with class names, in addition to a simple string?
01:47 pmichaud supposedly it already can
01:47 pmichaud supposedly I can write    :multi(['Foo';'Bar'])
01:47 Whiteknight "supposedly"?
01:47 pmichaud I haven't tested it directly.  Let me do that.
01:48 bacek_ Whiteknight: probably we want create RSA and put bare string into it and lookup in case when first lookup failed
01:50 Whiteknight I'm still young and arrogant enough to think I can tackle any problem, so this should be a snap!
01:50 nopaste "pmichaud" at 76.183.97.54 pasted ":multi already works with multi-string keyed types" (24 lines) at http://nopaste.snit.ch/13539
01:51 pmichaud let's try it with an array
01:51 bacek_ pmichaud: if you'll add :multi(_) it will fail...
01:51 Whiteknight oh, so then what does the ticket need?
01:51 pmichaud bacek_: it works for me
01:52 dalek r29218 | jkeenan++ | trunk:
01:52 dalek : Write unit tests for _handle_ncurses_need().
01:52 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29218
01:52 nopaste "pmichaud" at 76.183.97.54 pasted "for bacek: works with :multi(_), also" (29 lines) at http://nopaste.snit.ch/13540
01:52 * Whiteknight has to look up "manhattan distance" on wikipedia...
01:53 pmichaud it even works when a ResizableStringArray is used to create the class
01:54 nopaste "pmichaud" at 76.183.97.54 pasted "using RSA to create the class" (31 lines) at http://nopaste.snit.ch/13541
01:54 pmichaud it doesn't work when the class is created from a namespace, and _that's_ what the ticket is about
01:54 nopaste "bacek" at 211.29.157.151 pasted "Gotcha! Bug #56650" (34 lines) at http://nopaste.snit.ch/13542
01:54 bacek_ pmichaud: indeed
01:55 petdance joined #parrot
01:55 pmichaud bacek_: the problem isn't the :multi(_), it's the fact that Parrot doesn't correctly map the namespace key used to create the class to the :multi's that refer to the same namespace.
01:55 pmichaud in nopaste 13542 -- it's not that :multi(_) causes it to fail, it's that it doesn't correctly match either of the other two :multi subs (and it should)
01:56 pmichaud note also that it's probably an error to use newclass on both  ['ABC';'Bar']  (the key)  and the ['ABC';'Bar'] namespace.
01:56 pmichaud i.e., it should indicate a duplicate class or something.
01:57 Whiteknight so what's the cause of that? The fact that in bacek_'s second example, the namespace was created indirectly?
01:57 pmichaud I think bacek's example isn't robust
01:57 pmichaud a simpler example is:
01:59 nopaste "bacek" at 211.29.157.151 pasted "Total screwing of parrot..." (30 lines) at http://nopaste.snit.ch/13543
01:59 Whiteknight in bacek_'s example, the type of the last argument should still be 'ABC';'Bar'
01:59 bacek_ swapping two parts produces 'right/wrong'...
01:59 Whiteknight so it should still trigger the class method
01:59 pmichaud in bacek's example, the second newclass opcode should throw an exception.
01:59 pmichaud as we already have a ['ABC';'Bar'] class
02:01 Whiteknight just a sanity check: classes that are created like that indirectly should be stored in the same lookup list as classes created directly, right?
02:01 nopaste "pmichaud" at 76.183.97.54 pasted "simpler example showing failure" (25 lines) at http://nopaste.snit.ch/13544
02:01 Whiteknight because if it's not throwing an exception, I'm lead to believe Parrot isn't detecting the two namespaces as being equivalen
02:02 pmichaud in nopaste 13544, if you change the newclass line to read   "$P1 = newclass ['ABC';'Bar']"   (instead of using the namespace) then everything works.
02:02 Whiteknight well, that's a confusing example!
02:02 nopaste "pmichaud" at 76.183.97.54 pasted "simpler example showing success when using explicit key instead of namespace" (24 lines) at http://nopaste.snit.ch/13545
02:03 pmichaud as I understand it, every class has one associated namespace and vice-versa
02:03 pmichaud (although it's possible to create a namespace without a corresponding class)
02:03 pmichaud it's not possible to have more than one class for the same namespace
02:03 Whiteknight so that gets back to my sanity check question: Why are your two examples returning two different results?
02:04 pmichaud I don't know why.  I think it's a bug, and that's what I reported in RT#56650 :-)
02:05 pmichaud I think that the two should probably be equivalent.  Either that or we need a clearer explanation of how to use :multi for classes created from namespaces.  Or, more generally, I want to know how to create a class in another HLL that can also participate in MMD
02:05 Whiteknight I say that the two cases should absolutely be equivalent
02:05 Whiteknight I don't see any benefit to having different behaviours like that
02:06 pmichaud I'm not the Parrot architect, so I'm not the one that makes the decisions as to what "should" or "should not" be the case.  :-)
02:06 pmichaud Parrot would look somewhat different if I were that person.  :-)
02:06 bacek_ newclass ['Abc'] passing Key pmc to Parrot_oo_registrer_class
02:07 pmichaud so, all I try to do is report "this doesn't work the way I expect" and "I can't seem to achieve the following result" and hope that a Parrot person will help me out.  :-)
02:07 bacek_ newclass $P0 (from namespace) passing just RSA .
02:07 bacek_ and this causes all problems.
02:07 pmichaud ...RSA, really?
02:07 pmichaud I thought it would be passing the namespace itself
02:07 bacek_ pmichaud: yes
02:07 pmichaud line?
02:07 bacek_ (gdb) p name->vtable->whoami.strstart
02:08 bacek_ $7 = 0x705e0e "ResizableStringArray"
02:08 Whiteknight it would be a simple matter in the newclass opcode to always convert the input to one type of PMC or the other
02:08 Andy Who wants ack plugins?
02:08 bacek_ 657Parrot_oo_register_type(PARROT_INTERP, ARGIN(PMC *name))
02:08 Andy YOU want ack plugins!
02:08 Whiteknight Andy, you have ack plugins?
02:08 davidfetter what about phththpt plugins?
02:08 pmichaud bacek:  but when I create the class from a RSA, everything works.
02:08 bacek_ pmichaud: just a sec
02:08 nopaste "pmichaud" at 76.183.97.54 pasted "simpler example showing success when using RSA instead of namespace" (26 lines) at http://nopaste.snit.ch/13546
02:08 Ademan joined #parrot
02:09 Andy Hey, we could have plugins that let you ack through tables!
02:09 pmichaud bacek_: it only seems to fail when using a namespace to create the class.
02:09 pmichaud RSA works, key words
02:09 pmichaud *works
02:10 bacek_ pmichaud: it converted to Key somehow
02:10 Whiteknight so if it's an RSA or a key, it works as intended, but if it's a string, it doesnt?
02:10 pmichaud if it's a RSA or a key, it works as I expect, but if it's a namespace, it doesn't.
02:10 bacek_ Whiteknight: no. Parrot_oo_register_class recives Key event you create class from RSA
02:10 bacek_ s/event/even/
02:11 bacek_ Breakpoint 1, Parrot_oo_register_type (interp=0xb122e0, name=0xd5d3c0) at src/oo.c:662
02:11 bacek_ 662    fail_if_type_exists(interp, name);
02:11 bacek_ (gdb) p name->vtable->whoami.strstart
02:11 bacek_ $8 = 0x705524 "Key"
02:11 bacek_ oops.
02:11 bacek_ Sorry.
02:11 bacek_ Its actually recieve RSA...
02:12 * Whiteknight is even more confused now
02:13 bacek_ Whiteknight: http://nopaste.snit.ch/13543...
02:13 pmichaud bacek_: I still claim that example is bogus.
02:13 pmichaud well, except that the first call to 'foo' is an error
02:13 bacek_ pmichaud: yes.
02:14 bacek_ We should get 'already registered' exception...
02:14 pmichaud but my example (13544) shows that error already.
02:14 pmichaud (the wrong sub call, not the already registered)
02:14 pmichaud the fact that the second newclass doesn't throw an exception is probably also a bug, but it's not immediately obvious that it's relevant to the bug I filed in #56650
02:15 * bacek_ thinks always converting Key to RSA is not bad idea..
02:15 pmichaud I don't think that's an issue either.
02:15 pmichaud (example coming.)
02:17 nopaste "pmichaud" at 76.183.97.54 pasted "newclass from identical Key and RSA" (11 lines) at http://nopaste.snit.ch/13547
02:17 Coleoid joined #parrot
02:17 pmichaud okay, that's a bit weird.
02:17 nopaste "bacek" at 211.29.157.151 pasted "Works..." (28 lines) at http://nopaste.snit.ch/13548
02:18 pmichaud sure, I'd expect it to work there, because the class was created from a Key
02:18 pmichaud my problem is when the class is created from a namespace
02:19 Whiteknight well, how does the "class created from a namespace" algorithm work?
02:19 pmichaud I don't know.  Them's Parrot guts.
02:19 Whiteknight i.e. what is that particular mechanism doing differently?
02:20 pmichaud I really don't know how the class registry works (or is supposed to work).  If I did, I could probably fix #56550 :-)
02:21 pmichaud see, for example, RT#43419
02:22 pmichaud (which is another bug that I haven't figured out what is supposed to happen)
02:27 Whiteknight looks like the magic is happening in src/pmc/class.pmc lines 1083-1092
02:27 Whiteknight 1079-1092*
02:28 pmichaud personally, I find the fact that Parrot tends to reduce all class references to string lookups quite scary.
02:28 pmichaud or string comparisons.
02:28 Whiteknight it's iterating over the initialization object. for a simple key or a string, that creates a single attribute "Foo;Bar"
02:28 Whiteknight but for an array, that creates two separate attributes "Foo" and "Bar"
02:29 Whiteknight we could easily improvify that loop to split all strings at ';'
02:29 pmichaud wait, I'm confused
02:30 pmichaud why split strings at ';'?
02:30 Whiteknight to get array-like behavior
02:30 pmichaud none of my examples had ';' in the strings passed to the newclass opcode
02:30 Whiteknight maybe that's not the separator then. How does a namespace pmc stringify?
02:31 pmichaud does it get stringified?
02:31 pmichaud I figured the namespace pmc is passed as the pmc
02:31 Whiteknight okay, rephrased: when I call VTABLE_shift_string on a namespace iterator, what do I get back?
02:31 Whiteknight because that's the call that's making the magic happen
02:32 pmichaud ahhhh
02:32 pmichaud I would think that a namespace iterator would iterate over the keys in the namespace
02:32 pmichaud since a namespace is effectively a Hash
02:32 pmichaud that might explain a lot.
02:33 pmichaud note that I mean literally the keys (symbols) in the namespace, not the namespace's name.
02:33 Whiteknight Could the hash iterate in a different order from an RSA?
02:33 pmichaud if I do:
02:33 pmichaud set_hll_global ['ABC'], 'foo', $P0
02:33 pmichaud set_hll_global ['ABC'], 'bar', $P1
02:33 pmichaud set_hll_global ['ABC'], 'baz', $P2
02:34 pmichaud and then iterate over the ABC namespace, I'd expect to get back the keys 'foo', 'bar', and 'baz'
02:34 pmichaud because those are the symbols in the namespace
02:34 Whiteknight right
02:34 pmichaud whereas if I have a RSA that was created from     rsa = split ';', 'ABC'
02:34 pmichaud I'd get only one value back from the iterator -- I'd get 'ABC'
02:35 Whiteknight so the namespace isn't treating it's base as one of it's keys?
02:35 pmichaud it may do that... my point simply being that iterating over the ['ABC';'DEF';'GHI']  namespace will not give you 'ABC', 'DEF', and 'GHI'
02:36 Whiteknight it wont? what do you get instead?
02:36 pmichaud it will give you any symbols that were stored in the ['ABC';'DEF';'GHI'] namespace.
02:36 Whiteknight okay, okay
02:36 pmichaud a namespace is a Hash, not a String :-)
02:36 pmichaud a RSA is an array
02:36 pmichaud (an array of strings)
02:36 Whiteknight so for the case of a namespace PMC, isntead of iterating over it, we should get it's name string, separate it into an array, and then iterate over the array to instantiate the class?
02:37 pmichaud actually, I'm thinking that 'get_name'() on a namespace may already return an array
02:37 Whiteknight haha, this is too much
02:37 pmichaud I know it does for a class.
02:37 pmichaud at least, I seem to recall that it does.
02:38 pmichaud but wait wait wait
02:38 Whiteknight either way, I know where the problem is happening, somebody just needs to tell me how to fix it
02:38 pmichaud lines 1079 through 1092 are not iterating over a name
02:38 Whiteknight they're iterating over the given PMC
02:38 pmichaud they're iterating over a hash containing attributes to be used to initialize the class
02:39 Whiteknight isn't that the same?
02:39 pmichaud yes, the 'init' PMC is a Hash containing attributes for initializing the class
02:39 pmichaud it's a list of attributes, not the components of the name
02:39 Whiteknight which can be a namespace or an RSA
02:39 pmichaud I guarantee that the 'init' PMC is a Hash.
02:39 pmichaud Not a namespace nor RSA.
02:39 Whiteknight it's never cast to one anywhere in the call chain from the newclass opcode
02:40 Whiteknight at least, not that I have seen
02:42 pmichaud src/pmc/class.pmc:502-504
02:42 Whiteknight so are we looking instead at the "initialize_parents_pmc" call at 1123?
02:43 Whiteknight 502-504 makes the class PMC a hash, but the init PMC is the direct input from the newclass opcode
02:43 pmichaud no.
02:43 Whiteknight oh, no. wait. I see what's happening
02:43 pmichaud 502-504 creates the 'args' Hash from the stringified version of init_data
02:44 pmichaud and then that 'arg's Hash is passed to init_class_from_hash
02:44 pmichaud er, 'args' Hash
02:44 Whiteknight no, the init function is only called if newclass is passed a null pmc
02:44 purl okay, Whiteknight.
02:45 pmichaud okay, let me double-check my trace
02:45 Whiteknight newclass calls src/pmc.c:pmc_new_init, which calls the instantiate method, not the init method
02:45 pmichaud newclass opcode calls pmc_new_init
02:45 Whiteknight right
02:45 pmichaud which calls the instantiate VTABLE method (okay, you're right)
02:45 Whiteknight oh shoot, i missed the second condition, you're right
02:46 pmichaud heh
02:46 Whiteknight it only calls instantiate if typeof(init) is a class pmc
02:46 pmichaud we've confused each other
02:46 Whiteknight for a namespace/rsa/whatever, we call int
02:46 Whiteknight init*
02:46 pmichaud right.
02:46 pmichaud and then init builds a hash
02:46 pmichaud and calls init_class_from_hash
02:46 Whiteknight right, right
02:47 pmichaud however
02:47 pmichaud oh, never mind... misread on my part
02:48 pmichaud anyway, inside of init_class_from_hash, we see if there's a 'name' key
02:48 pmichaud there is, (because it was set inside of VTABLE init)
02:49 pmichaud so, we do a lookup (line 186)
02:49 pmichaud check to see if it's a namespace (line 191)
02:49 pmichaud and get the name of the namespace into name_arg (line 193)
02:50 pmichaud at this point I *think* that name_arg is an array PMC of some sort
02:50 pmichaud -however-
02:50 Whiteknight dunh dunh dunh!
02:52 pmichaud _but_
02:52 pmichaud I think that in the case of a namespace pmc, name_arg will also include the name of the hll namespace
02:52 Auzon joined #parrot
02:52 pmichaud whereas with the else part (lines 195-199), name_arg will be treated as relative to the current hll
02:52 Whiteknight we should toss in some diagnostics, and see what, exactly it does contain
02:53 pmichaud in other words, if I pass in a namespace like ['ABC';'Foo'],  then get_name on that namespace probably returns   'parrot','ABC','Foo'
02:53 pmichaud and so name_arg ends up with 'parrot','ABC','Foo'
02:54 Whiteknight so assuming we were to fix this, would we strip the hll namespace from the namespace object, or prepend the hllnamespace to all other objects?
02:55 pmichaud personally, I think that we should prepend the hllnamespace to all other objects, because of RT#43419
02:55 pmichaud however, I guarantee that this will have far-reaching effects throughout all of Parrot
02:55 Whiteknight do I smell the need for a new branch?
02:56 pmichaud because then   $P0 = new 'Integer'   has to recognize that we mean 'Integer' in the current 'hll'
02:56 pmichaud where right now 'Integer' is "global" across all HLLs
02:56 pmichaud same is true for get_class
02:56 Whiteknight well, then maybe we wouldn't do any prepending for a literal string like that
02:57 pmichaud in which case strings would always have to be  'parrot';'Integer'
02:57 pmichaud or we'd have to keep track of two sets of names, or two types of names
02:57 Whiteknight so...unfixable?
02:57 pmichaud I don't know.  These are are architectural decisions which I'm not the person to be making them.
02:58 Whiteknight fair enough
02:58 pmichaud allison and/or jonathan probably need to be making these decisions.
02:59 pmichaud I'm perfectly fine with saying that string arguments to get_class/newclass/subclass continue to work as they always have
02:59 Whiteknight whereas key arguments could get an appended hll namespace to better align their behavior with namespace pmcs
03:00 pmichaud yes.  Either that or we always require the hll namespace as part of the key, and treat them all relative to the root namesapce
03:00 pmichaud ii.e.,    $P0 = new ['parrot';'Integer']
03:00 Whiteknight that's an option too: always require an hll namespace in a call to newclass
03:01 pmichaud or, the most likely option would be to always use a namespace to reference a class
03:01 pmichaud thus
03:01 pmichaud $P0 = get_root_namespace ['parrot';'Integer']
03:01 pmichaud $P1 = new $P0
03:01 pmichaud but then when we get to things like :multi(...)
03:02 pmichaud .sub 'foo'  :multi(['ABC'])
03:02 pmichaud I think that we have to treat ['ABC'] as being relative to the current hll namespace
03:02 Whiteknight so not an explicit .sub 'foo' :multi(['parrot';'ABC'])?
03:02 pmichaud we could do that too, but it breaks a lot of existing :multi code
03:02 pmichaud s/too//
03:03 pmichaud i.e., that'd be a significant architectural change.
03:03 Whiteknight does interp cache the current hll namespace?
03:03 pmichaud I think so, yes.
03:03 Whiteknight then for multis it would be easy enough to get that value implicitly
03:04 pmichaud actually, it caches all namespaces up the call chain, iirc
03:04 pmichaud because we can do    $P0 = getinterp     $P1 = $P0['namespace';1]    to determine our caller's namespace
03:06 pmichaud I didn't put this in the ticket, but here's the real example I want to get to work
03:06 pmichaud (typing, then nopasting)
03:06 Whiteknight ok
03:08 Auzon joined #parrot
03:08 nopaste "pmichaud" at 76.183.97.54 pasted "what I really want/need for getclass <namespace>" (25 lines) at http://nopaste.snit.ch/13549
03:08 pmichaud this the same as #56650, but I added HLL stuff to it.
03:09 pmichaud i.e., I want to be able to have code in one hll namespace create a class that exists and works from another HLL namespace
03:09 Theory joined #parrot
03:09 Whiteknight okay, that seems straightforward enough
03:09 pmichaud actually
03:09 pmichaud getting back to your earlier question
03:09 pmichaud 02:54 <Whiteknight> so assuming we were to fix this, would we strip the hll namespace from the namespace object, or prepend the hllnamespace to all other objects?
03:10 pmichaud I wonder if stripping the hll namespace will be sufficient to let my examples work
03:10 pmichaud I know that the hll stuff works if the class is created using a key or resizable PMC array
03:10 pmichaud sorry, ResizableStringArray
03:10 Whiteknight but it doesnt work if we create it using a namespace object, at least, not without some modification
03:11 pmichaud it only doesn't work if created from a namespace.  (But as #56650 demonstrates, it doesn't work even for the case where the namespace is in the same hll as the class creation.)
03:11 pmichaud so yes, stripping the hll namespace object might not take us any closer to solving #43419, but it at least removes #56650 as a Rakudo and other HLL blocker
03:12 Whiteknight hypothetical, what if the class pmc had an additional attribute field reserved for an HLL namespace name
03:12 Whiteknight if provided, it's used, if null, the class is global
03:12 pmichaud it shouldn't need that, really
03:12 pmichaud there's no such thing as a "global" class.
03:12 pmichaud every class has a namespace
03:12 pmichaud and so that namespace will have an hll namespace.
03:12 Whiteknight well, I'm thinking about the simplicity of $P0 = new 'Integer' and the like
03:13 pmichaud even 'Integer'  is really  ['parrot';'Integer']
03:13 pmichaud and I think it's a bit of a mistake for HLLs to assume that 'Integer' would get them to the parrot 'Integer' class.
03:13 Whiteknight ok, i didnt realize that
03:14 pmichaud there aren't that many languages making use of .HLL yet (for precisely these reasons, I suspect)
03:14 Whiteknight I thought there was a lot of work to make .HLL work as advertised
03:15 pmichaud there is.  #43419 really concerns me -- I'm a little bugged that it doesn't concern anyone else yet.  Or maybe they're all sticking-their-head-in-the-sand like me :-)
03:16 pmichaud anyway, this has been hugely helpful.  If you're able to get the strip-the-hll-namespace-from-the-namespace-name to work that'd be, well, fantastic.
03:16 Whiteknight I've got some tuits tomorrow to throw at it
03:16 pmichaud I don't think it would break any existing code -- I doubt anyone else is actually constructing classes from namespaces yet  :-)
03:17 pmichaud anyway, I have to run
03:17 Whiteknight okay, talk to you later
03:17 pmichaud so I'll see you all later
03:22 teknomunk joined #parrot
03:36 dalek r29219 | allison++ | pdd25cx:
03:36 dalek : [pdd25cx] Change the scope of handlers, so they're always local to the current
03:36 dalek : context.
03:36 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29219
04:56 dalek r29220 | cotto++ | trunk:
04:56 dalek : [pmc] Add a freeze/thaw test case.  This one passes.
04:56 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29220
05:06 cotto_home is there any reason not to implement get_string for fixedbooleanarray such that it returns a string of zeros and ones?
05:22 cotto_home it definitely makes testing easier
05:22 Psyche^ joined #parrot
05:35 dalek r29221 | cotto++ | trunk:
05:35 dalek : [pmc] Added get_string method and freeze/thaw tests.  All pass.
05:35 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29221
05:45 Theory joined #parrot
06:34 uniejo joined #parrot
06:35 UltraDM joined #parrot
07:05 jan joined #parrot
08:12 iblechbot joined #parrot
08:18 TiMBuS joined #parrot
09:08 dalek r29222 | bernhard++ | trunk:
09:08 dalek : [codingstd] Add spaces after comma.
09:08 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29222
09:33 Ademan joined #parrot
09:41 Whiteknight joined #parrot
09:53 dalek r29223 | fperrad++ | trunk:
09:53 dalek : Fix t/src/extend.t failures.
09:53 dalek : r29171 introduces Parrot_vfprintf(), so we need to #include <stdarg.h>
09:53 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29223
10:32 jonathan pmichaud: (for scrollback) Just been catching up with some other (non-Rakudo) stuff this morning that I didn't get to last night; going to hack on some non-signatures stuff for now. Ping me when you're about - maybe we can work on parts of it together, or something.
11:24 ruoso joined #parrot
11:29 bacek joined #parrot
11:51 barney joined #parrot
12:00 Whiteknight joined #parrot
12:13 dalek r29224 | bernhard++ | trunk:
12:13 dalek : [Pipp] 'make pipp' now correctly depends on 'make build-common'.
12:13 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29224
12:13 dalek r29225 | Whiteknight++ | gsoc_pdd09:
12:13 dalek : [gsoc_pdd09] update to trunk r29223
12:13 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29225
12:51 dalek r29226 | bernhard++ | trunk:
12:51 dalek : [Getopt::Obj] Some beautifications.
12:51 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29226
13:17 moritz php?
13:17 purl php is really badly designed or swahili for "child molestor" or  Philippine pesos or PHP: Hardly Programming or brought to you by the teletubbies or proof there is no god or http://xrl.us/t6wx or the little transgender brother of perl or http://tnx.nl/php or easy or was better when it was a templating system or blamed on Rasmus Lerdorf... or the preferred method of delivering MySQL errors to web browsers
13:21 jonathan ...wow!
13:27 moritz purl: php is also the worse-is-better approach taken to to dazzling new depths
13:27 purl i'm sorry, but that's too long, moritz
13:27 moritz sad
13:37 paco joined #parrot
13:39 jhorwitz joined #parrot
13:49 gryphon joined #parrot
13:52 dalek r29227 | bernhard++ | trunk:
13:52 dalek : [Pipp] Option 'd' is a Hash. Remember the settings from the 'd'-option.
13:52 dalek : Implement 'ini_get'. Pass test 4 of the spectests.
13:52 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29227
13:59 davidfetter joined #parrot
14:17 dalek r29228 | bernhard++ | trunk:
14:17 dalek : [Pipp] Start with ini_set() and with $php_errormsg.
14:17 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29228
14:38 gmansi joined #parrot
14:38 gryphon joined #parrot
14:41 iblechbot joined #parrot
14:44 rdice joined #parrot
14:48 gmansi joined #parrot
14:59 pmichaud NotFound: ping
15:07 dalek r29229 | cotto++ | trunk:
15:07 dalek : [codingstd] wrap macro args
15:07 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29229
15:08 NotFound pmichaud: pong
15:08 dalek r29230 | cotto++ | trunk:
15:08 dalek : [codingstd] wrap macro args in src/jit/sun4/jit_emit.h
15:08 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29230
15:09 dalek r29231 | jonathan++ | trunk:
15:09 dalek : [rakudo] First crack at starting to get named enums in place. This sets up a role, a class, and puts instances of it (for the enum values) into the right places. It introduces an Enum base class for all enumerations also. This doesn't let us do a lot useful with them yet, but it's the first step. If this turns out to be a good base to build the rest on, what I'm checking in now will undoubtably get clean-up to eliminate a few bits of inline PIR; for now, it
15:09 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29231
15:10 jonathan Overlength commit message dalek fail!
15:11 pmichaud NotFound:  (RT #56750)  -- it seems to me as though this code is replacing what is currently a constant hash lookup with creation of new gc-able elements for every declaration of an empty string
15:11 pmichaud Am I reading it wrong?
15:12 particle jonathan: that's a bug, for sure, but... can't you use multiple lines in your commit messages?
15:12 pmichaud I typically do:
15:12 pmichaud [rakudo]  <summary line>
15:12 pmichaud * more details
15:12 pmichaud * more details
15:12 cotto_home if I'm going to be making a bunch of changes to wrap macro args, should I commit one file at a time to make bisection easier, or just do them all at once?
15:12 * particle too
15:12 NotFound pmichaud: I looked at const_string code, and it does a hash lookup and creates and populates a new string with a copy of the result.
15:12 moritz that's what makes it easier for git users
15:13 particle cotto_home: dir at a time might be a good compromise
15:13 jonathan particle: I just write them on the command line, rather than it opening a text editor...
15:13 NotFound Just creating the string is short and faster.
15:13 cotto_home particle: sounds good
15:13 particle jonathan: ah, i use tortoisesvn's utility
15:13 pmichaud NotFound: I see that it does the hash lookup, but I don't see that it creates/populates a new string with the copy of the result
15:14 NotFound pmichaud: it calls string_make_direct
15:14 pmichaud yes, but only once per constant string
15:14 jonathan particle: I think there's some environment variable I could configure...but normally I do small enough commits (deliberately) to not have so much to say. :-)
15:15 pmichaud subsequent calls to const_string for the same constant string will re-use the string it created in previous calls
15:15 dalek r29232 | cotto++ | trunk:
15:15 dalek : [codingstd] wrap macro args in  src/jit/skeleton/jit_emit.h
15:15 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29232
15:15 pmichaud (I should say once per constant string value per interpreter)
15:16 pmichaud jonathan++  # working on enum classes
15:16 pmichaud jonathan: (re: signatures)   after yesterday's conversations I'm a little burned out on lexicals, signatures, and the like so I'm taking a bit of a break this morning.
15:16 NotFound pmichaud: mmmm... then I don't understand at all how it works.
15:17 pmichaud NotFound:  interp->const_string_hash is a cache
15:17 jonathan pmichaud: I can only imagine...break++.
15:18 pmichaud the first time we call const_string with "" as the buffer argument, the hash lookup fails and so we use string_make_direct to create a new STRING instance, store it in the cache, and return it
15:18 pmichaud subsequent calls to const_string with "" as the buffer argument will then find the string in the hash and return it directly, without creating a new one
15:19 NotFound pmichaud: yes, but returning the string header directly exposes it to external modifications.
15:19 pmichaud ...except it's a constant.
15:19 pmichaud if something is modifying it, that's a bug in the caller.
15:22 NotFound pmichaud: that is another problem, the string struct is exposed, and is directly modified from a lot of places.
15:22 pmichaud the string struct is modified for things created using const_string?
15:22 NotFound pmichaud: given some recent tickets, I'm almos sure it is.
15:22 pmichaud I'm almost certain it isn't.  :-P
15:23 pmichaud but pick one and I'll analyze it.  I suspect what is happening is that someone is modifying a string register that isn't properly cloned.
15:25 NotFound Probably, but in that case someone is modifying a const string, it isn't?
15:27 pmichaud sure, but the solution is to get them to not modify the constant string, not to fix Parrot so that strings are no longer COW or shared
15:27 NotFound pmichaud: ok, I agree to reject the ticket and keep working in the problems.
15:36 jq joined #parrot
15:39 pmichaud jonathan: do we need a separate Enum class?  I somewhat figured that enums were just roles.
15:39 pmichaud (I'm asking only for elucidation, not because I think it's necessarily wrong.)
15:42 jonathan pmichaud: The way S12 writes it, enums do everything excluding world peace... They can act as a role, but are in fact a kind of class. I'm not 100% sure about the Enum class yet, but it ain't really important and will be easy to be rid of if it's wrong. It is a convenient place to be able to stick some stuff that all enums will implement (though there are other ways to do that) and I figure you'd maybe want to be able to say Bool ~~ Enum and get true.
15:42 jonathan It's probably something to get a clarification on.
15:43 pmichaud okay
15:43 dalek r29233 | bernhard++ | trunk:
15:43 dalek : [codinstd] remove trailing spaces
15:43 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29233
15:43 jonathan But we could just switch to inheriting from Any and get the few methods from elsewhere.
15:43 pmichaud I often have difficulty with the role/class distinction in general.
15:44 jonathan Same.
15:44 pmichaud doesn't the "enum" statement somewhat indicate the base type?
15:44 jonathan But S12 says "An enum is a low-level class that can function as a role or property."
15:44 jonathan It indicates the type of the property.
15:44 pmichaud IIRC, TimToady made a statement somewhere that properties are just roles
15:44 jonathan Right.
15:44 moritz that's because the specs aren't clear about what builtin types are roles and what are classes
15:45 jonathan A property is a role with one attribute, pretty much.
15:45 dalek r29234 | julianalbo++ | trunk:
15:45 dalek : Clean some unreachable code warnings
15:45 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29234
15:45 * particle has a feeling that implementation will inform the spec writer here
15:45 jonathan particle: I found the enums part of the spec quite wolly, tbh.
15:46 particle wolly?
15:46 jonathan *woolly
15:46 dalek r29235 | cotto++ | trunk:
15:46 dalek : [codingstd] wrap macro args in src/jit/ppc/jit_emit.h
15:46 jonathan Is that how you spell it? Maybe it's excessively Britt English. :-)
15:46 dalek : now down to 1819 failures of macro arg test
15:46 pmichaud but if I have   my enum Day <Sun Mon Tue ...>   then isn't Day really a subclass of Int ?
15:46 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29235
15:47 pmichaud or is that not what is meant by "default type"?
15:47 jonathan I can't see how it could work that way.
15:47 jonathan Because it's a property too.
15:47 jonathan A property being of type Int actually means that the attribute in the role defining that property has type Int
15:47 pmichaud okay.
15:49 jonathan So when you say "$x but True" you're adding an attribute of type bit to $x
15:50 jonathan ...when we have attributes of type bit, at least. :-)
15:50 NotFound What is the purpose of: if (0 && GC_DEBUG(interp) ) ?
15:51 pmichaud is it more precise to say  "$x but True"  adds an attribute 'bool' of type bit to $x ?
15:51 jonathan Yes.
15:51 jonathan And also accessor method named bool
15:51 jonathan Well, the attribute is really called $!bool.
15:53 pmichaud so,   "our bit enum bool <True False>"   creates a role, that role has a "$!bool" attribute and a "bool" accessor
15:54 pmichaud ?
15:54 pmichaud (and the role's name is 'bool')
15:55 moritz lots of bools around here ;)
15:55 jonathan The first statement is true.
15:56 jonathan The second is not, because while we need a role (so we can compose it into stuff), bool itself is a class (implying what is in the namespae under bool is a class).
15:56 jonathan Thus the role, under the current implementation, is anonymous.
15:57 jonathan And composed into the class bool
15:57 pmichaud namespaces can't have roles?
15:58 jonathan The slot can hold a class or a role.
15:58 pmichaud so why does bool itself need to be a class?
15:59 jonathan The specification says it is; additionally, the enum values are instances of this class.
15:59 jonathan And you can't instantiate a role.
15:59 pmichaud S12:1773 says:  Note that C<bool> and C<taint> are really role names.
16:00 particle jonathan: a class of the same name is automagically created if you try to instantiate a role
16:01 jonathan Hmmm...mabye I've got this the wrong way around and the class should be anonymous and the role has the name.
16:01 particle that's how i see it
16:01 jonathan That can probably work too...
16:02 pmichaud S12:2037 says
16:02 pmichaud When the typename happens to be a role, autovivifying it involves
16:02 pmichaud attempting to create a punned class of the same name as the role.
16:03 jonathan OK
16:03 jonathan Then it likely should be the other way around...good catch.
16:03 jonathan (And no real hassle to do it that way instead.)
16:04 pmichaud yes.  The introduction of an Enum class (where the spec doesn't mention one) kinda threw me for a bit.  :-)
16:04 jonathan OK, I expect that can disappear.
16:04 jonathan OK, I'll get those shuffled around.
16:05 jonathan Thanks for the clarification/feedback.
16:10 dalek r29236 | julianalbo++ | trunk:
16:10 dalek : Clean other unreachable code warning
16:10 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29236
16:15 Theory joined #parrot
16:22 dalek r29237 | bernhard++ | trunk:
16:22 dalek : [Pipp] add test of backslashes in single quoted strings.
16:22 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29237
16:23 Andy joined #parrot
16:27 dalek r29238 | bernhard++ | trunk:
16:27 dalek : [Pipp] Use the default variant, PCT, for spec-testing.
16:27 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29238
16:37 gryphon_ joined #parrot
17:06 Whiteknight joined #parrot
17:13 davidfetter joined #parrot
17:25 dalek r29239 | chromatic++ | gsoc_pdd09:
17:25 dalek : [Rakudo] Brought Rakudo up to date with latest changes in concurrency branch.
17:25 dalek : Now it compiles and passes most of the sanity tests.  (It looks like the
17:25 dalek : operator precedence parsing bug is responsible for most of the failures.)
17:25 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29239
17:26 apple-gunkies joined #parrot
17:30 dalek r29240 | Whiteknight++ | gsoc_pdd09:
17:30 dalek : [gsoc_pdd09] update to trunk r29238
17:30 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29240
17:36 jonathan Hmm. If you override the invoke v-table method, self doesn't get passed in.
17:36 AndyA joined #parrot
17:36 Ademan joined #parrot
17:39 pmichaud jonathan: correct -- this is a known misfeature
17:39 pmichaud Whiteknight was working on it last week, iirc.
17:40 jonathan Grr. I kinda need that to work. :-S
17:40 jonathan Wonder if I should task-steall...
17:40 jonathan Whiteknight: ping
17:40 pmichaud I'm quite certain that Whiteknight would welcome any advice or assistance you can provide.  :-)
17:40 pmichaud I'll look for our irc log conversation from last week
17:40 jonathan I'm still pondering the best way to do it...
17:46 pmichaud looks like we started the discussion at http://irclog.perlgeek.de/​parrot/2008-07-03#i_379876
17:49 jonathan Thanks, reading through it...
17:49 Eevee joined #parrot
17:50 jonathan It's easy enough to get us the invocant passed, it's getting the invocant passed _and_ preserving the other arguments that are passed that is tricky.
17:51 jonathan pmichaud: Agree with you it's not an IMCC level issue.
17:52 Whiteknight i'm here
17:53 Whiteknight I was working on it, set up branches/vtable_has_self
17:53 Whiteknight but haven't made much progress because I dont understand argument passing
17:54 jonathan Whiteknight: For every v-table override other than invoke, we do something like Parrot_run_meth_fromc_args(interp, meth, pmc, meth_name, "P");
17:54 jonathan Note that we invoke the PIR method and pass along "pmc" - the current PMC instance, which becomes the object.
17:55 jonathan In invoke we don't do that because we want to let the invokee handle the arguments.
17:55 dalek r29241 | chromatic++ | pdd25cx:
17:55 dalek : [Rakudo] Updated exception-throwing code to use the most appropriate Parrot
17:55 dalek : function (s/real_exception/Parrot_ex_throw_from_c_args/); this time really in
17:55 dalek : the pdd25cx branch.
17:55 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29241
17:56 jonathan Apart from, this doesn't quite work out, because we don't get a chance to insert the invocant in.
17:56 jonathan The invoke vtable method has it, but doesn't put it into the args of the invoked PIR sub.
17:57 pmichaud ahhhhh
17:57 pmichaud and so an invoke vtable method in PIR doesn't have a way to get at the arguments
17:58 pmichaud i.e.,  we could do   $P0(arg1,arg2), but the invoke vtable method doesn't have a way to get at the arguments, because invoke is always   invoke_p
17:58 pmichaud does that sound even close to right?
17:59 jonathan No; $P0(arg1,arg2) will invoke the PIR override for invoke with just those two parameters.
18:00 jonathan The problem is that it should invoke the PIR override with three parameters: the first parameter should be self, followed by the other two.
18:00 jonathan Basically, we need to "splice" another argument into the call.
18:00 pmichaud vtable_invoke takes a variable number of aprameters?
18:00 pmichaud are there any other vtable methods that do that?
18:00 jonathan vtable_invoke doesn't care about the parameters at all
18:00 jonathan invoke generally doesn't do anything parameter related
18:01 pmichaud right, exactly
18:01 pmichaud it's always invoke_p
18:01 jonathan The get_params opcode in the sub is what starts the paramter getting.
18:01 jonathan The invoke vtable method in object just passes control on to the PIR override method.
18:01 pmichaud let me go by way of analogy
18:02 pmichaud if I override get_boolean in PIR, then I get 'self' and nothing else.  period.  If I put an extra .param statement in the PIR vtable, it's an argument mismatch.
18:02 pmichaud because get_boolean doesn't take any arguments.
18:02 jonathan No, not quite
18:03 jonathan There two different types of argument going on here.
18:03 pmichaud yes, exactly
18:03 jonathan The C ones, and those that PIR cares bout
18:03 jonathan So normally, for every other override, there was no set_args before it.
18:03 pmichaud there are the arguments to the vtable invocation itself, and then there are the PIR arguments set up by set_args and get_args
18:03 jonathan The argumetns were given to C.
18:04 jonathan So from C, we run the PIR and pass the args the C vtable method received, along with the invocant.
18:04 pmichaud right
18:04 pmichaud but since the C vtable method for invoke doesn't get any arguments...
18:04 jonathan In vtable invoke, the C doesn't get any of the args from the PIR. All invoke does, in reality, is changes the program counter to point at the PIR instruction that is the start of the sub.
18:04 pmichaud we're saying the same thing.
18:05 jonathan Right.
18:05 pmichaud except
18:05 pmichaud I'm saying that if we fix it so that :vtable('invoke') gets the PIR arguments, that's a somewhat substantial departure from how the other :vtable methods work.
18:05 pmichaud because none of the other vtable methods do that.
18:06 jonathan There aren't any PIR arguments for other vtable methods.
18:06 pmichaud right.
18:06 jonathan But invoke needs to be different in some sense.
18:06 jonathan Because otherwise, how does it actually get hold of the PIR args?
18:07 pmichaud yes, I guess I'm questioning whether we really want it to be different.  (And I misspoke earlier -- it's _already_ different, it's just incompatibily different)
18:08 jonathan $P0(x, y) - we'd like the v-table override not just to be able to get hold of the self, but also the x and the y, I guess?
18:08 pmichaud I agree that without doing something like this there's not an easy way to get at the PIR args, short of doing our own .pcc statements.
18:08 pmichaud can we build a new set of PIR arguments from the existing ones?
18:08 jonathan Well, the bigger problem is that even invoking the other PIR method would then clobber the arguments of the original call.
18:09 jonathan You mean with self unshifted onto the start?
18:09 pmichaud yeah
18:09 jonathan That's what I think we need to do.
18:09 jonathan Unfortunately, I don't see a trivial way to do it.
18:09 pmichaud I agree.
18:10 pmichaud however, since we expect to be substantially modifying the calling conventions anyway, perhaps we should open a ticket for the new calling conventions and then make this issue a dependency on that
18:10 jonathan I mean, I've got a good idea of one way to do it, which is to fake getting the args as slurpies, then setting up a new call...
18:10 pmichaud well, except for the fact that you need :vtable('invoke') today, apparently :-(
18:10 jonathan I can hack around the current situation.
18:11 jonathan It's going to stop me getting one small bit of enums working.
18:11 pmichaud I should probably grab allison's PCC message from the mailing list and turn it into a ticket
18:11 pmichaud so I can attach other tickets that depend on it
18:11 particle can you munge and tailcall to avoid a frame?
18:11 jonathan Like, they can act as a simple argumentless function.
18:11 dalek r29242 | julianalbo++ | trunk:
18:11 dalek : Another unreachable warning, codingstd in jit_emit ppc
18:11 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29242
18:11 jonathan particle: Going and diddling the signature is one other option. :-)
18:12 pmichaud perhaps you could override invoke but get self from the interp ?
18:12 particle is self stored in interp?
18:12 pmichaud since it's a sub in this case, yes.
18:12 jonathan sub.pmc puts current_object into the context and clear it in the interp.
18:12 Whiteknight I tried to splice in a "self" argument, but I dont know how to do that
18:12 particle ah. hrmm.
18:12 jonathan At the point the sub is invoked.
18:12 Whiteknight (sorry about the delay, you guys talk fast and I had to backlog)
18:13 pmichaud I thought that the interp always had a reference to the current executing sub
18:13 pmichaud for vtable invoke, self is the current executing sub
18:13 particle interp->current_ctx
18:13 pmichaud i.e., in   $P0(1,2)    self would end up being $P0
18:14 pmichaud oh, wait
18:14 pmichaud hrm.
18:14 jonathan The currently executing sub is the vtable override if the object that $P0 is an...right.
18:14 jonathan s/if/of/
18:14 jonathan I wonder if...
18:14 Whiteknight NO!
18:15 Whiteknight sorry :)
18:15 * jonathan attempts great, great evil
18:16 Whiteknight .me gets his garlic and cruciifx ready
18:24 * particle wonders if Coke is watching
18:28 jonathan OK, it's not so easy as I'd hoped...I think we can runtime-patch the signature, though.
18:28 jonathan But what I was going to do will likely get us a memory leak.
18:29 Whiteknight I was thinking we could ferret away a self pointer somewhere, like a new field in the interpreter struct for this purpose
18:30 Whiteknight if it's not null, use it as the first parameter, if it is null (as it would be most of the time) use parameters like normal
18:30 jonathan Yeah
18:30 Whiteknight a bit of a hack, but it solves our problem
18:30 jonathan I'm coming around to that idea too.
18:30 jonathan Well, maybe we want to have a flag in the signature that says "get the current object from the context and use it as the parameter here".
18:30 Whiteknight maybe create an [add|get|_self opcodes to set this field for method and vtable calls
18:31 jonathan Nah, I don't think we want to add opcodes.
18:31 Whiteknight true, but how would we set that flag? in the invoke opcode?
18:31 jonathan Yeah
18:31 jonathan Diddle the signature object.
18:34 jonathan It's still a fair bit of work I think to do that though, or at least to get it stable enough to work reliably.
18:35 Whiteknight So where do we even start? We've got that branch set aside to play in, but this is far outside my realm of expertise
18:35 Whiteknight and I'm certainly willing to do the work if I had some guidance about where/how to do it
18:35 jonathan OK
18:36 pmichaud Whiteknight: maybe fix my hll namespace problem first?  ;-)
18:36 pmichaud or I can work on that one.
18:36 jonathan So we have an arguments signature.
18:36 moritz Whiteknight: don't you have a soc project to finish? ;-)
18:36 jonathan It can be in the bytecode, or it can ge in the interp structure.
18:36 jonathan If it's referenced from the bytecode, it needs a lookup in the constants table.
18:37 jonathan Find it from wherever, then clone it. Then unshift onto it something (see PDD3 for flag values) that indicates it's a PMC, then add another flag to say it should be sourced from the current_object in the context.
18:38 jonathan Oh, before you can unshift it, switch it's vtable to be ResizableIntegerArray. As you can't unshift onto a fixed one.
18:38 jonathan Then stash that in interp->current_args
18:39 dalek r29243 | pmichaud++ | trunk:
18:39 dalek : [rakudo]: spectest-progress.csv update: 94 files, 1679 passing tests
18:39 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29243
18:39 jonathan Then hack inter_call.c to recognize this flag in the signature and get the object from the current_object in the context.
18:39 jonathan And in theory it maybe, just maybe, will work!
18:41 pmichaud and in reality it will definitely, definitely, be an ugly hack (no offense)  :-)
18:41 Whiteknight I have a lot of projects to work on
18:42 moritz Whiteknight: we should clone you ;)
18:42 Whiteknight what I need is a third computer here and two more hands
18:43 * pmichaud deals ten cards to WhiteKnight.
18:43 * Whiteknight checks, no gin rummy
18:44 jonathan pmichaud: If you can think of something better... ;-)
18:45 pmichaud my "better" is long-term and involves re-thinking PCC altogether  :-)
18:45 jonathan Anyway, I don't have the energy to try that today, nor the motivation..
18:45 pmichaud agreed :-)
18:45 jonathan I'll work around it for now.
18:45 clunker3 joined #parrot
18:45 jonathan I really want to get a basically working-ish enums implementation before the end of the day.
18:46 Whiteknight focus on that, I'll monkey around quietly on this vtable invoke nonsense
18:46 pmichaud that would be outstanding
18:47 Ron joined #parrot
18:47 NotFound Looks like the const_cstring_hash is never marked as live. Is this intentional for some reason?
18:48 dalek r29244 | jhorwitz++ | trunk:
18:48 dalek : add tests for switch statement (WTF?/OMG/OMGWTF)
18:48 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29244
18:49 Whiteknight lolcode commit messages are the best
18:49 * jhorwitz needs to remember to prefix his commits with [language]
18:51 * particle slaps the honorable gentleman from King of Prussia
18:52 jhorwitz good show, good show
18:53 dalek r29245 | tene++ | trunk:
18:53 dalek : [lolcode]
18:53 dalek : MANIFEST and svn metadata.
18:53 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29245
18:53 Tene purl: karma tene
18:53 purl tene has karma of 99
18:53 Tene That's a nice number.  Maybe I should stop here.
18:54 particle tene--
18:54 Tene Crap.
18:54 particle :)
18:54 Whiteknight he's from KOP?
18:55 particle yep, he was born in the mall parking lot.
18:55 Whiteknight well, if you have to be born somewhere...
18:58 jhorwitz i used to live in the arcade
18:58 * jhorwitz will work for quarters
18:58 Whiteknight I'm right down the road from there, we could hang out and have slumber parties and stuff
18:58 * particle is currently working for a KoP-based client
18:58 jhorwitz if by slumber parties you mean go out and drink beer, that works
18:59 Whiteknight yeah, i suppose that's the adult version of the same concept
18:59 particle Whiteknight: what uni you at?
18:59 Whiteknight Temple, technically
18:59 jhorwitz where are you living now?
19:00 particle good engineering school
19:00 Whiteknight Malvern
19:00 jhorwitz wow.
19:00 particle are you closer to vanguard, or lockmart?
19:00 jhorwitz right down the road
19:00 Whiteknight vanguard
19:00 purl vanguard is probably receiving 150k to run the business for the next 3 days
19:01 * particle worked there 5 years ago
19:01 jhorwitz and then particle abandoned us
19:04 Theory joined #parrot
19:06 Theory joined #parrot
19:10 cj joined #parrot
19:10 cj Andy: I was wondering if you IRC'd any more.  I guess you just can't stand #perl anymore :)
19:12 dalek r29246 | jonathan++ | trunk:
19:12 dalek : [rakudo] Shuffle enums around a bit so that the role is named and the class anonymous. Get rid of Enum class since it's not spec'd and we can do find without it. Also make instances of the enum class act more value like, so you can say EnumMember to get the underlying value of EnumMember.
19:12 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29246
19:16 moritz jonathan: rakudo doesn't seem to parse $stuff but Enum - how do you use roles now?
19:17 jonathan jonathan: but is not implemented yet.
19:17 jonathan but it's next on my todo list ;-)
19:17 jonathan But you can do it with "does"
19:17 moritz ok
19:17 jonathan I think that does work now.
19:17 moritz and I guess that's how you test it right now?
19:19 dalek r29247 | Whiteknight++ | gsoc_pdd09:
19:19 dalek : [gsoc_pdd09] Add bad hack around my absurd-pointer-dereferencing problem. Solves one problem but causes/exposes a new problem
19:20 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29247
19:20 jonathan Aye, if it works. ;-)
19:23 moritz jonathan: I just added t/spec/S12-enums/as-role.t  - one pass, one failure
19:25 moritz jonathan: does the test look sane to you?
19:27 jonathan moritz: Led me nyam my dinner, and I'll get back to you on that in 10-15 mins. :-)
19:27 moritz jonathan: no hurry ;)
19:37 jonathan moritz: It doesn't quite work like that. :-)
19:38 jonathan .no tests if the current value of the maybe property is set to no.
19:38 dalek r29248 | pmichaud++ | trunk:
19:38 dalek : [rakudo]:  add 'polar' to Complex and Any (RT #56754, moritz++)
19:38 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29248
19:42 Ademan_ joined #parrot
19:47 nopaste "jonathan" at 85.216.151.226 pasted "moritz: this seems to be working - is expected output" (10 lines) at http://nopaste.snit.ch/13551
19:49 moritz jonathan: I'll adopt that into my test, thanks
19:49 Tene So, lolcode's case statments have fallthrough like C's.
19:49 Tene According to spec 1.2
19:49 Tene Any ideas on how to represent this in PCT?
19:50 jonathan moritz: Also, my $x = 42; $x does Maybe(Yes); say $x.No; say $x.Yes; say $x.No; # 0 1 0
19:50 jonathan moritz: So runtime mixing in works too. Now for but... :-)
19:51 jonathan moritz: Also note, there is some issue with does on a string - to do with it being a PMC rather than a PDD15 class, I think.
19:51 Andy Me?
19:51 purl it has been said that Andy is the man with the feathered broom or mailto:andy@petdance.com or AIM:petdance or OK cat-xeger is BACK or trying to get Sun Studio 12 installed so I can lint lint lint.
19:52 Tene Me?
19:52 purl i think Tene is Stephen Weeks
19:52 moritz me?
19:52 purl you are, like, right, there are a LOT of things like that
19:52 Andy cj: I don't hang out in #perl, but I am in #perl++ and others.
19:52 cj ooh, didn't know there was a #perl++
19:53 jonathan me?
19:53 purl you are mailto:jnthn@jnthn.net
19:53 jonathan How boring!
19:53 jonathan (but correct)
19:53 moritz jonathan: $x does Maybe(1); works. $x does Maybe(yes) doesn't
19:55 jonathan Oh?
19:55 moritz too few arguments passed (0) - 1 params expected
19:55 moritz current instr.: '_block47' pc 830 (EVAL_17:205)
19:55 moritz I'lll submit it as a test in a few moments
19:56 jonathan moritz: Hmm?
19:56 jonathan enum Maybe <No Yes>;
19:56 jonathan my $x = 42; $x does Maybe(Yes); say $x.Maybe; say $x.No; say $x.Yes;
19:56 jonathan 1
19:56 jonathan 0
19:56 jonathan 1
19:56 dalek r29249 | rblasch++ | trunk:
19:56 dalek : [perl #47153] Added PMC_is_null to, well, test if PMC is null.
19:56 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29249
19:56 moritz jonathan: ah, I used lower case names
19:57 jonathan Ah.
19:57 moritz that could be the differences
19:57 particle perl6: enum Maybe <No Yes>; my $x = 42; $x does Maybe(Yes); say $x.Maybe; say $x.No; say $x.Yes;
19:57 polyglotbot OUTPUT[Statement not terminated properly at line 1, near "Yes>; my $"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;eat_terminator' pc 20609 (src/gen_grammar.pir:2813)␤called from Sub
19:57 polyglotbot ..'parrot;Perl6::Grammar;statementlist' pc 19622 (src/gen_grammar.pir:2450)␤called fr...
19:58 jonathan moritz: Yeah, I think it is. We don't have a class registry yet, so rely on typename rule only detecting uppercase variants.
19:58 jonathan It's wrong, but not a bad heuristic...well, often.
19:59 contingencyplan joined #parrot
19:59 jonathan particle: polyglotbot is probably out of date.
19:59 Tene It is.
19:59 particle probably
19:59 Tene It's not updating and I don't know why.
19:59 Tene Want me to update it now?
20:00 particle sure
20:00 particle can you do that via msg?
20:00 Tene Not yet.
20:00 particle polyglotbot: control update
20:00 Tene That certainly would be nice.
20:00 Tene Okay, it's updating, but the rebuild isn't happening, it looks like.
20:01 particle polyglotbot: get a hold of yourself!
20:01 Tene building now
20:07 dalek r29250 | julianalbo++ | trunk:
20:07 dalek : DOD_registry handling simplified, RT#56678
20:07 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29250
20:08 dalek r29251 | moritz++ | trunk:
20:08 dalek : [rakudo] add first enum test to spectest_regression (+9 pass)
20:08 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29251
20:09 cotto_work would it be proper for the new PMC_is_null macro to also check if pmc->vtable->base_type is enum_class_Null?
20:10 donaldh joined #parrot
20:12 cotto_work s/macro/function/
20:12 NotFound cotto_work: in that case, it must first check for pmc->vtable
20:13 * particle recalls ripping out PMC_is_null macros some time ago
20:15 NotFound By the way I don't see the need for the interpreter argument.
20:15 dalek r29252 | Whiteknight++ | gsoc_pdd09:
20:15 dalek : [gsoc_pdd09] fixed bounds for the sweep loop. Sweep code was incorrectly assuming index numbers were 1-based instead of 0-based. Fixed one problem, exposed a new segfault somewhere else. chromatic++ for the insight.
20:15 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29252
20:16 cotto_work NotFound, cargo cult?
20:16 Whiteknight wikipedia: "Cargo cult"
20:16 purl "Cargo cult" is one of Citizen_X's favorite hacker jargon terms
20:18 donaldh Does win32 have JIT support?
20:18 cotto_work cargo cult is a style of computer programming that is characterized by the ritual inclusion of code or program structures that serve no real purpose.
20:18 cotto_work purl, cargo cult is a style of computer programming that is characterized by the ritual inclusion of code or program structures that serve no real purpose.
20:18 purl ...but cargo cult is programming by putting together bits of code the programmer doesn't really understand. See: http://en.wikipedia.org/wi​ki/Cargo_cult_programming...
20:19 cotto_work d'oh.  step 1: look.  step 2: leap.
20:19 NotFound And by other way, I think to maintain the possibility of using NULL as PMCNULL is unusefull, NULL can't throw exceptions when used.
20:19 particle donaldh: yes
20:20 particle donaldh: it's one of the few platforms that does have jit
20:20 donaldh hmmm. The jit test is SEGVing on cygwin on Vista.
20:21 particle i don't know if cygwin has jit
20:21 Whiteknight yeah cygwin really isn't the same as vanilla Win32
20:22 donaldh So by Win32 do you mean Microsoft Visual C or MinGW or does it not matter?
20:22 particle msvc
20:22 particle x86
20:23 dalek r29253 | julianalbo++ | trunk:
20:23 dalek : Allow check for nullness of const PMCs
20:23 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29253
20:23 donaldh What magic does jit require for it to work?
20:24 NotFound donaldh: be able to create chunks of memory with execute permissions, mainly.
20:24 particle see docs/jit.pod
20:24 donaldh thanks.
20:24 particle and docs/dev/jit_i386.pod, etc
20:26 NotFound The PMC_is_null signature disliked my g++ build, fixed.
20:30 Tene pmichaud: do you have plans to fix the \past thing in --target=past?
20:33 donaldh is it possible to run a single configure step and save the temporary files?
20:33 donaldh I've tried using --verbose-step but can't get enough info.
20:33 particle what info do you need? the generated .c/.h/.o files?
20:34 particle the output files from the compiler aren't enough?
20:34 particle .cco .ldo etc
20:34 jonathan moritz: I can haz but tests? ;-)
20:34 donaldh yep, the generated files.
20:35 donaldh I think.
20:35 dalek r29254 | jonathan++ | trunk:
20:35 dalek : [rakudo] Implement the but operator. To get it resolving enums correctly, we also mark the enum anonymous class with the 'enum' property; we may find a better way later.
20:35 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29254
20:35 particle donaldh: you may need to change something in Parrot::Configure::... in order to keep the generated files around
20:35 moritz jonathan: S12-enums/basic.t  ?
20:35 particle kid51 is the best one to ask about that, if you can't find it yourself
20:35 particle probably in cc_build or cc_gen methods
20:35 donaldh particle: thanks, I'll take a look.
20:36 moritz it doesn't seem to parse 'but Day::Mon'
20:36 jonathan moritz: I fear that is more typename confusion. :-(
20:36 jonathan "but Mon" should work
20:37 moritz oh wait
20:37 moritz forgot to rebuild :/
20:37 jonathan Oh!
20:37 * moritz shuts up
20:37 * jonathan hopes Day::Mon works
20:37 moritz The but operator can only be used with a role or enum value on the right hand side
20:38 moritz with 'but Day::Mon'
20:38 moritz and 'invoke() not implemented in class 'Role'' for Day(Mon)
20:38 jonathan Oh?
20:38 moritz it tries to call Day() with one argument
20:38 jonathan enum Maybe <No Yes>;
20:38 jonathan my $x = 0 but Maybe::Yes; say $x; say $x.Maybe
20:38 jonathan 0
20:38 jonathan 1
20:40 moritz oh, I used a Str in this test
20:40 moritz I wrote that before you told me not to
20:40 dalek r29255 | rblasch++ | trunk:
20:40 dalek : [perl #43438] Align win32/stat.c with generic/stat.c.
20:40 dalek : This also makes t/pmc/io.t "stat failed" work on Windows.
20:40 jonathan Ah.
20:40 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29255
20:40 jonathan Yeah, should add some test to the "does" tests for that and todo them, I guess.
20:41 moritz jonathan: and implement .does()
20:41 moritz ;)
20:42 jonathan Hmm, that'd probably be good to have. ;)
20:42 moritz oh, and my $x = 3 but Day::Mon;
20:42 jonathan moritz: Just working the the pseudo-functional form of but now.
20:42 moritz reports type '' for $x in error messages
20:42 moritz and when I smartmatch against it, it says Method 'ACCEPTS' not found for invocant of class ''
20:43 dalek r29256 | tene++ | trunk:
20:43 dalek : [lolcode]
20:43 dalek : * Add comparison operators.
20:43 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29256
20:43 dalek r29257 | tene++ | trunk:
20:43 dalek : [lolcode]
20:43 dalek : * Switch support
20:43 dalek : * Minor grammar cleanup
20:43 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29257
20:43 dalek r29258 | tene++ | trunk:
20:43 dalek : SVN props on new lolcode builtins file.
20:43 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29258
20:43 jonathan moritz: Smart-match I know isn't done yet.
20:43 jonathan Hmm...why on earth does it harm the proto-object...
20:43 jonathan Or our tying to it...
20:43 Tene I cheated and made it behave like if/else instead of C's switch.
20:44 moritz jonathan: does the 'but' operator create an anonymous type?
20:44 moritz > enum Day <Sun Mon Tue Wed Thu Fri Sat>; my $x = 3 but Day::Mon; say $x.WHAT
20:44 moritz Null PMC access in find_method()
20:44 purl i heard Null PMC access in find_method() was the bane of Infinoid's existence.
20:46 jonathan moritz: but operator does make an anonymous subclass. Well, actually, does does.
20:46 jonathan Hmm. The does operator, which but uses, is doing it.
20:47 moritz that would explain the empty str as type
20:47 jonathan Aye.
20:47 pmichaud Tene: (\past in --target=past output)   no, I didn't have any plans to fix it
20:47 jonathan moritz: Will look into exactly what's causing that and fix it.
20:47 pmichaud anonymous classes don't have classnames
20:48 particle tene: so now you can't use duff's device in lolcode?
20:48 pmichaud anonymous classes don't have (Parrot) classnames
20:48 particle how will Whiteknight port his gc?
20:48 Whiteknight is that a rhetorical question?
20:48 particle you *are* porting the gc to lolcode, right?!?!?!
20:49 Whiteknight actually, I was going to port _from_ lolcode into C eventually
20:49 particle I CAN HAS DOD?
20:49 dalek r29259 | Whiteknight++ | trunk:
20:49 dalek : [src/packfile] update function-level documentation for src/packfile/pf_items.c
20:49 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29259
20:49 Infinoid OH HAI I FREED UR BUFFARS
20:50 Whiteknight OH NOES! POINTERZ R FAIL
20:50 particle I'M IN YOUR POOL, COMPACTING.
20:50 pmichaud I CAN HAS MEMORY PLZ?
20:50 jonathan pmichaud: Yes - the issue is that the object loses it's associated with the proto-object.
20:51 jonathan After a does.
20:51 moritz I'M IN UR STAK EATING UR MEM
20:51 particle whee
20:51 Whiteknight NO MEMARY: PWN!
20:51 Infinoid OHNOES, BUKKIT NOT FOUND
20:51 pmichaud if you don't use P6object to create the anonymous subclass, it'll not have an association
20:51 jonathan pmichaud: That's...a tiny bit tricky perhaps. :-)
20:51 pmichaud I don't know if P6object supports anonymous subclasses yet.  But it should.
20:52 particle http://lolcats.com/view/3/
20:52 jonathan OK.
20:52 jonathan I'M IN UR CODEZ, FREEING YA STILL-REFERENCED OBJECTS.
20:53 pmichaud I'll fix up P6object to allow anonymous subclasses.
20:53 pmichaud oh!
20:53 pmichaud you could always .register the anonymous subclass, though.
20:53 mire joined #parrot
20:54 pmichaud p6meta.'register'(anonclass, 'protoobject'=> ... )
20:54 pmichaud that's probably cleaner anyway.
20:54 Tene pmichaud: any idea how to represent a c-style switch in PAST?
20:55 jonathan pmichaud: Aha. And I can do that *after* it comes back from my C op. Great.
20:55 Whiteknight in PIR, are labels first-class objects?
20:55 Whiteknight that is, can you store a label in a variable?
20:55 pmichaud Tene: I don't think there's a way to do it yet.  Perhaps there should be.
20:56 Whiteknight If labels are first-class, you can create a jump table using an array pmc. That's how C-switches are usually implemented
20:56 pmichaud labels aren't first class like that, no.
20:56 Whiteknight well, there goes that idea
20:57 pmichaud afaik there's not really a way to do a branch
20:57 pmichaud afaik there's not really a way to do a branch to a variable position
20:57 pmichaud _however_
20:57 pmichaud there is a way to do it in the pdd25cx branch, using local_return    (/me laughs evilly)
20:58 pmichaud anyway, a jump table assumes somewhat that all of the 'case' targets are constants
20:58 pmichaud and that may not be true in our typical target language
20:59 jonathan moritz: but Maybe(Yes) now works as of latest ci
20:59 moritz YAY INCR jonathan
20:59 * pmichaud continues to think that p6object is Really Cool.  :-)
20:59 dalek r29260 | jonathan++ | trunk:
20:59 dalek : [rakudo] Make pseudo-functional variant of but operator work.
20:59 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29260
21:01 jonathan pmichaud: You probably thought of this, but suppose I do something like for 1..1000000 -> { 0 but Yes }
21:01 Whiteknight pmichaud, he asked about a C-style switch, not a fancy-schmance perl5-style given-when doodad
21:01 jonathan And every call to but is registering a new anonymous class (which will get GC'd once the copies of 0 gets collected)
21:02 Whiteknight (pardon my technical jargon)
21:02 jonathan p6object will not leak, right?
21:02 pmichaud Whiteknight: sure, but I don't know how often C-style switches are used in our target languages
21:03 pmichaud at any rate, the easier way to handle C-style switch is to create an array of Sub pmcs, then invoke the appropriate one
21:03 jonathan (we can in the future I hope optimize it not to create a new one every time is also a good point, of course)
21:03 pmichaud jonathan: p6object will leak in that case
21:03 pmichaud I don't know how to avoid it.
21:03 DietCoke joined #parrot
21:03 particle c-style switch falls through by default
21:03 TimToady since 0 is immutable and roles are immutable, I suspect a single 0 but Yes can be generated and reused
21:03 DietCoke Tene: did you add the builtin DIFFRINT but not add it to the grammar?
21:04 Tene DietCoke: it matches <identifier>, so doesn't need to be added to the grammar
21:04 DietCoke ... Evil.
21:04 DietCoke hokay.
21:05 * DietCoke vanishes again.
21:05 DietCoke left #parrot
21:05 pmichaud jonathan: I suppose I could properties on the class objects
21:05 pmichaud instead of a lookup table.
21:06 pmichaud although that's a bit of a pain too.  Somehow I have to be able to get from .HOW to the metaobject, which means there's a reference *somewhere*
21:06 jonathan TimToady: Yes, I suspect the same, but it's an optimization, so it probably won't get done all that soon, unless someone gets the urge. :-)
21:06 pmichaud sorry, from .HOW to the parrotobject
21:06 pmichaud arrrrgh
21:09 TimToady note the change I just checked into S12 after yours
21:09 pmichaud from .HOW to the parrotclass
21:09 pmichaud (too many distractions)
21:09 pmichaud I think it's probably fixable if I use setprop/getprop instead of managing a table.
21:09 jonathan pmichaud: Yeah, understand the difficulty. I guess we can leave it about as it is for now.
21:09 jonathan I guess the abstractions we have will make it cheap to modify in the future, right?
21:09 pmichaud yes.
21:09 pmichaud I think it's fixable.
21:09 pmichaud one very annoying thing I've noticed about classes and get_class, though:
21:09 pmichaud (nopaste coming)
21:10 nopaste "pmichaud" at 76.183.97.54 pasted "annoying behavior of get_class on PMC objects" (17 lines) at http://nopaste.snit.ch/13552
21:12 pmichaud TimToady: I'll have to look at the details more closely, but an initial scan doesn't appear to cause me much grief.
21:12 pmichaud thanks for pointing them out
21:12 cognominal joined #parrot
21:12 Whiteknight pmichaud: a note about what we talked about yesterday:
21:13 jonathan pmichaud: Let me get the does/but issue fixed, then I'll look at that one..
21:14 pmichaud I think that get_class creates a new PMCProxy instance each time
21:14 pmichaud iwbni it created one and then used that forevermore
21:14 Whiteknight I've been peppering in a few diagnostic messages in the init function for class.pmc, and I can't find any differences between namespace and key PMCs and how they are handled
21:14 pmichaud Whiteknight: what does get_name return from a namespace?
21:15 Tene perl6: enum Maybe <No Yes>; my $x = 42; $x does Maybe(Yes); say $x.Maybe; say $x.No; say $x.Yes;
21:15 polyglotbot OUTPUT[1␤0␤1␤]
21:15 Whiteknight ['ABC';'Bar'] returns 'Bar'
21:15 jonathan pmichaud: I agree it should be doing that.
21:15 Whiteknight at least, as far as I can see
21:15 pmichaud really?  wow
21:15 NotFound pmichaud: get_class in default.pmc return a proxy
21:16 NotFound Even if the pod says that it returns SELF
21:16 Whiteknight I need to double check that I am reading the correct things, but inside the init function, it appears namespace and key pmcs appear to be acting in exactly the same way
21:17 pmichaud well, they certainly would iterate differently :-)
21:17 pmichaud just a sec
21:18 nopaste "pmichaud" at 76.183.97.54 pasted "result of get_name on a NameSpace PMC" (15 lines) at http://nopaste.snit.ch/13553
21:20 Whiteknight I'll have to work on it a bit later and see what I'm doing wrong
21:20 dalek r29261 | jonathan++ | trunk:
21:20 dalek : [core] Correct an off-by-one error that could lead to segfaults rather than an exception.
21:20 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29261
21:20 pmichaud line 191 is what distinguishes NameSpace from Key
21:22 pmichaud if name_arg is a Key, then it doesn't include a hll namespace element
21:23 pmichaud but if name_arg is a namespace, then we end up replacing it with something that _does_ have a hll namespace element
21:23 Whiteknight I'll have to double-check. Whatever I was doing to test earlier was obviously not The Right Thing
21:24 pmichaud (because Parrot_ns_get_name returns the hll namespace name as the first element of the array)
21:24 pmichaud personally I would rework that entire logic
21:24 pmichaud here's something to try
21:24 pmichaud (typing)
21:24 Whiteknight So at that point, removing the hll namespace would be as easy as shifting the result array from Parrot_ns_get_name?
21:25 pmichaud yes, but I"m not a fan of the approach being taken at all anyway. nopaste coming.
21:25 Whiteknight nopaste away
21:29 nopaste "pmichaud" at 76.183.97.54 pasted "suggested revision to class.pmc" (29 lines) at http://nopaste.snit.ch/13554
21:30 pmichaud oops
21:30 pmichaud need to revise -- just a sec
21:31 nopaste "pmichaud" at 76.183.97.54 pasted "suggested revision to class.pmc" (29 lines) at http://nopaste.snit.ch/13555
21:31 pmichaud I've changed "new_namespace" and "name_arg" to "class_namespace" and "class_arg"
21:31 pmichaud er, "class_name"
21:31 dalek r29262 | jonathan++ | trunk:
21:31 dalek : [rakudo] Fix does (and thus but) to not lose an object's association with its proto.
21:31 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29262
21:32 pmichaud but the key feature is that I've refactored name_arg (now class_name) to *always* come from the namespace for the class
21:32 pmichaud so, if we're passed in a namespace, we just use it
21:32 pmichaud if we're passed in a key or rsa, then we create the associated namespace if needed, and then use that
21:32 pmichaud either way, class_name always comes from the namespace directly, instead of sometimes from the key/rsa
21:34 pmichaud and we always remove the hll component from the namespace (to preserve existing parrot behavior)
21:34 pmichaud there may be other instances of name_arg, new_namespace, etc. that need changing -- I just posted enough to get the idea across
21:35 Whiteknight yeah, i see what you're doing here
21:35 Whiteknight it's a good start to a patch. I'll work on it, submit it, and steal all the karma
21:35 Whiteknight :)
21:35 pmichaud you can have the karma :)
21:36 pmichaud the downside to this approach is that we're constructing class_name (a new array) even when we don't need to -- such as when there's an RPA or Key that can already serve in that capacity
21:36 pmichaud however, creating new classes is a rare enough operation that I think the consistent approach might be better
21:37 pmichaud but feel free to refactor class_name back into the separate branches of the if, in order to avoid the extra Parrot_ns_get_name and VTABLE_shift_pmc calls.
21:37 Whiteknight we might be able to do a short-circuiting refactor later, once we get the general idea to work
21:38 Whiteknight but I agree, consistency can be a lot more important for our purposes then small performance gains
21:41 Theory joined #parrot
21:43 NotFound Code clarity also counts.
21:44 jonathan pmichaud: I don't think getting get_class to return one PMCProxy would be all that hard.
21:44 jonathan As in, creating it and returning the same oen all the time.
21:45 pmichaud jonathan: I would think it shouldn't be hard either.  I'm kinda curious why it doesn't do that already.
21:45 jonathan When I first did the PMCProxy implementation, I am pretty sure I had them all in a registry somewhere, jsut an array indexed on PMC type ID.
21:45 pmichaud ahhhh
21:45 pmichaud we're getting rid of type ID, though
21:45 jonathan And it just grabbed it from that.
21:46 jonathan Right. So Allison ripped that out, and I thought the plan was we'd store the reference to the PMCProxy in the namespace.
21:46 pmichaud that makes sense to me (and is basically what I've been thinking)
21:46 jonathan She wanted to create them lazily, however, so I said "OK, feel free" - I didn't realize until you pointed it out just now that this meant created them afresh every time.
21:47 jonathan I thought it meant "create it once and stash it".
21:47 jonathan Creating it every time is expensive for now, and unhelpful to what you're doing also.
21:47 pmichaud I discovered it in P6object when trying to create indexes to the parrotclass objets
21:47 pmichaud for PMCProxy I have to index by name instead of address
21:47 pmichaud because every get_class gives me a new PMCProxy instance
21:48 jonathan I'm getting quite tired now - and I still should write my report for the day. Can you file an RT ticket, so we don't forget the issue, and I'll try and look into it sometime soonish, if nobody beats me to it?
21:48 pmichaud sure, I'll file a ticket.
21:48 pmichaud great work today -- I'm very happy that enums are working and that roles are coming together as nicely as they are
21:48 jonathan I think I might just do one last thing - refactor Bool to make it more enum-like.
21:49 pmichaud okay.  I've been thinking that it actually belongs as a Perl 6 prelude, though.
21:49 jonathan So that we can do return 0 but True.
21:49 jonathan I thought this as well, but then I also thought: bool ain't quite as simple as an enum.
21:49 jonathan Because it also has the special pred and succ.
21:49 pmichaud isn't there separate bool and Bool ?
21:50 pmichaud bool is the enum, Bool is a class
21:50 jonathan OK, do they have some relation?
21:50 pmichaud I don't know.
21:50 pmichaud but S02 lists both "bool" and Bool
21:51 jonathan bool        native boolean
21:51 pmichaud and S12 defines bool as     our enum *bool <false true>;    or somesuch
21:51 jonathan our bit enum *bool <False True>;
21:52 pmichaud so I think that Bool is the one that defines success/pred on Bool objects, and that "bool" is an enum or native type or whatever
21:52 pmichaud src/classes/Bool.pmc even implements "False" and "True" that way currently.
21:52 pmichaud i.e., they're distinguished from Bool::False and Bool::True
21:53 jonathan OK, but that confuses me because normally if you make an enum Foo <X Y>, then you get symbols Foo::X, Foo::Y and X and Y.
21:53 pmichaud right
21:53 pmichaud so we get   bool::False,  bool::True, False, and True
21:53 pmichaud none of which are Bool::False nor Bool::True
21:53 jonathan Oh!
21:53 jonathan OK
21:53 jonathan So Bool::False should be be the same as False.
21:53 pmichaud no.
21:53 jonathan OK
21:54 pmichaud bool::False should be the same as False.
21:54 jonathan :-)
21:54 jonathan Capitalization craziness.
21:54 jonathan OK, let me try that.
21:54 pmichaud okay.  I think you should be able to simply remove lines 30-37 from src/classes/Bool.pir, and then have the 'bool' enum do the rest.
21:55 pmichaud (but leave the rest of Bool.pir alone)
21:55 jonathan Yes
21:55 jonathan Erm
21:55 jonathan Where should I put the definition for bool?
21:55 jonathan We can't have Bool.pir and bool.pir. :-)
21:55 pmichaud I'd do builtins/enums.pir   for now
21:55 jonathan OK.
21:55 pmichaud it would also be nice to move Order.pir into enums.pir
21:56 pmichaud since Order.pir is almost strictly an enum
21:56 jonathan Ah, that is an enum too?
21:56 pmichaud I think so.
21:56 pmichaud I just implemented it as a class for now to get some spectests passing, and thinking we could move it to an enum when enums were ready
21:56 pmichaud that might even be an easier first attempt than bool (because of the capitalization issues)
22:10 jonathan pmichaud: Well, I just wrote enum bool <False True> into the compiler, captured the output PIR and am tidying it up. :-)
22:10 jonathan Easier than writing it by hand and forgetting something.
22:15 pmichaud heh
22:15 pmichaud good
22:16 pmichaud I think tonight/tomorrow I'm going to fix our ability to pre-compile .pm files and use them.
22:16 pmichaud then we can start a Prelude.pm and write builtins in Perl 6
22:16 * moritz eagerly awaits that
22:16 Whiteknight pmichaud++
22:20 jonathan pmichaud: Does the enum being called bool, and thus 0 but Ture setting the bool property, not mean that an if statement should be checking the result of the .bool property/method on something?
22:20 moritz IMHO if should call $thing.bool
22:21 moritz and the default implementation of .bool is to look at .Num or .Str or some such
22:21 moritz and for user defined classes it's always true by default
22:22 moritz oh wait, that means that .bool never has to look at .Str or .Num, because it only needs to be defined in builtin classes
22:22 moritz where it can just be an ordinary method
22:25 kid51 joined #parrot
22:33 jonathan Hmm.
22:34 jonathan Actually switching it over to being an enum causes a couple of spectests breakages, so I'll hold fire on this patch for now.
22:34 pmichaud it's .true, not .bool
22:35 jonathan Oh, actually...
22:35 jonathan pmichaud: How does that work, if the property being declared is bool?
22:35 pmichaud I don't know.  I do know that S02 explicitly mentions the ".true" property, not ".bool'
22:36 jonathan OK.
22:36 jonathan I can hack my implementation of this here to have the property be .true for now
22:36 moritz pmichaud: seems inconstent
22:36 jonathan But I think we need a spec fix/clarification.
22:36 pmichaud don't do .true yet, please
22:36 jonathan Oh, you're not already testing that?
22:36 pmichaud .true is very well defined in S02, while .bool is very vaguely defined
22:37 pmichaud I agree that  "0 but True" is supposed to do something meaningful.
22:37 pmichaud but I'm not sure that we just blindly start hacking everything else to be .bool, or modifying .true to be different from what S02 says it is.
22:37 moritz pmichaud: it's defined that $thing.$type is the general syntax for getting a $type representation of $thing
22:37 pmichaud moritz: I'm not saying it's consistent
22:37 pmichaud I'm saying that the spec is very clear about .true, and I'd prefer to favor that at this moment.
22:37 moritz it seems logical to implement prefix:<?> in terms of .bool
22:38 moritz ok
22:38 pmichaud moritz: I don't disagree.  But the spec doesn't say anything about .bool
22:38 pmichaud other than the brief mention in S12
22:38 pmichaud it says a *lot* about .true
22:38 jonathan pmichaud: It could also be fixed by changing S12's definition
22:38 jonathan our bit enum bool <true false>;
22:39 jonathan Rather than uppercase.
22:39 pmichaud yes, but then   0 but True doesn't work.
22:39 cotto_work kdi51++ #random karma
22:39 jonathan No, it'd be 0 but true.
22:39 pmichaud and 'true' (lowercase) already has a meaning -- it's   prefix:true
22:39 jonathan Oh, hmm.
22:39 jonathan OK, then it needs a clarification. :-)
22:39 pmichaud please just ask on p6l.
22:39 cotto_work kid51++ #random karma, less random spelling
22:41 Whiteknight kdi51--  # easy come, easy go
22:41 pmichaud it may be that .true is not the same as prefix:?   In vtable terms, it may be that vtable get_boolean is not precisely the same as .true
22:42 pmichaud it could be that it checks .bool first and then .true
22:42 jonathan Yeah
22:42 pmichaud anyway, clarification on p6l is warranted here, rather than random guessing into the spec.
22:42 jonathan I know this is something for p6l, it's just good to evaluate some of the possibles first.
22:42 pmichaud (or even not-so-random guessing :-)
22:42 pmichaud anyway, dinnertime here -- bbl
22:42 pmichaud again, great work.
22:43 jonathan Thanks...and converting bool::True and bool::False and True/False to be enum worked out fine. Even if 0 but True doesn't until we get the spec clarification.
22:43 jonathan (As in, passes all spectest_regression)
22:43 jonathan So, will pop that in.
22:45 gryphon_ joined #parrot
22:51 dalek r29263 | jonathan++ | trunk:
22:51 dalek : [rakudo] Switch True and False over to being real values from the (now existing) bool enumeration, rather than instances of the Bool class.
22:51 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29263
22:54 rhr joined #parrot
23:13 dalek r29264 | jkeenan++ | trunk:
23:13 dalek : Add some tests for sub _evaluate_cc_run() and _handle_glut().
23:13 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29264
23:19 kid51 cotto_work:  What about my karma?  or my spelling?
23:22 cotto_work joined #parrot
23:24 jonathan Today's report: http://use.perl.org/~Jonath​anWorthington/journal/36895
23:25 dalek r29265 | jkeenan++ | autojit:
23:25 dalek : Branch was merged into trunk and is no longer needed at HEAD.
23:26 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29265
23:27 dalek r29266 | jkeenan++ | autojit-28732:
23:27 dalek : Branch to which this tag corresponded was merged into trunk and is no longer needed at HEAD.
23:27 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29266
23:33 ruoso joined #parrot
23:35 dalek r29267 | jkeenan++ | parallel:
23:35 dalek : Creating parallel in https://svn.perl.org/parrot//branches
23:35 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29267
23:35 dalek r29268 | jkeenan++ | parallel-29266:
23:35 dalek : Tagging trunk at r29266 so that the parallel can later be synched to it.
23:35 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29268
23:38 dalek r29269 | jkeenan++ | parallel:
23:38 dalek : Begin to develop base class for Parrot::Configure.
23:38 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29269
23:41 dalek r29270 | Whiteknight++ | gsoc_pdd09:
23:41 dalek : [gsoc_pdd09] remove some unnecessary macros and expose the code underneith. Also, simplify some things that are accounted for elsewhere.
23:41 dalek diff: http://www.parrotvm.org/svn​/parrot/revision?rev=29270
23:45 TiMBuS joined #parrot

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

Parrot | source cross referenced