% Ademan has joined #parrot r29183 | cotto++ | trunk: : [pmc] added test for get_bool, freeze/thaw and is_equal : All except freeze/thaw pass. RT #56718 has more details. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29183 % purl has left purl!~purl@florence.kuiki.net Did you TODO the failing ones? % purl has joined #parrot % Ademan has left Ademan!~dan@h-68-164-170-45.snfccasy.dynamic.covad.net r29184 | fperrad++ | trunk: : [Lua] : - fix #56694 (segfault in closure.pmc) diff: http://www.parrotvm.org/svn/parrot/revision?rev=29184 I did now. r29185 | cotto++ | trunk: : [pmc] TODO'd failing test diff: http://www.parrotvm.org/svn/parrot/revision?rev=29185 Perfect. La perfection est atteinte non quand il ne reste rien ajouter, mais quand il ne reste rien enlever purl: bien dit. GeJ: excuse me? whoever added that banner to the public RT pages is awesome % Ademan has joined #parrot % clunker3 has left clunker3!~IRC@procura.xs4all.nl % barney has joined #parrot % iblechbot has joined #parrot % chromatic has left chromatic!~chromatic@sub17-30.member.dsl-only.net % cotto_home has left cotto_home!~cotto@96-26-202-243.sea.clearwire-dns.net % bacek_ has left bacek_!~bacek@mcas-151.usr.optusnet.com.au r29186 | bernhard++ | trunk: : [codingstd] remove trailing whitespace diff: http://www.parrotvm.org/svn/parrot/revision?rev=29186 % clunker3 has joined #parrot % desertmax has joined #parrot % kj has joined #parrot % jan has left jan!~chatzilla@89-253-66-101.customers.ownit.se % clunker3 has left clunker3!~IRC@procura.xs4all.nl % kj has left kj!~IceChat7@193.1.104.7 r29187 | bernhard++ | trunk: : [Pipp PCT] Simplify rule 'concat_expression'. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29187 % particle1 has left particle1!~particle@c-98-232-28-49.hsd1.wa.comcast.net % clunker3 has joined #parrot % pancake has left pancake!~pancake@core.fluendo.com r29188 | bernhard++ | trunk: : [Pipp PCT] Add test script t/php/concat.t. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29188 % kj has joined #parrot r29189 | bernhard++ | trunk: : [Pipp PCT] Add concatenation to optok parsing diff: http://www.parrotvm.org/svn/parrot/revision?rev=29189 % iblechbot has left iblechbot!~iblechbot@194.16-dial.augustakom.net % kj has left kj!~IceChat7@193.1.104.7 r29190 | bernhard++ | trunk: : [Pipp PCT] Try to simplify the grammar. : Move some productions from 'expression' to 'term'. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29190 bernhard.schmalhofer@gmx.de | Pipp: link: http://www.perlfoundation.org/parrot/index.cgi?pipp % jan has joined #parrot r29191 | fperrad++ | trunk: : [build] on MinGW32 : fix the following linking error : : undefined reference to `CONST_STR' diff: http://www.parrotvm.org/svn/parrot/revision?rev=29191 % kid51 has joined #parrot r29192 | bernhard++ | trunk: : [Pipp PCT] are not needed in PAST generation. : Also put the delimiters at end of the respective statements. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29192 r29193 | bernhard++ | trunk: : [Pipp PCT] Fiddle with operator precedence table. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29193 r29194 | bernhard++ | trunk: : [Pipp PCT] Add relational ops to optok parsing. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29194 % kid51 has left kid51!~jkeen@pool-71-247-44-247.nycmny.east.verizon.net % cotto_home has joined #parrot r29195 | bernhard++ | trunk: : [Pipp PCT] Neater layout of the grammar declaration. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29195 % Whiteknight has joined #parrot r29196 | Whiteknight++ | gsoc_pdd09: : [gsoc_pdd09] updating to trunk r29195 diff: http://www.parrotvm.org/svn/parrot/revision?rev=29196 % contingencyplan has joined #parrot % integral has left integral!bsmith@adsl-212-20-244-147.lumison.co.uk r29197 | bernhard++ | trunk: : [Pipp PCT] more fiddling with grammar layout. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29197 % particle has joined #parrot % gryphon has joined #parrot r29198 | bernhard++ | trunk: : [Pipp PCT] Replace rule 'array_key' with rule 'expression'. : More layout-only changes. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29198 % iblechbot has joined #parrot % sjansen has joined #parrot % integral has joined #parrot % jhorwitz has joined #parrot % TiMBuS has left TiMBuS!~Hurf@123-243-167-27.static.tpgi.com.au % AndyAway has left AndyAway!~AndyL@host3130.follett.com % uniejo has left uniejo!~uniejo@193.88.64.250 % apeiron has joined #parrot % rdice has joined #parrot r29199 | bernhard++ | trunk: : [Pipp PCT] Add initial support for $this. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29199 % gryphon has left gryphon!~gryphon@dsl-209-221-185-54.zipcon.net bernhard.schmalhofer@gmx.de | Parrot: link: http://www.perlfoundation.org/parrot/index.cgi?parrot % sjansen has left sjansen!~sjansen@206.83.88.66.ptr.us.xo.net % sjansen has joined #parrot r29200 | bernhard++ | trunk: : [Pipp] Try to make 'make test-php' work again. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29200 % jcm has joined #parrot bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers % gryphon has joined #parrot bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers barney++ #"the PHP desert" Although dessert is the food. Desert is the place. Christoph Otto | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers A silly way to remember is that dessert is fancy because it has two S's. just as many S's as "fancy" - oh, wait ;-) you want more dessert than you want desert well, that's true ;-) I'd rather be stuck on a dessert island than a desert island. as long as it's not solvable in water ;) *soluble Desserts is stressed backwards. r29201 | julianalbo++ | trunk: : Allow null arguments in split opcode, RT#54384 diff: http://www.parrotvm.org/svn/parrot/revision?rev=29201 % kj has joined #parrot % desertmax_ has joined #parrot % desertmax has left desertmax!~markus@62-47-166-58.adsl.highway.telekom.at r29202 | bernhard++ | trunk: : [Pipp PCT] Use rule 'block' instead of ''. : Some more simplifications. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29202 jonathan: ping % desertmax_ has left desertmax_!~markus@62-47-173-157.adsl.highway.telekom.at r29203 | bernhard++ | trunk: : [Pipp PCT] use the rule 'param_list', with the parentheses. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29203 pmichaud: pong I'm wondering if signature binding is just a form of sub call for us. except that the "lexicals" refer to the outer scope. ...time to add that min parameter to the lexical search sub... Binding a signature will, as far as I had it laid out in my head, just do stuff to the lexicals in the caller's scope, yes. except I'm thinking it's actually a Parrot sub call i.e., we invoke the signature itself, and it does the bindings in the outer scope And generate every sub to just get a slurpy list and hash? And pass them flat? no And the signature worries about the binding? OK. I hadn't wanted to go that far, even if it's tempting in some ways. we _can_ do it that way, yes, and may have to, but that's not what I'm thinking Oooh he is soooo fine!!! My thought was compromise. We generate .param declarations that do about the right thing. I'm thinking that :($x) := foo() actually generates the :($x) part as a subroutine call But then pass it onto the signature object, to do the binding, and do any unpacking that is too complex for Parrot's calling conventions. sorry, actualy generates the :($x) part as a Sub definition I was going to construct a signature, and then := would become an invocation of a method on the signature objects. yes, but I'm not sure that's exactly what we want We need :(...) generally to make a signature object. my $x = :(...); sure, but can that signature object be a Sub ? I'm trying to avoid duplicating the binding code between Signature and normal routines I guess we could subclass sub...you just mean can it be invokable, right? i.e., the :named, :optional, :slurpy, etc. logic yes, I mean it can be invokable, we pass it whatever it's being bound to, and then it bind lexicals in the outer scope there's more. in the general multi-sub case, the dispatcher invokes a (multi) sub, but if there's an error in binding it throws an exception that tells the dispatcher to try the next candidate sub I suspect that signatures don't have a clue whether their variables exist in an outer scope it's the declarator that embeds them that worries about that, generally TimToady: yes, this would accommodate that, I think. so, :(my $x) would be illegal particle: yes, but my ($x) is legal. now I'm wondering about my $sig := my ($a,$b,$c); \(1,2,3) ~~ $sig and whether it binds the $a that my declares as opposed to $sig := :($a,$b,$c), which wouldn't does ~~ ever bind or assign? i always thought of it as compare/match never changing the lvalue or rvalue but i should look again at the table to be sure .ACCEPTS can have side effects matching a Signature returns true if it can bind r29204 | Whiteknight++ | gsoc_pdd09: : [gsoc_pdd09] diagnostically remove List_chunks from memory management. But doesn't actually bind it. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29204 use when * -> ... { } for that, IIRC. I think it binds the variables blindly, and it doesn't know or care whether the variables exist outside the sig it depends on what kind of declaration the sig is part of Though trying to bind to something that doesn't exist, will be an error? the variables exist in the sig, but aren't aliased into any outer lexical scope I'm thinking of the case :($x) = foo() what $x are we referring to there? itself sorry, := :($x) := foo(); the name is a singleton :($) := foo() has the same effect with a null name r29205 | bernhard++ | trunk: : [Pipp PCT] Add rule 'literal' for use in rule 'member_definition'. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29205 so the 'x' part is really a form of commentary, unless the sig is embedded in a larger declarator how about is is is a space alien So when we do the bind, we look up $x at binding time, rather than at signature declaration time? :(:who($name), :why($reason)) := (why => $because, who => "me"); I don't think that can work, the way I'm thinking of signatures currently I also don't think it's any great loss oh. I took that directly from S06. :-( Right. hee note that my (:who($name), :why($reason)) := (why => $because, who => "me"); still works because of the "my" and my declares $name and $reason? and, in fact, can reuse the same "my $name" declared earlier by the current rules Right. Because what is parsed between the (...) in a my is a signature. OH? It doesn't declare a new $name always? so then, if I'm understanding this correctly.... my $a; my ($a, $b); # not a redeclaration of $a? jonathan: nope, there can only be one $name in a lexical scope correct :($x) := foo(); simply tests that the binding occurs, but doesn't actually modify any $x That feels so wrong. or is otherwise not legal if you're looking up the dynamic stack for lexical scopes (say, to find a context var), you don't have to track the line number to know which $name I understand how my (:who($name)) := ... can work, no problem. TimToady: My comment about it being "so wrong" was in response to what pmichaud said about it not modifying $x it can warn you unless you declare $a as proto okay I mean, :($x) := foo(); just looks like something that should have some effect on $x. thus I think we have TimToady's comment "I don't think that can work..." ? t/syntax/signature.t needs to be converted and extended to spec tests these examples should be put there OK, but I don't get why it shouldn't be allowed to work. well, I suppose we could go the other way, and require $x to refer to something existing, but then you can't write a signature with vars as commentary And why "my (:($x)) := foo();" should work. and are forced to write :($,$,$,*@) and such ick. Hmmm. I see what you're getting at now, and I dislike that even more. in any case, we need to be consistent I think "my (:($x)) := foo();" isn't exactly right -- it's just my ($x) := foo(); Ah, OK. Yes, mis-read. well, it's a degenerate case of (:foo($x)) s/foo/othername/ well, wouldn't (:othername($x)) be a named-only param? except it's also sig syntax I'm just a little uncofortable that the only way to do unpack things with a signature requires a my, when the varialbes in it have already been declared. but if sigs are allowed to look outside for existing variables, we'll get people wanting things like sub foo ($*x) {...} i.e., my ($x) := foo(); and my (:othername($x)) := foo() are really different in terms of what foo() returns currently submethod BUILD ($!x) is kind of an exception, not a general policy Hmmm...true. Well, they can already have method foo($.x) Aha, OK. I figure "has ($.x, $.y)" is another case where you'd want to parse a signature with that in. and ($x) is really just the null twigil :) it's probably not really a syntactic decision, but something that either succeeds or fails in semantic analysis so you can parse sub foo ($*x) and get a syntax tree, but something downstream carps about it Sure, we already have various "can't use that twigil here" stuff in the actions. OK, so we're basically saying, the names in signatures only have the meaning that is provided by the declarator? but none of the twigil meanings in signatures currently imply lexical scope scanning, other than what the declaration context supplies one problem with this interpretion my ($a,$b,$c) is kinda defined as my :($a,$b,$c) with an optional : right. Right. that's what prompted this. :-) maybe we need a singleton sigil :) s/sigil/twigil But it's the "my" there that means, "the names in this signature are varialbes that we should declare" (if they aren't already declared in this scope) ah true now I'm confusing me own self so that's okay still and in the case of sub foo($a, $b) { ... } it's the fact that they appear in the sub declaration that gives them the "these are parameters to bind" meaning ('sub' is just another declarator) yes, it's implicitly a "my" context inside likewise for -> sort of a rewrite to my ($a,$b) := @_, as it were We could just have another declarator, which makes the meaning be "look up the names in the current scope and bind to them". 'sig' jonathan: that's called "my" :) what if the variables aren't 'my' variables, though? our $a; my $b; my ($a, $b) := ... There's that, and I'm also thinking of a way to do this without making it look like a redeclaration. or, if we want to bind to things with twigils so, perhaps 'sig' is the commentary varnames, leaving :(...) to do binding? or vice-versa? outside of the "our", $a looks like it was a my jonathan++. Seeing a visually rendundant 'my', just to get the variable binding semantic, will be confusing to me -- or at least cause a mental stutter. sig (my $a, our $b) ?? in any case, you can get a warning on the redeclaration unless you say proto our $a; proto my $b; above my $s = sig ($a, $b) ---> same as sig ($, $) so we have a way currently, but it's up at the top okay you mark the reusable name, not the re-use spot TimToady: but being forced to say 'my' at the reuse spot is jarring. { our $a; { my $b; my $s = sig ($a, $b); } } what, you never say "my dog Fido" twice in the same conversation? heh *in fact* { our $a; { my $b; my ($a, $b) := ...; } } one can test signature bindings using a null routine sub foo($x, $y) { ... } # foo is effectively :($,$) % Theory has joined #parrot % rdice has left rdice!~richard_d@CPE0014bfafbbd5-CM0011e6ecf48a.cpe.net.cable.rogers.com sorry, eliminate my ... there sub foo($x, $y) { } "barney" at 84.154.13.62 pasted "Should that work with Rakudo?" (40 lines) at http://nopaste.snit.ch/13538 yes, in terms of constraint checking, it's :($,$).ACCEPTS($capture) particle: In that case, since $a is in an outer scope, I guess even the "not declared with proto" thing wouldn't get you a warning you weren't declaring a new lexical. right yes, $a would be different, and $b would be the same TimToady: I get that, sure, but there aren't any computer languages I use where 'my dog Fido' or the moral equivalent can mean declaration the first time, and something very different (like, say, signature binding) in the second. (that == 'my dog Fido' joke) that's not what i'd want to happen barney: I don't know if initializers work on has declarators yet YOU GET A DIRE WARNING unless you say "proto" TimToady: Even in particle's example, where the variable name being "re-used" is declared in an outer scope? no, you get the warning on $b, not on $a { our $a; { proto my $b; my ($a, $b) := ...; } } Aha, OK, makes sense. But it still doesn't give us a way, to bind to the outer $a. { our $a; { proto my $b; my ($a, $b) := ...; #{$a is defined} } #{$a is undef} } does { proto our $a; { multi my $a; } } allow you to bind the outer $a? OK, perhaps this will help my confusion -- what is the recommended syntax to do this concept: 'sub foo($baz) { my ($a, $b); if $baz { :($a, $b) := bar() } else { :($a, $b) := quux() } say "a: $a, b: $b"; }' r29206 | cotto++ | trunk: : [pmc] added a test to exercise FixedPMCArray's is_equals. The test exposes a : bug, so it's TODO'd until a fix is found. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29206 fwiw, I think that the syntax japhb just get ought to be the recommended syntax (more) and that signature w/commentary variables is simply "sub ($a, $b) { ... }" or w/o the ... or with a special declarator 'sig' that doesn't require a body: "sig ($a, $b);" pmichaud: This makes sense to me. (or a semi, in that mis-typed example) perhaps that huffman-codes the wrong way -- I haven't thought about it much. I'm just going off-the-top-of-my-head well, there's always OUTER:: and MY:: TimToady: so how would you write my example? :(OUTER::<$a>)= 1 might work := rather hrmm and the limit on sub foo ($*x) is not imposed by the sig, but by the sub of course, then you need to know how many OUTER:: scopes above $a was declared so :(GLOBAL::<$x>) := 1 probably even works but that tends to point toward :($x) also doing the normal thing and looking in MY:: I don't quite understand "the limit on sub foo ($*x)" comment. (I don't necessarily need to understand it, but...) well, it's not really an impossible thing for a sub to bind to a global parameter, but it's just kind of one of those policies that you probably want to enforce for sanity or not... TimToady: It feels strange to use a pseudo-package there, when to someone writing { my $a; ...stuff...; :([$a, @]) := foo() } style things wouldn't really thing of $a is being in anything other than the current scope visually (as in, where the curlies are). s/thing/think/ s:2nd/thing/think/ :-) yes, and we do have the bare $ syntax to mean the other thing I wasn't recommending that 'sub foo ($*x)' be allowed to bind to a global param. (I.e., I still don't understand.) so the sane thing is probably to treat :($a,$b) := consistently with ($a,$b) = if :($a,$b) := 1,2; works on existing vars, then so does :($*a,$*b) := 1,2; ahhhhh and if that works, then so does sub foo ($*a,$*b) okay, I get it now. thanks. and if there's a policy, it's enforced by the decl But the sub declarator could choose to forbid it. or just issue a DIRE WARNING :) I agree w/jonathan -- the sub declaration can forbid it, just as we expect to forbid things in has, our, my, etc. Apparently all of our dire warnings should be capitalized. :-) I didn't hear the words between "our" and "should"... heh % cognominal has left cognominal!~cognomina@82.67.232.89 I think our warnings ought to begin with "Larry says" :-) "Larry says you shouldn't use a global variable here." OK, so have we now returned to the state that my example is actually correct syntax? pmichaud: nice! Larry says take three giant steps forward or, even better, "TimToady says you shouldn't use a global variable here. There are many other (better) ways to do it." minor disaster here-- bbiab Larry says lose a turn, install python. "I didn't say 'Larry says'! Segmentation fault (core dumped)" TimToady: OK, so ":($a, $b) := foo()" is the same as "($a, $b) := foo()". But you can use the Full Power of signatures on the LHS. yes, you have the declarative syntax rather than the rvalue list syntax, fwiw What about now: my $sig = :($a, $b); ...later, in a galaxy far, far away... $sig := foo() er, you mean foo() ~~ $sig ? % Theory has left Theory!~Theory@c-67-160-131-113.hsd1.or.comcast.net $sig := foo() would do something else btw, rakudo's make -j fulltest has some funky display issues, but runs without error Ah, of course. OK, so in :(...) := ..., we syntactically know what := is going to do. that's where I'm saying that sig matching doesn't know or care whether or where the $a and $b are actually aliased to or however you say that... it has a variable, and it binds it, and that might have effects elsewhere or it might now *not OK, so :($a, $undeclared_thingy) := foo() will not be an error? yes, it's an lvalue signature I think we have to make it an error OK, that's what I was hoping. :($a, my $b) := ... that last statement will work, and throw away $b? no, declares it in the current scope no {...} around it ah, ok so it propagates outward I don't look forward to implementing that, but I think it's the Right Thing. :-) seems to follow least surprise Right. Which is what I'm aiming for here. i don't know what to be surprised about anymore does handle declarators inside the parens? not currently * jonathan throws a badger at particle. I think I'd rather not have :($a, my $b) then * particle always tries to anticipate chaos my $b; :($a, $b) := seems easiers bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers pmichaud: nodnod (minor disaster continues, expands... bbiab) ah, kids. on a different but related topic, in perl 5 (undef, $x) = foo() allows you to throw away a result... or ($a, my $b) = works too can you throw away all named results in perl 6? *% % cognominal has joined #parrot At a guess. what he said wasn't sure if that'd work, but that'd be my guess fab. bernhard.schmalhofer@gmx.de | PHP OO for Perl 6 programmers: link: http://www.perlfoundation.org/parrot/index.cgi?php_oo_for_perl_6_programmers .oO( we just have to implement it ;-) moritz: Ssshhh... :-P OK, seems we have signatures straightened out somewhat. TimToady++ # thanks TimToady: While you're about, one other thing occurred to be: at the moment for parametric roles, we parse it as something like '[' ']' s/be/me/ # wish I could type today For the role declaration, parsing a signature there would make more sense to me - am I missing something? moritz: think you could look at t/syntax/signature.t conversion to spec tests? jonathan: agree so, back to my original comment, I'm thinking that Parrot's implementation of signature binding is perhaps just a sub that bounds to lexicals in its outer scope? OK, thanks. particle: yes moritz++ I'd only need to understand them :/ pmichaud: That now makes some sense, yes. r29207 | cotto++ | trunk: : [pmc] fixed fixedpmcarray bug, unTODO'd related test diff: http://www.parrotvm.org/svn/parrot/revision?rev=29207 I wish I knew whether the php_oo example was trying to be idiomatic Perl 6 or trying to be idio(ma)tic PHP pmichaud: I'm curious though what my $x = (:($a, $b) := foo()); leaves in $x - if it's a signature object, we have to build one of those still. jonathan: it can still be a subclass of the Sub PMC Signature? Signature is invalid it's certainly not how I'd write the Perl 6... TimToady: Expand? i think Expand is at language.perl.com/ppt/src/expand/ using ~ instead of interpolation, adding extra () on all the calls... % cognominal has left cognominal!~cognomina@82.67.232.89 TimToady: it's a wiki :) pmichaud: Signatures are generally not invokable, so it doesn't feel completely right to me... TimToady: I'm translating PHP examples to Perl6, is there idiomatic PHP ? TimToady: Ah, I didn't realize what that was a comment to... :-) I'd make it a method for now, and if it ends up there's only one such method, and it works with .(), then you could easil refactor later i'd also write "my Foo $foo .= new;" jonathan: I think the only alternatives are to have two separate mechanisms for signature binding, or to have all subs use :slurpy arguments and then bind with a separate signature specification or we'll probably end up with "new Foo" working too. if we defined sub new in Any to do it indirect object notation? indirect object notation is taking a beating on p5p and I'm not a big fan of the "two separate mechanisms" approach. no, just a listop with one arg on the principle of "The customer is always right" yes, I caught myself writing new PAST::Op this past week well, then, there you go. pmichaud: Me either. But I think that since we need to do things like sub foo($a, [$b, @]) { ... } and other unpacking stuff that we ain't going to be able to get Parrot to do for us, we will always need to get the signature object to do some work for us. unfortunately, I was writing it as new PAST::Op(...args...) which doesn't really do what I want. and if it's actually indirected to PAST::Op.new, then people will naturally micro-optimize to the latter yeah, don't see a decent way to support that syntax well, not without making protoobjects respond to .() which already means a coercion jonathan: well, except we don't have to have a separate Signature Object would .new :Past::Op (...) work? pmichaud: Huh? inside of a sub i think i misplaced a colon .new: Foo no pmichaud: Every sub has an associated signature object. that would mean $_.new: Foo jonathan: every sub has a way to get at its signature. .new given Foo how that's represented isn't entirely spec'd yet. TimToady: and that's idomatic perl 6? ;-) s/ma// i don't like 'new Foo' if you can't do 'new Foo(...)' pmichaud: At a Perl 6 level, &?ROUTINE.signature jonathan: sure, I'm speaking of PIR level and I don't like having two separate representations of signatures at the PIR level pmichaud: At a PIR level, $P0 = interpinfo .INTERPINFO_CURRENT_SUB\n$P0 = $P0.'signature' () nonono sub foo(Int $a) { ... } how does that Int constraint get attached to $a ? same way my Int $a does it, presumably right now the code is doing it in two parts -- one that places it in the .signature, another that attached a constraint to $a, and there are different paths for doing it. TimToady: yes, that's what I'm thinking. Is a good idea to define a function to create an empty string and replace with it a lot of CONST_STRING(interp, "") ? come again? Damn, TimToady! I just gave you sweet lovin' 10 minutes ago! I have staying power... pmichaud: Right, at the moment that's what happens; if we switch over to letting the signature object do all of the work/checks/binding etc, we'd clear up the duplication. jonathan: so, you're saying pass all params as slurpy then? Half of we wants to say, let's just do it. Part of me is thinking, is this really a good idea. :-S Can you think of good reasons not to do this? are you merely converging on the notion of Capture? TimToady: ultimately, yes. TimToady: Yeah, it seems so... TimToady: Parrot doesn't haven't an internal notion of Capture yet then converging sooner would seem better than converging later :) we can certainly impose one on it, but there's this "language interop" issue we also want to deal with NotFound: why would you replace a compile-time constant with a runtime lookup? particle: mainly because is not a compile-time constant. pmichaud: I'm not sure that it'll be a big issue for interop, if we just accept slurpies. pmichaud: are you claiming that other languages aren't interested in named args or invocants? :) TimToady: I'm only claiming that the Parrot way of doing it doesn't match Perl 6 :-) CONST_CAST is a call to a function that makes a lookup, build a string header, and fills it. Err... CONST_STRING first-class Captures can be optimized away, but I'm not sure they can be pessimized toward. :) For an empty string, build the header is almos all. pmichaud: if parrot way matches perl 6 way, then all other languages pay the penalty particle: no, Parrot could provide a :capture flag heh *and* I actually suspect that using captures would be more efficient than the way Parrot does it now I have no proof of this, but it seems like a far easier resolution mechanism than what we currently have *and* you build the capture once for all the multies you want to match against, including any that want the capture whole It will bring world peace? following what TimToady said, a lot of it could be optimized away, although the reverse isn't true NotFound: if there's a faster way, like putting a singleton string struct with null value in a shared header, sounds good to me i've thought about giving parrot a caputure pmc, and using that for mmd particle: I looked at it, but I think that always bulding the header is fast, and is safer, because we have no way to guarantee const usage. pmichaud: I suggest we look at the route of taking slurpies, and letting the signature do the binding for us. From other languages, they can still pass us args. The caller doesn't care if the callee is slurping. I was hoping to avoid the extra ResizablePMCArray creation on every subcall "Null PMC access in type()" just plain sucks while fudging tests - anything anyone can do about it? especially for subs that don't need it or do any funky things with signatures. And even if we can, that creates a lot of COW and unCOW on every modification of the returned string. OK, but if we're saying we're going to aim to get Parrot to provide something better in the future, this lets us get the right semantics for now and gives us soemthing we can easily refactor into a capture-supproing-Parrot like shape later. *actually* *supporting I think we can have both. certainly we can do it if Signature is in fact a PIR sub it's no problem to make it un-invocable. if that's what is bothering you. It just haven't seen the benefits that much yet. PIR is easier to represent in PIR than a data structure. especially since the act of binding is more procedural than anything else. moritz: don't use Null PMCs ;) even now, our constrants tend to be blocks. NotFound: I don't. I only use Perl 6 ;-) moritz: I don't think we know the source of the "Null PMC access in type()" yet. % apple-gunkies has joined #parrot pmichaud: Constraints are always generated as blocks at the moment. pmichaud: would a minimal Perl 6 example help? right. I don't think that will change. I think by definition our constraints are somewhat procedural. which, in Parrot, means "block" moritz: yes, it would since a signature is really a form of constraint, it also makes sense for it to be a .sub moritz: it's been hard to cosistently replicate (actually, a signature is just a set of constraints over a set of variables) pmichaud: Yes, but also signatures need to be introspectable. how introspectable? .arity and .count for starters, but also see perl6-language I posted about this yesterday and TimToady answered. I did see perl6-language, which led me to where I am now :-) .arity and .count are also introspectable on blocks and probably should be introspectable on Parrot subs in general OK But you can also get a bunch of parameter descriptors. which would look like...? for @(&foo.signature.parameters) { say .name } I can still do that. % kj has left kj!~IceChat7@193.1.100.109 Oh, sure, it's possible. I guess we'd just produce code that could generate that data structure. I can do it even easier if the way that we represent constraints is the same for variables as it is for signatures On demand, if needed. It is. Or can be. At the moment, constraints on varaibles = and junction of the constraints. yes, I know that works well for me I was pondering the same way for parameters. that's what my refactor intends to do Right. It was on my "want to do" list too, just didn't get to it. So I'm all for that. but I wasn't planning to try to do it as a separate signature object instead, my 'signatures' are simply subs that set constraints on the variables and bind them appropriately and for anything else we introspect on the variables introspect on the variables? hmm, junctions as self-optimizing jits based on history... TimToady: Also, parallely evaluatable. that too jonathan: sure, introspect on the variables. what sorts of introspection would we want to do besides .name ? pmichaud: .constraints :-) which are junctions which I think ought to be attached to the variables But maybe .slurpy, .named etc manycores Я us i.e., I can see wanting to do VAR($a).constraints Depends just how introspectable signatures need to be. Right, but introspecting the bound to variable isn't the same as introspecting the signature. how does it differ? Imagine &foo.signature.parameters when we'd never invoked or bound foo hrm. s/or bound/ / or currying, even I think a signature object itself needs to actually describe the signature. or subsetting a multi using args And with :(Int $) style things, there's no variable name, but still a scalar that has an Int constraint. so, name is just empty in that case Right. we can have nameless Scalars :-) that already exists now . pmichaud: Also, VAR($a) does constraints($some_new_ones) # oh no, please say isn't allowed. :-) oh, I was wondering about that also my Foo $a; my Bar $b := $a; (not allowed? how are they constrained?) What's the current recommended usage, INTERP or interp? NotFound: when in doubt, I'd also go for the CAPS version. s/also/always/ notfound: ack is your friend pmichaud: I'm not so clear on that, as := replaces the container. ...replaces the container? It's a binding. So $b is now bound to whatever $a is. particle: not very usefull when there is a lot of both usages. I thought it just meant that $b and $a refer to the same container. Right. Sorry, I mis-spoke. That's what I was trying to say. so, what constraints does that container get? ok, Null PMC example in #56748 So I'm not sure what my Bar $b := $a; means, because you're declaring a type constraint for the container $b, but then making it reference the container $a. The current container $b doesn't really get a say in it. okay, then: my Foo $a; sub xyz(Bar $b) { ... }; xyz($a); actually, add a 'is rw' to that. % slightlyoff has joined #parrot woo, it looks like you guys are having a weighty discussion today pm: not knowing the relationship between Foo and Bar, wouldn't that be a type-constraint error? pmichaud: Another fun case. Here, the call could fail if the value in $a is not an instance of Bar. erm Instance of something that isa/does bar. Bar % slightlyoff has left #parrot Or Bar could be a subset type, of course. what jonathan said sure, if it doesn't bind, no problem. But what about my Foo $a; sub xyz(Bar $b) { $b = something_valid_for-Bar }; xyz($a) Supposing that $a isa Bar, for example? $a could be something that "does Bar", but something_valid_for_Bar might not be "does Foo" Yeah. (and I forgot my 'is rw' again) so we can't really say "$b doesn't get a say". At the moment, in Rakudo, if you try and assign something to $b that does not do Foo, it'll fail. However, is copy gets you a fresh container that has the type constraint Bar. And with is ro, the default, you can't assign to it, of course. right Whether that is the Right Semantics, is a question for @Larry. Bar $b is rw is essentially the same as my Bar $b := $a; (when the binding occurs) Yeah, but the := doesn't result in a check that the value of $a is type compatible with Bar. it probably should. I'd guess so. think of it as my (Bar $b) := $a; # :-) Right, which would fail. :-) there's not really a lot of difference between that and my Bar $b := $a; So yes, for consistency we should be doing a check. Right. Agree, and agree there shuld be a check. which is why I'm thinking that signatures are actually routine-ish :-) Only because, we emit the code to do the check in routines at the moment. ;-) I'm not saying they shouldn't be procedural here. I'm thinking they're procedural in general, with exceptions for failure I'm just saying, given we need to have a data representation too, that might not be everything there is to it. 'introspectable' doesn't always mean represented in a data structure For example, for MMD, I don't care about binding. I do care about (quickly) knowing what the types in the signature are. Right, but we shouldn't make introspection slow either. I was mostly implementing signautres now to be able to introspect them. :-) well, for Perl 6 MMD you really care about binding, also, at some point Oh, at some point, but the dispatcher cares first about the types. for a first-pass I agree that types is sufficient So it can look at type narrowness. but I don't have to have a Signature structure for that No, put having to invoke something that gives bits of the type information every time will be bad. worse than method calls on a Signature structure? % Theory has joined #parrot I just want to be able to say "OK, here's a candidate, get it's signature, get the types of the parameters we care about and their types" etc. Well, in the MMD guts I'd pondered cheating and just knowing the data structure. ;-) ah. *that* sounds very Perl 6 specific, unless you're creating a Parrot Signature PMC We'll have a Parrot-specific MultiSub PMC. so, where does ":multi(...)" fail to act as "get the types of the parameters we care about"? And yes, this will be tricky if we want to have a multi-sub with different subs in the multi being from different languages. % Andy has joined #parrot Because :multi doesn't let you specify enough. example? :multi(...) just takes some type names in there, which it expects to resolve to PMC type IDs later, as I understand it. and, of course, :multi doesn't have to do all of the constraint checking -- just enough to cull out the list of subs we have to check using constraints % barney has left barney!~bernhard@p549A0D3E.dip0.t-ipconnect.de Right. But it's tricky, since we don't know until runtime whether constraints are actually classes or subsets or roles. well, subsets require a runtime check, regardless Sure. so that's not going to be captured in type information anyway I'm thinking that multi sub foo(Thing $a) { ... } Is Thing a class? A role? A subset type? We maybe don't know at compile time. we know at the point where we compile foo Thing has to be predeclared. OK but Hmm] True. We don't have the registry in place in the compiler to track that for now. (we don't currently do that, right) Also, I'm not completely sure that we can put roles in :multi as well as classes. at any rate, :multi() or anything type-based looks like more of an optimization to me My plan was just to have all the information in the signature, and side-step :multi aside from emitting the right number of _ for the arity. And then the Perl6Multi PMC would do the Right Thing, based upon the signatures. but it has to have intimate knowledge of the signature structure (which is okay) Which isn't a problem for langauge inter-op, because people will call through the Perl6Multi, which knows where tofind the type info. Right, because this is all internal to Perl 6. so then we need an efficient mechanism to build the signature structure Right. So my code now builds it inside a :immediate sub. e.g. at compile time I don't like :immediate. And attaches it as a property to the sub. So we build it at compile time. and the constraints need to be something attachable to the variables (in general, anytime we are doing things in w/inline PIR I think we're doing something wrong.) They are - they're just the blocks. It's should just be making a signature data structure which is an array of hashes at the moment. I can find a way to do the exact same without inline PIR, it was just easier this way. array is indexed based on parameter? Yeah hashes contain the properties? Right. name, constraints, etc. I had constraints as a list, but as you point out, it should be a junction. well, it could be a list, too, if we remembered to use all(...) on it Sure. There's more than one way to do it. I'm really uncomfortable with the $?SIG_BLOCK_NOT_NEEDED global and it feels to me as though the constraints should be attached to the PAST::Var nodes It'll have a load less use, if we're planning to get signatures to do the binding. I didn't parse that last one. PAST::Var - well, not really, because we'll just take a slurpy array and hashes and invoke the signature to do the binding for us. right. but if we're invoking the signature anyway, it doesn't have to be a slurpy array and hashes i.e., the signature is PIR. OK, but I mean in the sub itself that is called, and then invokes the signature. invokes or bind? if the signature is PIR, then it's just part of the prologue of the sub itself. Oh!! Damm. Now I get what you're trying to do. i.e., a signature is really effectively 'sub (...params...) { }' a block with a signature is 'sub foo(...params...) { ... }' -- i.e., it has a name and a body You want to have the PIR we generate that does the binding in the Parrot sub itself. effectivley that's what happens now, yes. it's just that the code currently binds a lexical first and then typechecks, whereas I think we should create a type-checking container and then bind it to a lexical symbol .signature somehow then needs to be able to return something useful, though. And I fear we're back to building two things. depends on how much introspection we can put into our blocks Because I don't see how we can get this PIR prologue in the sub to also provide the needed data. and since we're having to create Perl6Block _anyway_ We aren't any more though. You didn't like the way I did that, so we ended up just stashing its proto as a propery in the sub... heh I didn't like having to have a separate PMC for every type So we don't ever instantiate Perl6Block. I didn't like the fact that we had to have separate Perl6Sub, Perl6Method, Perl6Block, Perl6Routine, etc. I don't mind if we have one base class. Yeah, but the Sub vs Closure issues kinda got in the way of that. oh, I think that'll be fixed anyway -- see my latest posting to parrot-porters So it didn't work on that account either. :-| Ah, OK. Anyway, basically we need to know where we're going with this. I want to dig into MMD, and for that I need the type info available/accessible. I've made a patch with the function to create empty strings and using it in lot of places, RT#56750 yes, which is why I've been thinking about it a lot in the past couple of days. Right. I want that we do it *right*, I'm not trying to throw in some sucky hacked-up solution here. I agree, I never suspected otherwise. We both just aren't sure what *right* is. Right. pun intended? :) right! In some senses, if instead of digging into the internals of signature, I just define an interface, and use that with the MMD... Then it means we have the ability to refactor signatures anyway until they are right. "signature" ==> "signature as parrot sub", you mean? At some point though, when someone calls .signature, we need to return a Signature object. yes, I agree totally about that. I'm just curious about how we'll choose to represent it, and how to map signatures to individual variables outside of subroutine calls Well, if i make it so I can call .parameters and get something to iterate over to get the types and parameters, it lets us play with different underlying implementations until we get something that's right, without getting in the way of MMD progress. because it seems to me that as TimToady said, whatever we do for signatures in invokable blocks we ought to be doing for individual variable constraints as well and not have separate paths in actions.pm for that Yes. here's what I propose for now, since I have to get some lunch To me, having in actions.pm build a signature object, which in turns knows how to bind, seemed like the way to achieve that. % Ivatar has joined #parrot I'm going to continue to look and think about it (and I'm sure you'll do the same) with the incredible amount of useful information this conversation has brought OK, I need to eat too...getting late her! *here if I do any playing with refactors at this point, I'll do it in a branch we can probably discuss it more tomorrow as part of your Rakudo day (assuming I haven't usurped too much of today for it :-) Heh, you've probably made it a late night to get other stuff done that I need to do today. ;-) But it was a useful conversation. And maybe having it today unblocks things a bit more tomorrow. I totally agree that the separate Signature object has elegance to it, but I'm not comfortable with the way we're currently generating those So it's fine. I'm thinking you can count half of today as a rakudo day :-) certainly asking these questions and thinking about design is as important as writing code Oh, for sure. like totally! No point writing a bunch of wrong code. anyway, thanks a bunch for being patient with me on this :-) What specifically about the way it's being generated is worrying you, by the way? it just feels wrong. I'm still feeling like it should attach to PAST::Var nodes somehow. Purely the presence of :inline, the use of :immediate... Ah, OK. :inline and :immediate bug me too, but I'm not sure we can avoid :immediate The signature itself, or the type constraints? the type constraints. Perhaps the signature as well. I think not the signature, that's a sub level thing. Or block level, anyway. well, a signature feels like an array of PAST::Var nodes to me with constraints. But perhaps I just haven't thought it through. There's a bit more than constraints. I mean, the PAST::Var nodes already have things like :slurpy, :named, :optional, etc. :name Like, is one of them the invocant (before :), is it after ;; and so forth so it doesn't participate in MMD... sure, there are some things above the signature level Plus a signature also has a .of, which is the return type. sorry, above the parameter level Yeah. but right now all of it is being processed in method signature, where I think the parameter-specific things belong in method parameter and whatever returns ought to be usable for all of the various contexts where it is used (hopefully without setting a bunch of flags to indicate the context) And if a sub is just going to take a slurpy array and a slurpy hash and invoke a method on a signature object, maybe it can be? Because sub and method just do $( $ ) and emit code to generate that and attach the resulting data structure, in a :immediate sub, to themselves? well, even if we're doing that I think we can avoid slurpy array/slurpy hash, now that I think about it. OK. But I think the way to go to get the elegance we want, is that results in something that produces a signautre object. And different declarators (sub, method, my, etc) know what to do with that. well, should result in a PAST structure that produces a signature object Yes, sorry, that's what I was thinking/meant. but for any block declarator, we have to be able to generate the PAST::Var lexical nodes in the block itself i.e., they can't be in the signature i.e., they can't be strictly in this :immediate-generated thing that we attach to the .sub OK, but if the way that signature PAST is produced is well defined and in one place (it will be), then we can write something that says "here's some signature PAST, give me a list of variables it references" and then can loop over that and emit the code to generate them. As in, make the PAST::Var nodes. "give me a list of variables it references" is probably pretty nasty in PAST that has an icky smell to me It'd be nicely re-usable for all the things that need it. sure, but it's also starting to sound like the PAST structure is really the prologue to the sub :-) And it lets us encapsulate knowledge of signatures in the signature actions and this one sub. Yes, but the point is that this won't built a signature object that is useful in every case. okay. I'm going to play with a few things here then. Anyway, we're probably going to go round in circles on this now if we don't go eat something first. :-) * jonathan is at the point of starting to feel dizzy now! First, I'm going to see about eliminating :immediate, by giving a way to attach initialization stuff directly to a PAST::Block node OK. I may or may not end up with a PAST::Signature structure (which may be Perl 6 specific) that might simplify things a great deal May well do. since it could contain the lexical definitions, but also generate and attach the Signature stuff I'll go ahead and see if I can find a clean (to my sense of "clean") way to generate the Signature structures, but we'll leave them as data structure-ish for now. It would probably be neater than what I've tried to do, which is cobble current PAST stuff we do have into the right kinda shape. It's likely they'll be a form of Capture. (i.e., a subclass of Capture) That may well work nicely. well, it has a lot of the same attributes, and especially since Signatures are supposed to bind with Captures :-) Array slots for the parameter descriptors, and a hash slot for "of" and so forth. Or is that not what you were thinking? possibly. OK I'll have to think about how I want to get parameter passing in subs working first, the rest should fall out of that. anyway, I'll let you go eat, and do the same here. thanks again. Thanks to you too, for putting up with me. :-) dobru chut # nice meal :-) % AndyA has left AndyA!~andy@ca93nt.hexten.net % Theory has left Theory!~Theory@c-67-160-131-113.hsd1.wa.comcast.net % AndyA has joined #parrot % rdice has joined #parrot % ruoso has joined #parrot % Theory has joined #parrot % cjfields has joined #parrot % shamu has left shamu!~krishna@c-67-161-28-111.hsd1.ca.comcast.net r29208 | julianalbo++ | trunk: : [lua] Fixed luatable problem with Hash and clean warnings in other pmc diff: http://www.parrotvm.org/svn/parrot/revision?rev=29208 % gryphon has left gryphon!~gryphon@dsl-209-221-185-54.zipcon.net % gryphon has joined #parrot % rdice_ has joined #parrot % rdice has left rdice!~richard_d@CPE001ff33cb98b-CM00159a01d44c.cpe.net.cable.rogers.com r29209 | pmichaud++ | trunk: : [rakudo]: spectest-progress update: 94 files, 1677 passing tests diff: http://www.parrotvm.org/svn/parrot/revision?rev=29209 is use.perl.org down? ping use.perl.org /sbin/ping returned an error. ping is down :( I can't find is in the DNS. good, then I'm not crazy Whiteknight: it's been slow and hit-or-miss for me for the last week or more maybe we should nudge pudge gently darn, I wanted to post a blog update to tell the world that, while still broken and unusable, my branch is getting marginally better % cjfields_ has joined #parrot (marginally less broken and unusable)++ use.perl.org seems back up (at least for me) yeah, i just got int % sjansen has left sjansen!~sjansen@206.83.88.66.ptr.us.xo.net % cjfields has left cjfields!~cjfields@newrad.igb.uiuc.edu % cjfields_ is now known as cjfields % ruoso has left ruoso!~ruoso@201.45.49.162 r29210 | julianalbo++ | trunk: : [lua] Fix the previous fix for c++ compatibility diff: http://www.parrotvm.org/svn/parrot/revision?rev=29210 % Whiteknight has left Whiteknight!~nobody@c-71-230-33-251.hsd1.pa.comcast.net % Theory has left Theory!~Theory@68.178.103.210 % Theory has joined #parrot % Whiteknight has joined #parrot r29211 | Whiteknight++ | gsoc_pdd09: : [gsoc_pdd09] A few changes and a fudged makefile, and suddenly the build process completes. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29211 % jhorwitz has left jhorwitz!~chatzilla@96.245.16.45 Whiteknight++ no ++ just yet, it's still in terrible shape Whiteknight: in your gsoc_pdd09 branch my build continues up to ../../parrot --output=JSON/pge2pir.pbc JSON/pge2pir.pir % Theory has left Theory!~Theory@68.178.103.210 yeah, for some reason, JSON/pge2pir.pir is an empty file at that point ...so I edited the makefile to ignore it :) % sjansen has joined #parrot I can't even find it in Makefile anyway, doesn't matter it's just good to know that the segfault that had plagued you for so long isn't the big blocker anymore no, i figured out where that was happening with chromatics help and I commented out the code until I could find a fix for it :) % gryphon has left gryphon!~gryphon@dsl-209-221-185-54.zipcon.net % Limbic_Region has joined #parrot % Ivatar has left Ivatar!~graham@tu055.demon.co.uk % shamu has joined #parrot % sjansen has left sjansen!~sjansen@206.83.88.66.ptr.us.xo.net Yay! I isolated another segfault me++ karma me cotto_work has neutral karma cotto_work++ happy! (getting you up to positive numbers) % paco has left paco!~chatzilla@139.Red-80-36-122.staticIP.rima-tde.net perl6: say "cotto_work" ~ "++"; OUTPUT[cotto_work++␤] perl6: say "Whiteknight" ~ "++"; OUTPUT[Whiteknight++␤] r29212 | chromatic++ | gsoc_pdd09: : [src] Fixed coding standards. The only real functional change is that : C++-style line comments are now C-style comments, which may help some very : picky compilers. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29212 % rafl has left rafl!~rafl@62.75.161.67 perl6: say "ploy"~"glot"~"bot"~"++"; OUTPUT[ployglotbot++␤] that's kinda pretty with all those tildes % gryphon has joined #parrot % cjfields has left cjfields!~cjfields@cjfields.igb.uiuc.edu % apple-gunkies has left apple-gunkies!~chatzilla@cable-cmts3-65-161-245-232.vvm.com % rafl has joined #parrot r29213 | julianalbo++ | trunk: : Fix tab in lua.pmc diff: http://www.parrotvm.org/svn/parrot/revision?rev=29213 chromatic++ #codingstd fixes r29214 | moritz++ | trunk: : [pipp] codingstd: trailing whitespace diff: http://www.parrotvm.org/svn/parrot/revision?rev=29214 % Theory has joined #parrot % iblechbot has left iblechbot!~iblechbot@ppp-62-216-205-234.dynamic.mnet-online.de % kid51 has joined #parrot % TiMBuS has joined #parrot % ruoso has joined #parrot pmichaud: Going to get some sleep soonish. If you want more time to do your refactorings, I can hack on something that ain't signatures etc earlier on in the day... % Coleoid has joined #parrot where's the proper use of svn properties documented? % Coleoid has left Coleoid!~Coleoid@adsl-75-62-112-74.dsl.bltnin.sbcglobal.net % gryphon has left gryphon!~gryphon@dsl-209-221-185-54.zipcon.net cotto_work: grep docs/project/committer_guide.pod for "svn properties setting" there is also a "Subversion properties" heading in pdd07. thanks % bacek_ has joined #parrot % bacek_ has left bacek_!~bacek@mcas-151.usr.optusnet.com.au % bacek_ has joined #parrot r29215 | Whiteknight++ | gsoc_pdd09: : [gsoc_pdd09] a few small changes denoting my debugging progress: : * Adding a "readme" status file to keep track of my progress : * Fixed some variable localization in Parrot_dod_trace_root : * Removed an assertion that was always wrong (and therefore unhelpful) in pobject_lives diff: http://www.parrotvm.org/svn/parrot/revision?rev=29215 % Theory has left Theory!~Theory@68.178.103.210 % AndyA has left AndyA!~andy@ca93nt.hexten.net % AndyA has joined #parrot r29216 | jkeenan++ | trunk: : [configure] Refactor code from auto::pack::runstep() into _set_format(), : _pack_test(), _set_packtypes(). Then test these internal subroutines. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29216 % TiMBuS has left TiMBuS!~Hurf@123-243-167-27.static.tpgi.com.au % kid51 is now known as kid51_at_dinner 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. pmichaud: I did some investigations about #56650. 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 And my parrot's knowledge are not so strong to fix it... % Eevee has left Eevee!~eevee@c-67-160-3-54.hsd1.wa.comcast.net % ewilhelm has joined #parrot % ewilhelm has left #parrot % kid51_at_dinner is now known as kid51 % Eevee has joined #parrot r29217 | jkeenan++ | trunk: : Add two tests to complete coverage of all conditions. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29217 bacek_: mine aren't strong enough to fix it either. I don't know when it'll get fixed. oh... % TiMBuS has joined #parrot bacek_, did you post a ticket about it? I could take a look at it with some more details Whiteknight: rt#56650 I's pmichaud's original ticket oh, okay Whiteknight: poblematic functions is mmd_distance and mmd_cvt_to_types so we want mmd_distance to be able to take a PMC array with class names, in addition to a simple string? supposedly it already can supposedly I can write :multi(['Foo';'Bar']) "supposedly"? I haven't tested it directly. Let me do that. Whiteknight: probably we want create RSA and put bare string into it and lookup in case when first lookup failed I'm still young and arrogant enough to think I can tackle any problem, so this should be a snap! "pmichaud" at 76.183.97.54 pasted ":multi already works with multi-string keyed types" (24 lines) at http://nopaste.snit.ch/13539 let's try it with an array pmichaud: if you'll add :multi(_) it will fail... oh, so then what does the ticket need? bacek_: it works for me r29218 | jkeenan++ | trunk: : Write unit tests for _handle_ncurses_need(). diff: http://www.parrotvm.org/svn/parrot/revision?rev=29218 "pmichaud" at 76.183.97.54 pasted "for bacek: works with :multi(_), also" (29 lines) at http://nopaste.snit.ch/13540 * Whiteknight has to look up "manhattan distance" on wikipedia... it even works when a ResizableStringArray is used to create the class "pmichaud" at 76.183.97.54 pasted "using RSA to create the class" (31 lines) at http://nopaste.snit.ch/13541 it doesn't work when the class is created from a namespace, and _that's_ what the ticket is about "bacek" at 211.29.157.151 pasted "Gotcha! Bug #56650" (34 lines) at http://nopaste.snit.ch/13542 % Ademan has left Ademan!~dan@h-67-101-40-38.snfccasy.dynamic.covad.net pmichaud: indeed % petdance has joined #parrot 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. 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) note also that it's probably an error to use newclass on both ['ABC';'Bar'] (the key) and the ['ABC';'Bar'] namespace. i.e., it should indicate a duplicate class or something. so what's the cause of that? The fact that in bacek_'s second example, the namespace was created indirectly? I think bacek's example isn't robust a simpler example is: % Andy has left Andy!~AndyL@host3130.follett.com % petdance is now known as Andy "bacek" at 211.29.157.151 pasted "Total screwing of parrot..." (30 lines) at http://nopaste.snit.ch/13543 in bacek_'s example, the type of the last argument should still be 'ABC';'Bar' swapping two parts produces 'right/wrong'... so it should still trigger the class method in bacek's example, the second newclass opcode should throw an exception. as we already have a ['ABC';'Bar'] class just a sanity check: classes that are created like that indirectly should be stored in the same lookup list as classes created directly, right? "pmichaud" at 76.183.97.54 pasted "simpler example showing failure" (25 lines) at http://nopaste.snit.ch/13544 because if it's not throwing an exception, I'm lead to believe Parrot isn't detecting the two namespaces as being equivalen in nopaste 13544, if you change the newclass line to read "$P1 = newclass ['ABC';'Bar']" (instead of using the namespace) then everything works. well, that's a confusing example! "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 as I understand it, every class has one associated namespace and vice-versa (although it's possible to create a namespace without a corresponding class) it's not possible to have more than one class for the same namespace so that gets back to my sanity check question: Why are your two examples returning two different results? I don't know why. I think it's a bug, and that's what I reported in RT#56650 :-) 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 I say that the two cases should absolutely be equivalent I don't see any benefit to having different behaviours like that 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. :-) Parrot would look somewhat different if I were that person. :-) newclass ['Abc'] passing Key pmc to Parrot_oo_registrer_class 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. :-) newclass $P0 (from namespace) passing just RSA . and this causes all problems. ...RSA, really? I thought it would be passing the namespace itself pmichaud: yes line? (gdb) p name->vtable->whoami.strstart $7 = 0x705e0e "ResizableStringArray" it would be a simple matter in the newclass opcode to always convert the input to one type of PMC or the other Who wants ack plugins? 657 Parrot_oo_register_type(PARROT_INTERP, ARGIN(PMC *name)) YOU want ack plugins! Andy, you have ack plugins? what about phththpt plugins? bacek: but when I create the class from a RSA, everything works. pmichaud: just a sec "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 % Ademan has joined #parrot Hey, we could have plugins that let you ack through tables! bacek_: it only seems to fail when using a namespace to create the class. RSA works, key words *works pmichaud: it converted to Key somehow so if it's an RSA or a key, it works as intended, but if it's a string, it doesnt? if it's a RSA or a key, it works as I expect, but if it's a namespace, it doesn't. Whiteknight: no. Parrot_oo_register_class recives Key event you create class from RSA s/event/even/ Breakpoint 1, Parrot_oo_register_type (interp=0xb122e0, name=0xd5d3c0) at src/oo.c:662 662 fail_if_type_exists(interp, name); (gdb) p name->vtable->whoami.strstart $8 = 0x705524 "Key" oops. Sorry. Its actually recieve RSA... * Whiteknight is even more confused now Whiteknight: http://nopaste.snit.ch/13543... bacek_: I still claim that example is bogus. well, except that the first call to 'foo' is an error pmichaud: yes. % Ademan has left Ademan!~dan@h-67-101-149-118.snfccasy.dynamic.covad.net We should get 'already registered' exception... but my example (13544) shows that error already. (the wrong sub call, not the already registered) 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 * bacek_ thinks always converting Key to RSA is not bad idea.. I don't think that's an issue either. (example coming.) "pmichaud" at 76.183.97.54 pasted "newclass from identical Key and RSA" (11 lines) at http://nopaste.snit.ch/13547 % Coleoid has joined #parrot okay, that's a bit weird. "bacek" at 211.29.157.151 pasted "Works..." (28 lines) at http://nopaste.snit.ch/13548 sure, I'd expect it to work there, because the class was created from a Key my problem is when the class is created from a namespace well, how does the "class created from a namespace" algorithm work? I don't know. Them's Parrot guts. i.e. what is that particular mechanism doing differently? % Limbic_Region has left Limbic_Region!~chatzilla@70.105.230.71 I really don't know how the class registry works (or is supposed to work). If I did, I could probably fix #56550 :-) % rdice_ has left rdice_!~richarddi@CPE001ff33cb98b-CM00159a01d44c.cpe.net.cable.rogers.com see, for example, RT#43419 (which is another bug that I haven't figured out what is supposed to happen) % contingencyplan has left contingencyplan!~contingen@cpe-76-186-27-146.tx.res.rr.com % Coleoid has left Coleoid!~Coleoid@adsl-75-62-112-74.dsl.bltnin.sbcglobal.net looks like the magic is happening in src/pmc/class.pmc lines 1083-1092 1079-1092* personally, I find the fact that Parrot tends to reduce all class references to string lookups quite scary. or string comparisons. it's iterating over the initialization object. for a simple key or a string, that creates a single attribute "Foo;Bar" but for an array, that creates two separate attributes "Foo" and "Bar" we could easily improvify that loop to split all strings at ';' wait, I'm confused why split strings at ';'? to get array-like behavior none of my examples had ';' in the strings passed to the newclass opcode maybe that's not the separator then. How does a namespace pmc stringify? does it get stringified? I figured the namespace pmc is passed as the pmc okay, rephrased: when I call VTABLE_shift_string on a namespace iterator, what do I get back? because that's the call that's making the magic happen ahhhh I would think that a namespace iterator would iterate over the keys in the namespace since a namespace is effectively a Hash that might explain a lot. note that I mean literally the keys (symbols) in the namespace, not the namespace's name. Could the hash iterate in a different order from an RSA? if I do: set_hll_global ['ABC'], 'foo', $P0 set_hll_global ['ABC'], 'bar', $P1 set_hll_global ['ABC'], 'baz', $P2 and then iterate over the ABC namespace, I'd expect to get back the keys 'foo', 'bar', and 'baz' because those are the symbols in the namespace right whereas if I have a RSA that was created from rsa = split ';', 'ABC' I'd get only one value back from the iterator -- I'd get 'ABC' so the namespace isn't treating it's base as one of it's keys? it may do that... my point simply being that iterating over the ['ABC';'DEF';'GHI'] namespace will not give you 'ABC', 'DEF', and 'GHI' it wont? what do you get instead? it will give you any symbols that were stored in the ['ABC';'DEF';'GHI'] namespace. okay, okay a namespace is a Hash, not a String :-) a RSA is an array (an array of strings) 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? actually, I'm thinking that 'get_name'() on a namespace may already return an array haha, this is too much I know it does for a class. at least, I seem to recall that it does. but wait wait wait either way, I know where the problem is happening, somebody just needs to tell me how to fix it lines 1079 through 1092 are not iterating over a name they're iterating over the given PMC they're iterating over a hash containing attributes to be used to initialize the class isn't that the same? yes, the 'init' PMC is a Hash containing attributes for initializing the class it's a list of attributes, not the components of the name which can be a namespace or an RSA I guarantee that the 'init' PMC is a Hash. Not a namespace nor RSA. it's never cast to one anywhere in the call chain from the newclass opcode at least, not that I have seen src/pmc/class.pmc:502-504 so are we looking instead at the "initialize_parents_pmc" call at 1123? 502-504 makes the class PMC a hash, but the init PMC is the direct input from the newclass opcode no. oh, no. wait. I see what's happening 502-504 creates the 'args' Hash from the stringified version of init_data and then that 'arg's Hash is passed to init_class_from_hash er, 'args' Hash no, the init function is only called if newclass is passed a null pmc okay, Whiteknight. okay, let me double-check my trace newclass calls src/pmc.c:pmc_new_init, which calls the instantiate method, not the init method newclass opcode calls pmc_new_init right which calls the instantiate VTABLE method (okay, you're right) oh shoot, i missed the second condition, you're right heh it only calls instantiate if typeof(init) is a class pmc we've confused each other for a namespace/rsa/whatever, we call int init* right. and then init builds a hash and calls init_class_from_hash right, right however oh, never mind... misread on my part anyway, inside of init_class_from_hash, we see if there's a 'name' key there is, (because it was set inside of VTABLE init) % Auzon has left Auzon!~ak9@24-171-76-148.dhcp.mtvr.il.charter.com so, we do a lookup (line 186) check to see if it's a namespace (line 191) and get the name of the namespace into name_arg (line 193) at this point I *think* that name_arg is an array PMC of some sort -however- dunh dunh dunh! _but_ I think that in the case of a namespace pmc, name_arg will also include the name of the hll namespace % Auzon has joined #parrot whereas with the else part (lines 195-199), name_arg will be treated as relative to the current hll we should toss in some diagnostics, and see what, exactly it does contain in other words, if I pass in a namespace like ['ABC';'Foo'], then get_name on that namespace probably returns 'parrot','ABC','Foo' and so name_arg ends up with 'parrot','ABC','Foo' 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? personally, I think that we should prepend the hllnamespace to all other objects, because of RT#43419 however, I guarantee that this will have far-reaching effects throughout all of Parrot do I smell the need for a new branch? because then $P0 = new 'Integer' has to recognize that we mean 'Integer' in the current 'hll' where right now 'Integer' is "global" across all HLLs same is true for get_class well, then maybe we wouldn't do any prepending for a literal string like that in which case strings would always have to be 'parrot';'Integer' or we'd have to keep track of two sets of names, or two types of names so...unfixable? I don't know. These are are architectural decisions which I'm not the person to be making them. fair enough allison and/or jonathan probably need to be making these decisions. % Auzon has left Auzon!~ak9@24-171-76-148.dhcp.mtvr.il.charter.com I'm perfectly fine with saying that string arguments to get_class/newclass/subclass continue to work as they always have whereas key arguments could get an appended hll namespace to better align their behavior with namespace pmcs yes. Either that or we always require the hll namespace as part of the key, and treat them all relative to the root namesapce ii.e., $P0 = new ['parrot';'Integer'] that's an option too: always require an hll namespace in a call to newclass or, the most likely option would be to always use a namespace to reference a class thus $P0 = get_root_namespace ['parrot';'Integer'] $P1 = new $P0 but then when we get to things like :multi(...) .sub 'foo' :multi(['ABC']) I think that we have to treat ['ABC'] as being relative to the current hll namespace so not an explicit .sub 'foo' :multi(['parrot';'ABC'])? we could do that too, but it breaks a lot of existing :multi code s/too// i.e., that'd be a significant architectural change. % kid51 has left kid51!~jkeen@pool-70-107-18-52.ny325.east.verizon.net does interp cache the current hll namespace? I think so, yes. then for multis it would be easy enough to get that value implicitly actually, it caches all namespaces up the call chain, iirc because we can do $P0 = getinterp $P1 = $P0['namespace';1] to determine our caller's namespace I didn't put this in the ticket, but here's the real example I want to get to work (typing, then nopasting) ok % Auzon has joined #parrot "pmichaud" at 76.183.97.54 pasted "what I really want/need for getclass " (25 lines) at http://nopaste.snit.ch/13549 this the same as #56650, but I added HLL stuff to it. 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 % Theory has joined #parrot okay, that seems straightforward enough actually getting back to your earlier question 02:54 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? I wonder if stripping the hll namespace will be sufficient to let my examples work I know that the hll stuff works if the class is created using a key or resizable PMC array sorry, ResizableStringArray but it doesnt work if we create it using a namespace object, at least, not without some modification 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.) 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 hypothetical, what if the class pmc had an additional attribute field reserved for an HLL namespace name if provided, it's used, if null, the class is global it shouldn't need that, really there's no such thing as a "global" class. every class has a namespace and so that namespace will have an hll namespace. well, I'm thinking about the simplicity of $P0 = new 'Integer' and the like even 'Integer' is really ['parrot';'Integer'] and I think it's a bit of a mistake for HLLs to assume that 'Integer' would get them to the parrot 'Integer' class. ok, i didnt realize that there aren't that many languages making use of .HLL yet (for precisely these reasons, I suspect) I thought there was a lot of work to make .HLL work as advertised 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 :-) 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. I've got some tuits tomorrow to throw at it I don't think it would break any existing code -- I doubt anyone else is actually constructing classes from namespaces yet :-) anyway, I have to run okay, talk to you later so I'll see you all later % teknomunk has joined #parrot r29219 | allison++ | pdd25cx: : [pdd25cx] Change the scope of handlers, so they're always local to the current : context. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29219 % Whiteknight has left Whiteknight!~nobody@c-71-230-33-251.hsd1.pa.comcast.net % teknomunk has left teknomunk!~teknomunk@r74-195-239-111.stl1cmta01.stwrok.ok.dh.suddenlink.net r29220 | cotto++ | trunk: : [pmc] Add a freeze/thaw test case. This one passes. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29220 is there any reason not to implement get_string for fixedbooleanarray such that it returns a string of zeros and ones? it definitely makes testing easier % Psyche^ has joined #parrot % Patterner has left Patterner!~Psyche@e177229197.adsl.alicedsl.de % Psyche^ is now known as Patterner r29221 | cotto++ | trunk: : [pmc] Added get_string method and freeze/thaw tests. All pass. diff: http://www.parrotvm.org/svn/parrot/revision?rev=29221 % Theory has left Theory!~Theory@c-67-160-131-113.hsd1.or.comcast.net % Theory has joined #parrot % Andy has left Andy!~Andy@64.81.227.163 % Eevee has left Eevee!~eevee@c-67-160-3-54.hsd1.wa.comcast.net % uniejo has joined #parrot % stupidbot has left stupidbot!bacek@123-243-38-218.tpgi.com.au % UltraDM has joined #parrot % bacek has left bacek!~bacek@123-243-38-218.tpgi.com.au % Theory has left Theory!~Theory@c-67-160-131-113.hsd1.wa.comcast.net % jan has left jan!~chatzilla@89-253-66-101.customers.ownit.se