Camelia, the Perl 6 bug

IRC log for #parrot, 2010-09-05

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:02 kid51 What does ~~ mean?
00:03 tcurtis I think cotto does that just to say something so that the bots will tell him if he has a msg. (saying this instead of waiting for him to answer you is me doing similar).
00:04 theory left #parrot
00:07 Coke kid51: it's a wave.
00:08 Coke the . is just me "what tcurtis said"
00:08 Coke cotto is being more social than I.
00:08 theory joined #parrot
00:09 pjcj joined #parrot
00:31 contingencyplan left #parrot
00:49 whiteknight joined #parrot
00:53 dalek parrot: r48795 | plobsing++ | trunk/compilers/imcc/pbc.c:
00:53 dalek parrot: [TT #1763] always register annotations segment with the containing directory
00:53 dalek parrot: this way, annotation segments always get cleaned up
00:53 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48795/
00:54 Psyche^ joined #parrot
00:55 Paul_the_Greek joined #parrot
00:55 Paul_the_Greek Evening, kids.
00:56 dalek TT #1763 closed by plobsing++: Memory leak in PackFile_Annotations_new
00:56 dalek TT #1763: http://trac.parrot.org/parrot/ticket/1763
00:59 Patterner left #parrot
00:59 Psyche^ is now known as Patterner
01:10 dalek rakudo: c7f6f27 | kyleha++ | / (2 files):
01:10 dalek rakudo: spectests in git
01:10 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c​7f6f270a2545dbad015c4f1f4da81cfd97a5691
01:32 Paul_the_Greek left #parrot
01:42 kid51 msg Paul_the_Greek Your proposal for TT #1200 sounds good to me -- though we'll have to poke the people who voiced opinions in the earlier RT to get consensus.
01:42 purl Message for paul_the_greek stored.
01:42 aloha OK. I'll deliver the message.
02:11 jjore_ joined #parrot
02:12 jjore left #parrot
02:30 whiteknight left #parrot
02:35 janus left #parrot
02:44 shockwave Am I right in assuming there is no speed (or semantic) difference between: $P0 = 5 (which is sugar for: $P0 = set 5); and $P0 = assign 5 ?
02:49 plobsing shockwave: for the moment, they are duplicates. One (likely assign) should be eliminated.
02:51 tcurtis plobsing: They appear to have difference definitions. set_p_p does "$1 = $2", assign_p_p calls $1's assign_pmc vtable.
02:52 tcurtis oh, that's assign_p_i.
02:52 plobsing tcurtis: yes, they differ only for the p_p case AFAICT
02:53 shockwave I actually like the duplication.
02:53 shockwave I helps keep code outputed consistent.
02:53 shockwave As in "If the value being assigned is a scalar, use 'assign". Then, it doesn't matter if the rvalue is an literal scalar or a PMC.
02:54 shockwave That's nice.
02:54 shockwave Please, don't remove it.
02:56 plobsing but it is inconsistent. set_x vtables are for set. It would make sense for assign_x vtables for assign, except that the only type that actually requires an assign is PMCs because they are reference types and sometimes need value-type assign semantics
02:58 plobsing not to mention, assign was added as an attempt to address Parrots assignment weaknesses as perceived by rakudo. I'm no expert, but AFAIK, they failed in that regard.
02:58 plobsing s/they/it/
02:58 shockwave @plobsing. If the dups are removed, I'm sure I can work around it. If it makes the code cleaner, there is no contest.
02:59 shockwave but, do NOT remove the assign_p_p one.
02:59 shockwave It's a life saver.
02:59 plobsing of course. that does something different.
02:59 shockwave cool.
03:00 plobsing It'll take a deprecation cycle as well. Not experimental, not deprecated.
03:01 shockwave Sounds resonable.
03:05 plobsing shockwave: are you actually successfully using assign_p_p? I'm somewhat surprised something that funky and underused is working.
03:06 shockwave @plobsing: Yes, I started using it today. I'm just about finished with the code generation portion of my compiler, and so I'm taking care of some low hanging fruits of optimizations. One of them is field(attribute) register caching.
03:07 shockwave This is so that there are not so many getattribute calls all over the place.
03:07 shockwave (and also setattribute)
03:07 shockwave Because of that change, I now have to use assign to make sure $P0 = $P1 does not have reference semantics when they are of scalar types.
03:07 dalek parrot: r48796 | nwellnhof++ | branches/charset_massacre (32 files):
03:07 dalek parrot: Bring branch up-to-date with trunk
03:07 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48796/
03:13 janus joined #parrot
03:20 shockwave @plobsing: I'm gonna vote no on that deprecation of the overloaded 'assign' opcodes. They just make things very convenient.
03:22 plobsing shockwave: it's not high on my todo list. and I'm growing unsure of which of set_p_i and assign_p_i is the inconsistent one.
03:23 plobsing the more I think about it, set_x_y seems inconsistent. but that would horribly break a lot of existing code generation, pir, and pbc.
03:23 plobsing (where x != y)
03:25 shockwave @plobsing: Just to re-iterate my reason of is nice to have assign overlap with the functionality: When doing $P0 = assign <scalar>; One doesn't have to worry about whether <scalar> is a literal or a PMC. Otherwise, at least in my implementation, I have to pass around info on whether something is a field (and hence reference) or not. Ugly.
03:26 shockwave s/is nice/why is nice/
03:27 shockwave Please, consider my comments "User feedback".
03:29 plobsing what we've done in the past in this sort of situation is to create virtual ops in the pir compiler
03:29 plobsing I'm not a big fan of having a "user friendly" assembler though. It's a mess as a result.
03:29 kid51 left #parrot
03:30 shockwave I'm not sure what "virtual ops in the pir compiler" is.
03:31 plobsing there's likely already ops you use that don't actually exist. they just get translated by the pir compiler to ops or sequences of ops which do.
03:31 shockwave ah, some sort of alias.
03:35 shockwave Thanks for the help, @plobsing.
03:36 shockwave Time for bed. I can't keep my eyes open anymore.
03:36 shockwave Peace
03:36 shockwave left #parrot
03:49 tetragon left #parrot
03:58 ruoso left #parrot
04:13 ruoso joined #parrot
04:17 nwellnhof_ joined #parrot
04:21 nwellnhof left #parrot
04:21 nwellnhof_ is now known as nwellnhof
04:26 plobsing left #parrot
04:28 nwellnhof left #parrot
04:48 jsut left #parrot
05:42 cognominal left #parrot
05:43 cognominal joined #parrot
06:00 cognominal left #parrot
06:00 cognominal joined #parrot
06:49 fperrad joined #parrot
07:13 dalek lua: 0b6aff1 | fperrad++ | doc/running.pod:
07:13 dalek lua: parrot is installed
07:13 dalek lua: review: http://github.com/fperrad/lua/commit/0b​6aff18b3caf2092257661d687292fa294ad892
07:28 wagle left #parrot
07:28 nopaste left #parrot
07:29 wagle joined #parrot
07:30 theory left #parrot
07:30 nopaste joined #parrot
07:31 bacek_at_work left #parrot
07:31 bacek_at_work joined #parrot
07:40 contingencyplan joined #parrot
08:02 tcurtis left #parrot
08:07 jsut joined #parrot
08:17 jhelwig left #parrot
08:18 p6eval left #parrot
08:18 Coke left #parrot
08:18 Coke joined #parrot
08:19 s1n left #parrot
08:19 p6eval joined #parrot
08:19 bacek left #parrot
08:19 treed left #parrot
08:19 treed joined #parrot
08:19 bacek joined #parrot
08:20 s1n joined #parrot
09:11 contingencyplan left #parrot
10:14 whiteknight joined #parrot
10:29 M_o_C joined #parrot
11:22 bacek aloha, humans
11:47 elmex left #parrot
11:53 elmex joined #parrot
11:55 whiteknight good morning, bacek
11:56 bacek good evening, whiteknight
11:57 whiteknight bacek: what is the status of gc_massacre? I haven't looked at it in a while
11:58 bacek me too...
11:59 bacek It was require good piece of work - calculating of allocated memory.
11:59 bacek For triggering GC.
11:59 bacek And properly encapsulated "String GC" allocations
12:01 whiteknight ok
12:02 whiteknight that was for the gc_ms2.c, right?
12:02 bacek yes
12:02 bacek but it's kinda foundation for everything else
12:03 bacek e.g. GenGC will still reuse same "String GC"
12:03 bacek and code to calculate allocated memory
12:04 whiteknight okay
12:11 whiteknight bacek: I want to put that project back in the spotlight and try and get it complete ASAP
12:18 bacek me too
12:19 bacek but I don't have much spare time nowdays...
12:20 whiteknight that's fine. I have some time
12:25 bacek Start with splitting "String GC". afair you've got ticket for it :)
12:25 whiteknight ok
12:27 bacek whiteknight, #828
12:28 whiteknight Did the gc_massacre branch change anything outside the gc_ms2 core? Can we merge it back to trunk without killing anything?
12:28 whiteknight I would rather start a new branch that isn't so old
12:29 bacek I think so.
12:29 bacek It was little bit of touching other parts, but pretty much encapsulated inside src/gc
12:34 bacek whiteknight, I can sync branch with trunk
12:34 bacek in about 10-20 minutes
12:36 whiteknight bacek: I would rather just get the changes into trunk and be able to branch from there
12:36 whiteknight I'l work on that now, see how well it works
12:38 bacek there is few conflicts
12:39 whiteknight I'll look into it
12:40 whiteknight if the merge is no good I won't do it, but I think we can probably get the new files into trunk without breaking anything
12:43 bacek Unlikely...
12:43 bacek I separated "GC Stats" structure.
12:43 bacek And trunk's GC has some changes.
12:46 whiteknight yeah
12:48 bacek I resolved all conflicts locally
12:48 bacek trying to build branch.
12:50 Paul_the_Greek joined #parrot
12:51 M_o_C left #parrot
12:51 Paul_the_Greek left #parrot
12:52 whiteknight bah, merge to trunk is far too messy. I won't attempt a merge just yet
12:52 whiteknight I'll work on the branch in-place
13:00 dalek TT #1770 created by Paul_the_Greek++: Boolean PMC without Integer
13:00 dalek TT #1770: http://trac.parrot.org/parrot/ticket/1770
13:13 bacek whiteknight, I updated branch
13:13 bacek beware :)
13:13 whiteknight bacek: okay
13:17 dalek parrot: r48797 | bacek++ | branches/gc_massacre/t/pmc/io.t:
13:17 dalek parrot: Remove duplicated test from t/pmc/filehandle.t
13:17 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48797/
13:17 dalek parrot: r48798 | bacek++ | branches/gc_massacre/src/gc/gc_ms2.c:
13:17 dalek parrot: Add preliminary support for 'lazy' GC
13:17 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48798/
13:34 dalek parrot: r48799 | bacek++ | branches/gc_massacre (259 files):
13:34 dalek parrot: Merge branch 'master' into gc_massacre
13:34 dalek parrot: Conflicts:
13:34 dalek parrot: MANIFEST
13:34 purl hmmm... MANIFEST is useful for lots of stuff and don't forget to regenerate the manifest with perl tools/dev/mk_manifest_and_skip.pl, unless i am using git-svn
13:34 dalek parrot: MANIFEST.SKIP
13:34 purl hmmm... MANIFEST.SKIP is Makefile.PL$
13:34 dalek parrot: src/gc/alloc_resources.c
13:34 dalek parrot: src/gc/gc_ms.c
13:34 dalek parrot: src/gc/gc_private.h
13:34 dalek parrot: src/gc/mark_sweep.c
13:34 dalek parrot: src/pmc/imageio.pmc
13:34 dalek parrot: src/string/api.c
13:34 dalek parrot: src/string/encoding/utf8.c
13:34 dalek parrot: t/op/gc-leaky-box.t
13:34 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48799/
13:40 jsut_ joined #parrot
13:45 jsut left #parrot
13:49 M_o_C joined #parrot
13:50 M_o_C left #parrot
13:52 M_o_C joined #parrot
13:56 M_o_C left #parrot
13:58 M_o_C joined #parrot
14:13 plobsing joined #parrot
14:15 Coke msg plobsing please be sure to have a chat with pmichaud before ripping out any of those opcodes. kthnxbye
14:15 purl Message for plobsing stored.
14:15 aloha OK. I'll deliver the message.
14:16 plobsing ~~
14:17 pmichaud which opcodes?
14:18 plobsing assign_p_x where x != p|pc are exact duplicates of set_p_x
14:20 plobsing are you using them for anything?
14:21 pmichaud yes, PCT and Rakudo both use them.
14:22 plobsing they use the non-pmc variants? what for?
14:22 pmichaud well, let's look at this a second.
14:22 pmichaud first,  assign_p_s is not the same as set_p_s
14:23 plobsing what does "assign_string_native" mean?
14:24 pmichaud "assign" and "set" actually have different meanings, when dealing with references
14:25 plobsing but with immutable strings, strings become more value-ish even if they are still implemented with pointers
14:25 pmichaud pct uses 'assign' for the meaning of "copy a value from source to target"
14:25 pmichaud whereas it uses 'set' for 'bind the target to the source'
14:25 pmichaud pct doesn't want to have to say "if it's an int or num, use 'set', otherwise use 'assign'"
14:26 pmichaud so technically speaking, if you were to get rid of any opcodes, you would need to get rid of the set_p_i and set_p_n variants
14:26 pmichaud because they're actually doing value copies instead of binds
14:27 macroron joined #parrot
14:28 plobsing I'm inclined to agree, but that would likely break a large body of existing code.
14:29 pmichaud correct
14:29 pmichaud so I'm inclined to allow the duplication for now.
14:30 plobsing my course of action on this, if anything, would be to translate any eliminated duplicates in the pir compiler.
14:31 plobsing such as is done with isgt vs islt now
14:31 plobsing s/islt/isle/
14:32 pmichaud I'd be somewhat opposed to that approach also.
14:32 plobsing why?
14:32 purl why is probably because mysql blargs the big shlong
14:32 pmichaud Someday we'd like to be able to generate bytecode directly, without PIR.
14:32 pmichaud and it's kind of a pain if every bytecode generator has to understand that distinction too.
14:32 plobsing and when that day comes, you'll have to deal with a less than regular opset
14:33 plobsing it is already that way.
14:33 pmichaud so, you'd keep 'assign' and remove 'set' but have it translated in the pir compiler?  I might be okay with that.
14:33 tcurtis joined #parrot
14:33 pmichaud I'd be against removing assign and keeping set.
14:35 plobsing yes, set_x_y where x != y isn't really set anyways
14:35 pmichaud at any rate, I feel like it's entirely a false optimization until all assignment-versus-binding issues have been addressed
14:35 pmichaud it's certainly cheaper overall to have both assign and set for the time being
14:35 pmichaud than it would be to have anything have to worry about translating one to the other
14:35 plobsing what are the standing issues with assignment-vs-binding?
14:38 pmichaud http://trac.parrot.org/parrot/wiki​/WhyDoesNQPGenerateInefficientCode  is part of it
14:38 pmichaud there's also an issue of lvalue semantics, especially for containers
14:39 shockwave joined #parrot
14:41 nopaste "shockwave" at 192.168.1.3 pasted "Code snippet to illustrate question." (25 lines) at http://nopaste.snit.ch/23235
14:41 shockwave Hi.
14:41 shockwave I have a question about lines 12 and 25 in the code snippet I posted above.
14:43 shockwave Essentially, I'm trying to assign a refeference-type value to a field(attribute) by assigning to a register that contains a reference to that attribute. It doesn't work as I thought. My question is, what is the semantics of that kind of assignment?
14:45 pmichaud shockwave: parrot doesn't really have a reference type
14:45 plobsing getattribute obtains the value of the attribute, not a reference to the attribute.
14:45 pmichaud in rakudo, we ended up creating our own
14:46 shockwave err... I remember reading something in some docs about "if you assign this value to the register, the attribute to which this point will be updated", (paraphrasing)
14:46 shockwave That's kinda like ref semantics.
14:47 pmichaud I don't remember anything like that.
14:47 plobsing where did you read that?
14:47 shockwave One sec, let me find it.
14:50 shockwave http://docs.parrot.org/parrot/latest/ht​ml/docs/book/pir/ch07_objects.pod.html
14:50 shockwave Attributes
14:50 purl it has been said that Attributes is http://perlmonks.org/?node_id=631931 or working in roles with MooseX::MethodAttributes::Role or how Catalyst assigns Action types
14:51 shockwave "Because PMCs are containers, you may modify an object's attribute by retrieving the attribute PMC and modifying its value. You don't need to call setattribute for the change to stick:"
14:51 pmichaud there are so many things wrong with that statement it's hard to know where to begin.
14:52 pmichaud (and with that example)
14:52 shockwave pmichaud, I think that example works. At least with scalars.
14:52 pmichaud shockwave: no, it only works with int/num/str
14:52 shockwave Some of my validation tests have been passing, which work like so.
14:52 pmichaud $P10 = getattribute 'bar'
14:53 pmichaud $P10 = $P11    # doesn't change 'bar'
14:53 pmichaud and $P10 = getattribute 'bar'  only gives back a PMC if one has been previously set using setattribute
14:54 pmichaud otherwise it ends up being the null PMC, and then doing  $P10 = 5  gives a "Null PMC" exception
14:54 plobsing shockwave: you get a PMC back, if you mutate it, you also mutate the PMC contained in the attribute; if you overwrite the register containing it, nothing happens to the attribute
14:54 pmichaud and if 'bar' is a non-scalar PMC -- e.g., a Hash or ResizablePMCArray, then   $P10 = 5  doesn't do at all what you would expect
14:54 shockwave Ok, so it sorta works with ref-semantics for int/num/strings. For PMC, it's something else.
14:55 M_o_C left #parrot
14:56 shockwave @plobsing: I'm not sure what this means: "if you overwrite the register containing it, nothing happens to the attribute"
14:56 shockwave Can you explain that?
14:56 pmichaud $P10 = $P11   translates to a set opcode
14:56 pmichaud thus
14:57 pmichaud the above is the same as
14:57 plobsing $P0 = $P1 overwrites the contents of the $P0 register with the contents of the $P1 register
14:57 pmichaud $P10 = getattribute 'bar'
14:57 pmichaud set $P10, $P11
14:58 pmichaud in other words,  "$P10 = $P11"  doesn't mean "copy the value of the PMC at $P11 into the PMC at $P10"
14:58 pmichaud it means "bind the register $P10 to the PMC at $P11"
14:58 pmichaud and the attribute remains untouched
14:59 plobsing pmichaud++ # much better explanation
15:01 shockwave I'm sort of confused. I've kinda been thinking about registers for attributes as essentially acting like C pointer dereferences (*P0 = *P1), but you guys are saying that is more like pointer to pointer assignment, where only the local value is changed, but what is reference to stays the same?
15:02 plobsing exactly. $Px registers are basically pointers.
15:03 shockwave damn
15:04 shockwave Just to make sure: It does act like pointer dereference when the rvalue is a scalar: *P0 = 5 ; right?
15:04 plobsing no. it does $P0.set_integer(5). whatever the object in $P0 decides is appropriate happens.
15:04 plobsing for example, arrays extend or truncate.
15:05 shockwave ah, that makes sense. That's why it acts like it's working for scalars, because when assign an int to an Integer register, the value does get updated. Same for floats and strings.
15:06 shockwave but the atts are not actually updated to point to the new register.
15:07 pmichaud just keep in mind that '=' in PIR doesn't really mean "assignment"
15:07 pmichaud it means "set"
15:07 shockwave @pmichaud: I'm slowly comming to that realization -- the hard way :|
15:10 shockwave So setattribute it is for any rvalue that is of reference type.
15:10 shockwave Thanks guys.
15:11 Coke by "reference type" do you mean "PMC"?
15:12 shockwave @Coke: Sorta. I mean a PMC that is not of scalar type.
15:12 ruoso left #parrot
15:13 shockwave A PMC that is int will just be set'ed
15:14 tetragon joined #parrot
15:16 Coke no, setattribute is for any PMC
15:16 Coke that is, you can store /any/ PMC in an attribute.
15:18 ruoso joined #parrot
15:18 shockwave @Coke: I know. I'm just trying not to use setattribute if I don't have to. If I already have a reference to a scalar attribute, say in $P3, then '$P3 = 5' works better than the setattribute counterpart.
15:19 shockwave The discussion above was about how such thing would not work on Reference type pmcs (PMCs which are not scalar).
15:19 pmichaud setattribute simply binds an object's attribute to a PMC
15:22 shockwave @pmichaud: You're saying that "setattribute 'x', $P1" is more efficient than "$P1 = $P2" when both are ints?
15:22 pmichaud shockwave: no.
15:22 pmichaud shockwave: I'm simply saying what setattribute does.
15:23 shockwave @pmichaud: I wasn't being defiant, I was just trying to understand.
15:23 pmichaud "rvalue of that is of reference type"  doesn't really make sense to me
15:23 shockwave That means an rvalue which is a PMC whose value is not scalar.
15:24 pmichaud that still doesn't make sense to me.
15:24 plobsing all PMCs are reference types by definition
15:24 pmichaud neither does that
15:24 pmichaud I guess I don't know what you mean by 'reference type'
15:25 shockwave It's something I'm making up to explain the concept in my mind of:
15:26 shockwave A) if $P1 is an attribute, and $P2 is a PMC that is of scalar type, then: $P1 = $P2 behaves like *$P1 = *$P2.
15:26 pmichaud $P1 is never an attribute.  That's where the model breaks down.
15:26 pmichaud $P1 is a register, it points to a PMC.
15:27 pmichaud it may happen to point to a PMC that an attribute is also pointing to
15:27 shockwave $P1 is a register which points to an attribute.
15:27 pmichaud no
15:27 pmichaud $P1 is a register that points to a PMC that an attribute may also be pointing to
15:27 pmichaud but $P1 never refers to an attribute as an attribute
15:28 shockwave Ok, with your definition, it ends up meaning the same thing for me (though, thanks for the clarification). The new definition would then be:
15:28 shockwave $P1 is a register that points to a PMC that an attribute is also pointing to.
15:29 pmichaud setattribute simply changes the PMC that an attribute points to
15:29 shockwave Using the mathematically law of transitivity: a = b = c == a = c
15:29 pmichaud I should rephrase that.
15:30 pmichaud setattribute simply causes an attribute to point to a PMC
15:31 shockwave This could mean, then, that setattribute $P1, $P2 -- where $P2 is a scalar PMC -- could be more effecient that $P1 = $P2, which calls $P1.set_integer()
15:31 pmichaud 15:26 <shockwave> A) if $P1 is an attribute, and $P2 is a PMC that is of scalar type, then: $P1 = $P2 behaves like *$P1 = *$P2.
15:31 pmichaud this is wrong.
15:31 pmichaud $P1 = getattribute obj, 'foo'
15:32 plobsing shockwave: $P1 = $P2 never calls $P1.set_integer()
15:32 pmichaud $P2 = box 5
15:32 pmichaud $P1 = $P2   # 'foo' is unchanged
15:32 plobsing $P1 = 5 does, but that is because it is equivalent to '$I0 = 5; $P1 = $I0'
15:33 shockwave Yes, in this case it would be: $P1 = assign $P2, which does call $P1.set_integer()
15:33 pmichaud all that "$P1 = $P2" does is cause the register $P1 to point to the PMC given by $P2
15:33 pmichaud it doesn't actually change the values of any PMCs
15:34 shockwave It's my fault that I've been leaving out the 'assign' opcode in: $P1 = assign $P2
15:35 shockwave This is, of course, totally confusing and different.
15:35 shockwave I apologize for that.
15:36 shockwave The assign opcode would only be used when $P2 is of scalar type.
15:36 plobsing why?
15:36 purl why is because mysql blargs the big shlong
15:36 shockwave That's what I meant that they acted like: *P1 = *P2
15:37 plobsing purl, forget why
15:37 purl plobsing: I forgot why
15:38 shockwave @plobsing: Why...What? Why does the assign opcode be used only for scalar PMCS?
15:38 plobsing why only for scalar types?
15:38 shockwave If so,
15:38 shockwave Because when $P2 is of non-scalar types, it tries to call set_pmc vtable func. It's much easier to just use setattribute in that case.
15:40 shockwave So, using the last definition of $P1 above, as clarified by pmichaud, where $P1 ends up being a PMC that points to a an attribute that points to another PMC; then:
15:40 shockwave $P1 = assign $P2; when $P2 is a scalar
15:40 shockwave and
15:41 shockwave setattribute self, 'x', $P2 ; when $P2 is non-scalar
15:41 shockwave that should give me the types of semantics for $P1 = $P2 that is seen on an HLL, like, say, PHP.
15:41 shockwave Correct?
15:42 tcurtis shockwave: $P1 = assign $P2 always calls the assign_pmc vtable.
15:42 shockwave @tcurtis: But those are defined for ints/nums/strings, right, so they just work out of the box.
15:42 pmichaud shockwave: not really correct, no.
15:43 pmichaud certainly not like PHP, at any rate.
15:47 tcurtis shockwave: The default assign_pmc delegates to set_pmc unless the RHS is Undef.
15:47 shockwave So, what is the bottom line? setattribute is *always* the best, most efficient choice?
15:47 shockwave (in the use-cases I posted above)
15:47 tcurtis Ah, wait, scalar does define assign_pmc.
15:47 shockwave I'll post the HLL language use case I'm trying to solve.
15:48 pmichaud shockwave: you're asking about efficiency, which to me implies a functional equivalence that doesn't really exist
15:49 pmichaud consider:
15:49 pmichaud $P1 = split ' ', 'the quick brown fox'
15:49 pmichaud setattribute obj, 'foo', $P1
15:49 pmichaud $P2 = pop $P1
15:49 pmichaud PHP semantics would expect that $obj.foo still contains 4 elements.  In PIR, $obj.foo contains three.
15:50 moritz becase = is binding in PIR, not assignment
15:50 moritz *because
15:50 pmichaud because *setattribute* is binding
15:50 AzureStone left #parrot
15:51 pmichaud in PHP,  $array = ('the','quick','brown','fox');  $obj.foo = $array;  array_pop($array);   would leave $obj.foo untouched
15:52 pmichaud (sorry, that should be $obj->foo = $array for proper syntax)
15:55 nopaste "shockwave" at 192.168.1.3 pasted "HLL example" (26 lines) at http://nopaste.snit.ch/23236
15:56 shockwave the syntax above is supposed to be: public class Test { // but that's not important.
15:57 shockwave The example above shows the types of semantics I'm looking for.
15:58 shockwave In the first Test, when field2 is assigned to field1, the contents of field2 are copied into field one, but field 2 remains untouched.
15:58 shockwave In Test2, when field2 is assigned to field1, they end up pointing to the same object.
15:58 shockwave s/object/instance
16:02 shockwave If we thought of field one as $P1 and field2 as $P2, then in Test 1, $P1 = assign $P2; and I guess in Test2 it would be setattribute self, 'field1', $P2
16:03 pmichaud sure, okay.  it runs into issues later, but the opcodes you've identified will give you something of the semantics you want for this case.
16:05 shockwave pmichaud: What I was trying to find out was: A) will these give me sematics I'm looking for (which you just answered), and B) is what doing the most effecient way of doing it (as opposed to always using setattribute).
16:06 shockwave Man, I've learned more in the last 2 days about PIR's assignment semantics than I did in the past 6 months.
16:08 theory joined #parrot
16:09 pmichaud in the case of B), you're talking about two different scenarios though.
16:10 pmichaud in the first (Test) case, using setattribute won't give you the same semantics
16:11 shockwave @pmichaud: Oh, sorry. You're right. Set attribute doesn't work for the first attribute.
16:12 shockwave I still asked the same question as when I came in, even thought it was answered during the discussion.
16:12 mikehh plobsing: ping
16:12 shockwave setattribute doesn't work for the first usecase. It should be: $P1 = assign $P2
16:13 shockwave Thanks for the remainder.
16:13 shockwave s/Set attribute doesn't work for the first attribute./setattribute doesn't work for the first use-case.
16:17 shockwave Thank you very much guys for being so patient and helpful. I'm gonna go implement this, now.
16:21 luben hello everybody
16:21 purl Hello Dr. Nick!
16:21 luben recent parrot segfaults when configured with --optimize
16:22 dalek parrot: r48800 | nwellnhof++ | trunk (2 files):
16:22 dalek parrot: [pmc] Fix String.is_integer
16:22 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48800/
16:23 luben ok, fixed by  nwellnhof++
16:24 plobsing mikehh: pong
16:27 mikehh plobsing: I am getting g++ build failures with src/pmc/nci.pmc - line 359
16:28 mikehh plobsing: ok with gcc but warnings
16:28 luben no, it is not fixes, still segfaults
16:28 purl okay, luben.
16:29 plobsing mikehh: I'll look into it.
16:29 mikehh plobsing: ./src/pmc/nci.pmc:359: warning: assignment from incompatible pointer type - also
16:29 mikehh ./src/pmc/nativepccmethod.pmc:116: warning: assignment from incompatible pointer type
16:31 mikehh plobsing: same assignment
16:31 mikehh so it will probably also blow up in g++
16:32 mikehh I tried adding (nci_thunk_t) but it needs more
16:36 plobsing should be resolved in r48802.
16:38 mikehh plobsing: trying now
16:39 dalek parrot: r48801 | mikehh++ | trunk/MANIFEST.generated:
16:39 dalek parrot: fix distro_tests failure - add pmc/nativepccmethod files to MANIFEST.generated
16:39 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48801/
16:39 dalek parrot: r48802 | plobsing++ | trunk/src/pmc (2 files):
16:39 dalek parrot: add casts to placate C++
16:39 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48802/
16:45 mikehh plobsing: looks like it works
16:54 mikehh plobsing:  that's what comes from not looking closely enough at the output - fixed the first but got the error on the second  - thought the error was still the first :-{
17:07 luben msg chromatic it seems that r48783 (Removed GC blocking when installing subs) introduced a bug when parrot is compiled with --optimize
17:07 purl Message for chromatic stored.
17:07 aloha OK. I'll deliver the message.
17:09 M_o_C joined #parrot
17:25 AzureStone joined #parrot
17:29 Topic for #parrot is now Parrot 2.7.0 "Australian King" Released! | parrot.org Log: irclog.perlgeek.de/parrot/today | Nopaste: nopaste.snit.ch:8001 |  close 25 tickets (
17:29 * dukeleto says darn
17:29 Topic for #parrot is now Parrot 2.7.0 "Australian King" Released! | parrot.org Log: irclog.perlgeek.de/parrot/today | Nopaste: nopaste.snit.ch:8001 |  close 25 tickets (12 to go), merge brances; profile your favorite PIR for memory leaks with valgrind
17:30 dukeleto Everyone: please update the closed ticket count in the /topic when you see a ticket closed. It should be correct now.
17:30 * whiteknight cannot make hll_map work today
17:31 pmichaud ...is anything using String.is_integer?
17:32 pmichaud that seems like a method that wants deprecation.
17:34 whiteknight I think I would agree
17:36 pmichaud log says it was added in dec 2005 but doesn't give any indication why
17:36 dukeleto pmichaud: do you have a chance to make me an admin on the parrot github org, so I can add others?
17:37 pmichaud dukeleto: done.
17:37 davidfetter joined #parrot
17:38 dukeleto pmichaud++
17:38 dukeleto davidfetter: howdy
17:38 purl que tal, dukeleto.
17:38 davidfetter hai dukeleto
17:38 * davidfetter getting ready to grill some grillables
17:39 davidfetter well, to prep the things that will eventually be grillables ;)
17:39 pmichaud looks like String.is_integer was (is?) being used by partcl
17:39 pmichaud at least, that's what the surrounding log entries indicate.
17:40 pmichaud it doesn't appear to be used by partcl anymore, however.
17:42 whiteknight dukeleto++
17:43 nopaste "Whiteknight" at 192.168.1.3 pasted "Can anybody see why this snippet doesn't work?" (25 lines) at http://nopaste.snit.ch/23237
17:43 whiteknight this hll_map thing is killing me
17:47 pmichaud whiteknight: ...you aren't in a different HLL?
17:48 pmichaud I don't know if you can remap things inside of the 'parrot' HLL.
17:49 whiteknight pmichaud: hmmm... damnit
17:49 luben msg chromatic Ignore my previous message, the error is somewhere in porting string_join to string_builder. It manifests in Parrot_str_clone - s->strstart is out of bounds
17:49 purl Message for chromatic stored.
17:49 aloha OK. I'll deliver the message.
17:49 whiteknight pmichaud: is there anyway to specify an HLL in NQP?
17:50 Coke dukeleto: if everyone updates the ticket count, it's going to be updated too many times.
17:51 dukeleto Coke: the first one to see a closed ticket does it
17:51 pmichaud whiteknight: depends on where you're wanting to specify it
17:52 whiteknight pmichaud: I have a test file that I'm trying write to test hll maps
17:52 whiteknight so I can put it anywhere in the file
17:52 Coke dukeleto: and how do I know I'm the first one?
17:52 dalek rakudo: 77a72a3 | pmichaud++ | src/core/IO.pm:
17:52 dalek rakudo: Refactor slurp($filename) to use Parrot's .readall($filename);
17:52 dalek rakudo: this results in a massive speedup for slurping a file into a string.
17:52 dalek rakudo: See TT #1749 for related parrot details.
17:52 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​7a72a31234229635f720f853d59b865342df17a
17:53 pmichaud whiteknight: if you're wanting an nqp program to run in a different hll namespace -- no, we don't have that yet.
17:53 pmichaud I've been thinking of a 'use hll ...'  pragma but haven't implemented it yet.
17:54 dukeleto Coke: irclogs
17:54 dukeleto Coke: if you see a closed ticket line on IRC, and the topic hasn't changed, you are the first one to see it
17:57 dukeleto tcurtis: what is your github id?
17:57 tcurtis dukeleto: ekiru
18:00 Coke dukeleto: PITA. You're on your own.
18:02 whiteknight I feel like that has to be a bug. Why wouldn't we be allowed to override type mappings in the default HLL?
18:02 dukeleto Coke: come up with something better. Please.
18:03 dukeleto Coke: a bot could update it, i guess.
18:04 plobsing doesn't trac have a database that could be queried?
18:06 whiteknight pmichaud: as a basic estimation, how difficult would a "use hll" pragma be to implement? I'll happily do it myself, just looking for an idea of how much time I need to set aside
18:06 Coke dukeleto: we don't care about that number enough to update it in realtime.
18:06 Coke s/we/I/
18:06 whiteknight Coke: if he cares enough, don't discourage him!
18:06 Coke and it's easy enough to calculate from the timeline.
18:06 Coke whiteknight: he's not saying he'll do it, he's trying to get other people to do it for him. ;)
18:07 whiteknight dukeleto: it may be an SQLite3 DB
18:08 Coke http://trac.parrot.org/parrot/timeline?from=09/05/​10&amp;daysback=5&amp;ticket=on&amp;update=Update
18:08 mikehh t/examples/namespace.t - Failed => get_string() not implemented in class 'NativePCCMethod
18:08 mikehh all other tests PASS (pre/post-config, make corevm/make coretest, test, fulltest) at r48802 - Ubuntu 10.04 amd64 (g++)
18:10 pmichaud whiteknight: I don't think it would take very long.
18:10 szbalint dukeleto: why don't you set a milestone for it and grab ticket numbers based on that?
18:14 dukeleto szbalint: i don't actually know how to do that
18:14 whiteknight pmichaud: okay. I have a few minutes to spare today since I can't get these tests written. I'll take a stab at a patch
18:14 theory left #parrot
18:14 dukeleto Parrot has a proper avatar on github! http://github.com/parrot pmichaud++
18:15 pmichaud whiteknight: essentially, upon seeing the 'hll' pragma you want to change the 'hll' attribute of the current PAST::Block to match.
18:15 whiteknight okay. I was hoping it would be so easy
18:15 pmichaud well, I don't know what roadbumps might be in the way :-)
18:16 dukeleto Coke: I didn't start the "update the ticket count in the topic meme", but it seems useful. just trying to make it continue
18:17 contingencyplan joined #parrot
18:17 whiteknight pmichaud: I'm not super-duper familiar with this repo. I'm updating stage-0? stage-1? stage-2?
18:18 PacoLinux left #parrot
18:18 pmichaud none
18:18 pmichaud you'd want to update NQP/Grammar.pm and NQP/Actions.pm
18:18 pmichaud we don't write NQP in pir anymore :-)
18:19 pmichaud stage[012] are all generated files.
18:19 pmichaud looks like src/NQP/Grammar.pm needs a 'use' statement
18:19 whiteknight ah, right. Sorry. I see where I need to go now
18:19 whiteknight thanks
18:20 szbalint dukeleto: ther is already a 2.8 milestone actually. You can modify tickets the normal way to assign them to milestones and this will give you a nice overview: http://trac.parrot.org/parrot/milestone/2.8 (nothing there yet atm, as no tickets are assigned to 2.8)
18:20 pmichaud and then src/NQP/Actions.pm would need an action method to handle the 'use' statement
18:20 szbalint *there
18:21 dalek TT #1771 created by whiteknight++: Cannot hll_map in parrot HLL
18:21 dalek TT #1771: http://trac.parrot.org/parrot/ticket/1771
18:23 dukeleto szbalint: thanks for that info, but I am not sure that solves our issue. We just want a count of how many tickets were closed in time period X
18:25 nwellnhof joined #parrot
18:25 szbalint ah I see. I misunderstood your intention :)
18:28 moritz dukeleto: re parrot on github/branches, I like the prefix approach
18:29 nopaste "plobsing" at 192.168.1.3 pasted "[PATCH] HLL mapping for root hll" (34 lines) at http://nopaste.snit.ch/23238
18:29 moritz dukeleto: just ignore any branches that contain a '/', so that we can have branches named topic/gc or cleanup/configure or so
18:30 plobsing whiteknight: I can get your example to work with the patch at http://nopaste.snit.ch/23238
18:31 whiteknight plobsing++. I figured it would be an easy fix, I'm wondering whether there is a design or policy reason why the current behavior is what it is
18:31 whiteknight but thanks for putting together a patch so quickly!
18:32 pmichaud I'm guessing the design reason is to keep type lookups in the parrot HLL fast
18:33 pmichaud otherwise things can get really slow really quick.
18:34 whiteknight that would be a reasonable explanation. I would need to look to see if there would be a performance issue
18:34 pmichaud just from looking at the lines surrounding that patch, there is.
18:35 pmichaud when not in the parrot HLL, Parrot_get_HLL_type ends up doing two array lookups
18:35 pmichaud (and possibly more)
18:39 pmichaud I must be reading this wrong.
18:39 pmichaud It looks like you pay those lookup penalties simply for declaring your language in a different HLL, whether you map a type or not.
18:39 whiteknight we can identify the common case where there are no HLL maps in the root HLL, and not look at all
18:39 pmichaud that's not the "common case", from a hll perspective.  Sorry.
18:39 whiteknight it is in the root HLL
18:40 whiteknight obviously, since there never has been a working map in that HLL
18:40 pmichaud Seems to me that the better approach would be to make type mapping more efficient for all hlls, not just the parrot HLL.
18:40 Andy joined #parrot
18:41 whiteknight yes, that's very true
18:42 whiteknight I have to go for a little bit. I'll be back later tonight
18:42 whiteknight left #parrot
18:45 pmichaud it's worth noting that the lines
18:45 pmichaud -    if (!hll_id || hll_id == PARROT_HLL_NONE)
18:45 pmichaud -        return core_type;
18:45 pmichaud -
18:45 pmichaud were added very recently (r48486) by chromatic
18:46 pmichaud added on 2010-08-13, in fact.  It'd be strange to take them back out :-)
18:47 kid51 joined #parrot
18:48 macroron left #parrot
18:55 PacoLinux joined #parrot
18:58 kid51 left #parrot
19:01 dukeleto moritz: yeah, ignoring branches with a / sounds like a good approach
19:05 dukeleto moritz: to be more specific, not deleting github branches with a / sounds like a good approach
19:05 NotFound joined #parrot
19:05 NotFound Hi
19:05 moritz dukeleto: that's what I meant, yes
19:06 dukeleto NotFound: wilkommen
19:24 smash hello everyone
19:27 dalek parrot: r48803 | nwellnhof++ | trunk (2 files):
19:27 dalek parrot: [pmc] StringBuilder should update compatible encodings
19:27 dalek parrot: Also avoid unnecessary encoding conversions
19:27 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48803/
19:35 dukeleto moritz: i've updated my script to not remove branches with /'s, thanks for the suggestion
19:59 cotto dukeleto++
20:10 pmichaud http://gist.github.com/566282  # why Parrot's GC is so painful  :(
20:10 pmichaud http://gist.github.com/raw/566282/69c06d2e2f6​c955080159ab614c797f36a3d4f56/gistfile1.perl # without github formatting ugliness
20:12 GeJ Bonjour everyone.
20:13 moritz pmichaud: maybe write that as an example to the mailing list, just to make sure everybody is aware of that problem to its full extend
20:15 pmichaud moritz: yes, I've been thinking of doing just that.
20:20 mikehh left #parrot
20:20 dukeleto pmichaud: so that says that parrot is spending ~20s to load perl6.pbc and the associated GC runs? just making sure I understand
20:21 moritz dukeleto: afaict it spends the time in long marker&sweep runs, because there are many more objects
20:21 moritz and they are reconsidered every time anew
20:25 pmichaud dukeleto: no.  It takes less than ~1 sec to load perl6.pbc
20:26 pmichaud After after loading perl6.pbc, it takes 20 seconds to slurp the file.
20:26 mikehh joined #parrot
20:33 pmichaud message sent to parrot-dev
20:33 purl Message for sent stored.
20:34 NotFound I have a segfault during build in amd64 with --optimize
20:34 NotFound r48802
20:35 luben NotFound, me too. It seems that bug is manifested with gcc-4.5 and not with gcc-4.4
20:36 luben I have tracked it to sting_join porting to StringBuilder
20:37 NotFound Ugly
20:38 luben gcc-4.4 -O3 shows another bug, but I am not sure if it is related
20:42 dukeleto i've started a git workflow doc. it is nascent, but it is a start! http://github.com/parrot/parrot/blob/leto​%2Fgit_docs/docs/project/git_workflow.pod
20:46 tcurtis_ joined #parrot
20:46 tcurtis left #parrot
20:46 tcurtis_ is now known as tcurtis
20:47 dukeleto pmichaud: ah, i understand now
20:47 dukeleto gcc bugs, oh my!
20:47 luben dukeleto, I think it is not bug in gcc
20:48 NotFound My segfault is in CodeString.pmc. I thought CodeString was deprecated.
20:48 dukeleto luben: that is slightly more comforting
20:49 dukeleto NotFound: eligible in 2.7
20:49 NotFound dukeleto: sometimes I assume that when we deprecate things we stop using them.
20:52 dukeleto NotFound: it looks like PGE and a few tests use it
20:53 NotFound dukeleto: yeah, and that's why parrot doesn't build
20:53 dukeleto NotFound: nqp-rx needs it to actually
20:53 NotFound Then why is eligible?
20:53 dukeleto NotFound: ext/nqp-rx/src/stage0/Regex-s0.pir uses it
20:54 NotFound No need to answer that.
20:54 dukeleto NotFound: ok :)
20:54 theory joined #parrot
20:55 sorear Regex-s0.pir is not a source file
20:55 NotFound The funny thing is that the backtrace shows a line where Parrot_str_join is called and the next frame is in Parrot_str_clone
20:57 dukeleto sorear: yes, i know it is generated, but it still uses a codestring PMC
20:57 dukeleto NotFound: are you using an optimized build?
20:58 NotFound dukeleto: without --optimize it build
21:00 bacek aloha, humans
21:04 mikehh hiho bacek
21:04 bacek hi mikehh
21:06 cotto aloha, bacek
21:08 cotto dukeleto++ again
21:09 dukeleto NotFound: adding in debug symbols might be useful. might not
21:09 dukeleto cotto: danke. working on the git workflow docs now!
21:40 Andy left #parrot
21:42 tcurtis left #parrot
21:51 luben left #parrot
21:51 luben joined #parrot
22:02 fperrad left #parrot
22:12 NotFound Axiom: every time we abuse string internals we create subtle bugs.
22:27 M_o_C left #parrot
22:32 plobsing_ joined #parrot
22:32 dalek parrot: r48804 | NotFound++ | trunk/src/pmc/stringbuilder.pmc:
22:32 dalek parrot: build a new string from the buffer instead of cloning a not fully valid string in StringBuilder get_string
22:32 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48804/
22:42 luben NotFound, ping
22:43 NotFound pong
22:43 luben NotFound, does the last commit fixes the bug for you
22:43 NotFound luben: yes
22:44 luben strange, I am trying here with -O3 and is still here... I have some differend fix that I am testing now
22:44 NotFound luben: amd64?
22:44 purl amd64 is Hammer, yeah.
22:44 luben yes
22:50 luben http://pastebin.com/iTLxTXVW
22:50 luben this is my suggestion. it fixes optimized builds on amd64 (-O2 and -O3)
22:51 luben it works successfully with parrot_str_clone in StringBuilder
22:51 NotFound I don't like that much gc blocking
22:52 luben neither do I
22:53 bacek you don't need GC blocking in this case
22:53 bacek C<result> will be handled by GC properly
22:54 luben bacek, trying here
22:55 luben :( it segfaults
22:56 luben I thing that not C<result> is collected here
22:57 luben but part of the string that is in process to be joined
22:57 bacek than it's bug in StringBuilder I think
22:58 luben May be yes. Previous Parrot_str_join was blocking GC, during its job, so I just used the same approach
23:00 bacek previous approach was workaround for STRING**.
23:00 bacek Current approach doesn't require it
23:01 NotFound Blocking gc in loops with a lot vtable calls to pmc of unknown types isn't exception safe.
23:02 bacek afk # dayjob
23:04 luben OK, than it is a bug in StringBuilder
23:10 nopaste "luben" at 192.168.1.3 pasted "join patch" (59 lines) at http://nopaste.snit.ch/23239
23:11 luben this is the same, rearranged patch - if it turns usefull somehow.
23:11 pjcj left #parrot
23:12 pjcj joined #parrot
23:12 NotFound luben: try r48805. Shouldn't be directly related with the problem, but who knosw.
23:12 luben OK
23:16 luben yes, it is fixed
23:21 NotFound Amazing
23:22 luben here, it works also with Parrot_str_clone in StringBuilder.get_string
23:23 dalek parrot: r48805 | NotFound++ | trunk/src/pmc/codestring.pmc:
23:23 dalek parrot: use concat instead of join when possible in CodeString
23:23 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48805/
23:25 NotFound The problem probably lies in cloning a STRINGNULL
23:25 NotFound Or a NULL
23:38 nwellnhof NotFound: i found a possible problem in Parrot_str_clone
23:41 NotFound nwellnhof: Only one? ;)
23:42 nwellnhof only one. but it looks like the stringbuilder is likely to trigger it.
23:42 nwellnhof i just made a commit
23:43 nwellnhof but i never had any stringbuilder related crashes
23:46 NotFound nwellnhof: looks like is crashing only in amd64 optimized builds
23:46 NotFound s/is/was
23:47 nwellnhof i'm on 32bit here
23:47 smash left #parrot
23:48 smash joined #parrot
23:48 smash left #parrot
23:52 plobsing_ left #parrot
23:57 dalek parrot: r48806 | nwellnhof++ | trunk/src/string/api.c:
23:57 dalek parrot: [str] Set buflen in str_clone
23:57 dalek parrot: review: http://trac.parrot.org/parrot/changeset/48806/

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

Parrot | source cross referenced