Parrot 1.8.0 Zygodactyly released | Latest modified TT's: icanhaz.com/parrotbugs | Parrot Languages: icanhaz.com/parrotlang
Set by moderator on 19 November 2009.
Coke pmichaud: you bout? 00:01
00:05 tetragon joined
dalek rrot: r42585 | jkeenan++ | trunk/config/gen/parrot_include.pm:
Re-order subs to be more consistent with other config step classes.
00:06
00:06 lucian joined
ttbot Parrot trunk/ r42585 i386-linux-thread-multi make error tt.ro.vutbr.cz/file/cmdout/148297.txt ( tt.ro.vutbr.cz//buildstatus/pr-Parrot/rp-trunk/ ) 00:08
00:13 bluescreen joined 00:14 plobsing joined
darbelo That's a rather odd error... 00:14
dalek rrot: r42586 | jkeenan++ | trunk/config/gen/config_h.pm:
Why do a sort 3 times when you only need to do it once?
00:16
bluescreen Hi, do you have any good example on how to define class's methods using PIR
I can't make it work I always get the Method 'blah...' not found for invocant of class '.....' 00:17
darbelo bluescreen: nopaste of the failing code?
bluescreen hold on 00:18
ttbot Parrot trunk/ r42586 i386-linux-thread-multi make error tt.ro.vutbr.cz/file/cmdout/148340.txt ( tt.ro.vutbr.cz//buildstatus/pr-Parrot/rp-trunk/ ) 00:19
bluescreen pastebin.com/m44af8949
by the way I'm using parrot 1.7 00:21
Coke bluescreen: I would recommend not using "Object", as that probably conflicts with src/pmc/object.pmc 00:22
moment.
darbelo That paste gives me a syntax error, also.
bluescreen I've replaced with another name and same problem
used Objecta 00:23
no mather what name I use, it gives me same error
nopaste "coke" at 72.228.52.192 pasted "try this." (12 lines) at nopaste.snit.ch/18780 00:24
Coke bluescreen: that's for you.
bluescreen but i want to define class methods, not instance methods 00:26
Coke I don't think parrot distinguishes.
moment.
bluescreen like static in Java
pmichaud Coke: here for a bit 00:27
Coke I am fairly certain that you have to call it as an instance method. ISTR parrot supported it at one point, but I recall having to change partcl to avoid it.
(probably about 2 years ago)
chromatic Class methods are instance methods on an instance of a class.
There are no class methods.
Coke chromatic: which seems to me like a deficiency. But thankfully, tcl doesn't have objects so I don't care too much. 00:28
bluescreen so, are you planing to have those in the future?
Its too memory consuming having to instance an void object if you will, to call an static method. 00:29
Coke wait, on an instance of a class or an instance of a 'Class' ?
bluescreen so Class is the meta class?
I come from smalltalk world 00:30
pmichaud bluescreen: what do you see as being the difference between a class method and a normal subroutine?
00:30 mokurai joined
bluescreen you mean a global subroutine? 00:30
pmichaud or one within the class' namespace, perhaps 00:31
bluescreen constructor is a perfect example
lets say I want to have different constructors
pmichaud then you could simply have a subroutine named 'new' in the various namespaces for each class 00:32
(or however you'd like your constructor to be designated)
Coke (or abuse the init_pmc vtable which is invoked by the parrot opcode new.) 00:33
(but a vtable isn't a user visible method.)
pmichaud you can also define a method 'new' for the class, and then get to it by using classobject.'find_method'('new')
Coke pmichaud: (undefined identifier 'lexpad'
... from parrot;PCT;HLLCompiler;evalpmc) 00:34
darbelo bluescreen: I think you are mixing vm-features and hll-features.
bluescreen I think so darbelo
pmichaud Coke: have an example bit of code?
Coke bah. I think I have something stale, cleaning... 00:35
bluescreen I want to use as much as I can from the VM features
pmichaud bluescreen: for the code you pastebin'd, there are two ways to get to the 'hello' method
one is to have an instance of the class
the other is to look it up by asking the class object
e.g.
$P0 = get_class ['Object']
$P1 = $P0.'find_method'('hello') 00:36
$P0.$P1() # invoke $P1 with the class object as invocant
Coke pmichaud: yah, nevermind. it was a half-attempt at parsing {*} that i've since removed, nevermind.
pmichaud Coke: okay, good. I still need to wrap my head around {*} a bit. It's not entirely clear to me when substitutions occur or don't occur. 00:37
Coke pmichaud: well, we have it already in PGE/TGE variant, if that helps.
pmichaud I'd probably have trouble following the TGE version at this point.
it's been 2+ years since I've done anything with TGE... and I wasn't much of a fan of it then. 00:38
bluescreen that did it pmichaud
pmichaud bluescreen: yeah.... Parrot doesn't really have "class methods" in the java sense, but we haven't really needed them much for our target languages either. 00:39
bluescreen are you implementing P6?
pmichaud yes.
bluescreen is larry W ever around here?
Coke seen TimToady?
purl TimToady was last seen on #parrot 1 days, 4 hours, 39 minutes and 28 seconds ago, saying: phone [Nov 18 19:59:29 2009]
pmichaud he tends to hang out on freenode/#perl6
but he's also here from time to time
bluescreen I've watched his video of Google tech talk, I don't think anybody got the parts where he showed the lexer 00:41
pmichaud oh, I understood it. :) 00:42
of course, I have a unique position in that respect. :)
time for me to feed kids -- bbl
bluescreen lol.. you should :D
kid51 I'm going to have to revert r42585 00:43
Coke why?
kid51 I rearranged the order in which its subs were declared to match other config steps ... 00:44
That shouldn't have made a difference, but boy did it.
So I have to investigate why.
Coke oh, as long as you're here;
darbelo kid51: It works here FWIW.
Coke I'm going to create config/make and use it to hold partial (generated and potentially static) makefile portions. 00:45
dalek rrot: r42587 | jkeenan++ | trunk/config/gen/parrot_include.pm:
Revert r42585. Changing order of subs within module broke something.
kid51 darbelo: It broke perl Configure.pl --test all over the place 00:46
Coke pmichaud: btw, mdiep is interested but is (like me) having trouble understanding NQP.
kid51 Coke: What do you mean? config/make
Coke "mkdir config/make" 00:47
cotto_work Coke++
Apply more pressure.
Coke (see my parrot-dev mail of a few days ago about splitting up the big makefile into includable chunks. that's the dir where I plan to put the chunks) 00:48
darbelo kid51: Agh, sorry. I was building from a stale checkout.
kid51 Coke: okay, off top of head I don't see that that would pose any problems to what I do
Coke kid51: excellent.
kid51 Coke: So that would imply a lot of changes in config/gen/makefiles/root.in -- correct? 00:49
Coke kid51: mostly a carving up into smaller pieces, yes. 00:50
e.g the bit that generates the makefile deps for PMCs will probably just dump it to a separate .mak that is then included in the main make. 00:51
if I touch another config step, I'll try to remember to run config -test
s/another/
dalek rrot: r42588 | jkeenan++ | trunk (2 files):
Do a little refactoring in Linux hints file and add a steps test file for that.
00:52
kid51 looks at t/steps/gen/makefiles-01.t ... and is surprised to see that allison and chromatic have added substantial amounts of code to this test since he first wrote it! 00:54
00:56 abqar joined
chromatic kid51, your rearranging problem is because of the barewords parse_file and perform_directive in runstep(). 00:58
kid51 Thanks, c, I'll take a look at it after dinner. 01:00
01:20 cognominal_ joined 01:21 davidfetter joined 01:47 theory joined 01:51 davidfetter joined
pmichaud Coke: (mdiep) I'm happy to answer questions :) 02:07
if you're having trouble even figuring out what to ask, I can start from there also :) 02:15
Tene pmichaud: Ooo! Pick me! I don't know any questions to ask right now! 02:19
dalek rrot: r42589 | jkeenan++ | trunk/config/inter/progs.pm:
Change RT # to TT # in two locations.
02:21
purl dalek: that doesn't look right
dalek rrot: r42590 | chromatic++ | trunk/src/library.c:
[library] Removed build directory from PBC/PIR search paths in installable
TT #1279 closed by chromatic++: Parrot prefers libraries in build tree to installed tree or current ... 02:23
chromatic pmichaud, I get an error message using this Callgrind invocation: 02:25
cg ./parrot ext/nqp-rx/nqp-rx.pbc --target=pir ext/nqp-rx/src/stage0/NQP-s0.pir 02:26
Obsolete pod format, please use =begin/=end instead at line 3, near "head1 NAME"
current instr.: 'parrot;HLL;Grammar;panic' pc 578 (src/stage0/HLL-s0.pir:360)....
Should I benchmark something else? 02:27
pmichaud ...that would be trying to compile a .pir file using nqp 02:28
oh, yes
the files to test against aren't (yet) in the parrot repo
just a second
github.com/perl6/nqp-rx/blob/master...Actions.pm 02:29
github.com/perl6/nqp-rx/blob/master...Grammar.pm
the first one would be the most "interesting"
you can also do benchmarks against any of the files in ext/nqp-rx/t/nqp/*.t, although they're quite a bit smaller
Actions.pm is probably the most representative at this time
chromatic I'll try Actions.pm. 02:30
2.5 minutes so far. It's definitely going to give some data. 02:33
dalek rrot: r42591 | jkeenan++ | trunk/config/gen/parrot_include.pm:
Correct two cases where subroutine calls could be interpreted incorrectly (chromatic++). Put subs in order more consistent with other config step classes.
02:34
rrot: r42592 | jkeenan++ | trunk (4 files):
Eliminate an unnecessary internal sub in inter::progs. Touch up its verbose output. Adjust steps tests accordingly.
02:37
pmichaud by way of comparison, compiling that file in the standard runcore on my system is 16.020s (wall clock)
chromatic 88.81% of the execution time is *marking* Capture. 02:38
... and whatever it calls.
pmichaud well, a lot of Capture objects get created, yes.
basically every node in the parse tree and in the ast is a Capture object of some sort 02:39
chromatic 4,686,462 PMCs created in this run.
Sorry, that's off. 02:40
4,844,027.
pmichaud so, let me see if I understand what you said above. 88.81% of the total execution time is spent doing GC mark ?
chromatic 832,068 Subs invoked.
dalek rrot: r42593 | jkeenan++ | trunk/t/configure/033-step.t:
Eliminate reference to long-resolved RT ticket.
02:41
chromatic That's what KCachegrind says. There's a cycle here that's changing things, but GC pressure is by far the biggest expense.
pmichaud that's.... interesting. Especially since the new regex engine should be creating a lot fewer Capture PMCs than the old one did. 02:42
chromatic 23,994 Capture PMCs created.
pmichaud that seems right-ish. 02:43
the number doesn't surprise me, at any rate.
chromatic 892,659 Contexts
865,945 CallSigs 02:44
855,060 RetConts
826,628 CallSigRets
dalek rrot: r42594 | jkeenan++ | trunk/t/steps/inter (4 files):
Change RT references to TT references.
purl dalek: that doesn't look right
chromatic 75% of the PMCs created manage PCC. 02:46
02:46 JimmyZ joined
chromatic bacek_at_work, we're getting to the point we need to merge the "merge Context and CallSig" branch. 02:47
pmichaud Ouchie. But most of those are relatively short-lived, I'd guess?
as opposed to the Capture PMCs, which are relatively long-lived
chromatic 27,086 marks of Context PMCs. 02:48
3,619 marks of CallSig PMCs.
500,690 marks of Capture PMCs.
pmichaud right 02:49
so Capture PMCs are a small number of PMCs created but reponsible for a lot of marking
(relatively speaking)
chromatic It's not so much that they're responsible for a lot of marking, but that they live a lot longer than most other things.
Maybe the best way to say that is that they root near the rootiest root in the system. 02:50
92 GC runs.
pmichaud well, since the whole point of nqp.pbc is to build a parse tree and ast.... yes, they tend to stick around until the program is done :)
chromatic 18.64% of execution time spent in the GC.
dalek rrot: r42595 | jkeenan++ | trunk/config (4 files):
Change RT # to TT # where the RT was still open; otherwise, eliminate reference to closed RT ticket.
02:51
purl dalek: that doesn't look right
pmichaud anyway, that profile is likely to be very representative for all of the nqp/pge/past/pct-based compilers, including (especially) rakudo 02:52
chromatic 11.22% of execution time in Hash's get_pmc_keyed_str(), with 8,018,416 calls.
I can get some speed back there. 02:56
pmichaud in get_pmc_keyed_str ?
chromatic Yes. 02:57
pmichaud that would be a good place for some optimizing. method calls go through that, I think.
and there are definitely a ton of method calls here.
src/pmc/object.pmc:336 : /* Walk and search. One day, we'll use the cache first. */ 02:59
interesting comment :)
is there a way to find out how many invocations of find_method occurred? 03:00
in particular, Object.find_method ? 03:01
chromatic The VTABLE entry?
purl i think the vtable entry is get_iter iirc
pmichaud yes
chromatic 797,861 03:02
9.16% of execution time.
pmichaud that would seem like a huge potential for optimization
currently every method call is walking the mro list
chromatic It shouldn't be. At least, I thought I fixed that at one point. 03:03
pmichaud perhaps something else does the caching, then.
but clearly of the ~900K subroutine calls made, about ~800K of them were method calls
chromatic 4% of execution time is in Parrot_oo_find_vtable_override_for_class.
We need to *fix* that.
pmichaud oh, it's an even greater percentage than that, I guess 03:04
02:40 <chromatic> 832,068 Subs invoked.
03:02 <chromatic> 797,861
(last is find_method vtable invocations)
looks like about 95% of our sub calls were method invocations
(which is consistent with the way nqp and the tools work) 03:05
chromatic I might be able to get you a 3% improvement here in a moment.
03:06 cognominal_ joined
chromatic Not huge, but starting to be measurable, for a small investment of time and profiling. 03:06
pmichaud where are method lookups being cached, per your recollection?
chromatic The default PMC's find_method calls Parrot_find_method_with_cache. 03:07
Object's find_method doesn't.
pmichaud oh.
then yes, we're not getting any caching here I don't think.
chromatic I don't know if Parrot_find_method_with_cache works, but it's worth considering.
pmichaud well, since those 797,861 invocations of find_method result in some greater number of calls to get_pmc_keyed_str, yes :) 03:08
chromatic 3.844% improvement here.
pmichaud I guess we still end up with a keyed lookup into a cache.... but right now if the method's we're invoking are inherited, then we're looking through multiple classes to get to them 03:10
*methods
chromatic Yes, and that's way too much overhead.
dalek rrot: r42596 | chromatic++ | trunk/src/pmc/hash.pmc:
[PMC] Added checks for the most likely key and value types in Hash's

function calls for hot paths will be significant. This speeds up NQP-rx's Actions.pm benchmark by 3.844%.
03:11
pmichaud yes, r42596 is a quick improvement 03:12
chromatic++
are hash_key_from_string and hash_value_to_pmc that expensive? 03:13
chromatic If you call them 800,000 times they are.
pmichaud that's... interesting
yes, but we're calling a lot of stuff 800,000 times :) 03:14
so relatively speaking, those two accounted for nearly 4% of execution?
chromatic Yes.
pmichaud wow.
I'm.... shocked.
chromatic That and get_pointer.
Whole program optimization is a lovely feature of C compilers.
Same as aggressive whole program inlining.
Sadly....
purl sadly is the only way to do it currently
bacek_at_work chromatic, check context_union branch. It's failing badly. Because "Context" allocated in build_sigobjects, registers for Context should be allocated in Sub.invoke, parameters fetching should check different depth of stack. "Returns" should build returns in different Context. And so on... 03:20
It's freaking big task...
chromatic Sounds like we need to extract and unify context creation. 03:22
Can we do that reliably at the point of call?
03:22 mokurai joined
bacek_at_work chromatic, nope. At least I couldn't find easy way to do it. 03:24
chromatic What do we need next then? 03:25
bacek_at_work I need few free days to figure out exact way to merging context and allocating registers. 03:26
Unfortunately I'll not have them anytime soon
chromatic Do you have any notes? 03:27
I think I have another 4%. 03:33
03:35 janus joined
chromatic Hm, nope. Unfortunate. 03:39
03:42 theory joined
bacek_at_work chromatic, you can think about merging CallSig with CallSigReturns. It doesn't squeeze into VTABLE interface. So just move guts of CSReturns into src/call/args.c and call this functions. 03:52
chromatic Sounds easy enough. 03:53
03:54 theory_ joined 04:06 theory_ joined, benabik joined 04:24 davidfetter joined
chromatic needs a volunteer to clean up src/hash.c 05:48
06:04 TiMBuS joined 06:06 davidfetter_ joined 06:10 davidfetter joined 06:15 JimmyZ_ joined 06:46 iblechbot joined 06:49 davidfetter joined 07:05 mokurai joined 07:06 uniejo joined 07:15 particle1 joined 07:40 mokurai joined 07:48 theory joined 07:56 barney joined 08:03 fperrad joined 08:15 fperrad_ joined 08:23 JimmyZ_ joined 08:27 mikehh joined 08:36 KatrinaTheLamia joined
dalek rrot: r42597 | chromatic++ | trunk/src/call/args.c:
[PCC] Replaced repeated VTABLE accessor calls with macro access in
08:43
rrot: r42598 | chromatic++ | trunk/src/pmc (2 files):
[oo] Added a naive method cache to Class PMC and used it from Object's

7%.
rrot: r42599 | chromatic++ | trunk/src/gc/api.c:
[GC] Removed an unnecessary memset() from get_free_buffer(), as the underlying
09:01 eternaleye joined 09:02 estrabd_ joined 09:22 abqar_ joined
mikehh All tests PASS (pre/post-config, smoke (#30060), fulltest) at r42599 - Ubuntu 9.10 amd64 (g++ with --optimize) 09:48
09:57 eternaleye joined 10:24 lucian joined 11:03 particle joined 11:04 cghene joined 11:12 theory joined 11:20 cognominal joined 11:57 cconstantine joined 12:10 kid51 joined 12:17 payload joined 12:24 mariano__ joined 12:53 mariano__ joined
nopaste "coke" at 72.228.52.192 pasted "for pmichaud: NQP -> PIR has unreachable rethrow." (5 lines) at nopaste.snit.ch/18786 13:16
13:18 whiteknight joined, iblechbot joined
Coke pmichaud: suggestion on where to put issues as I find them? issue tracker on github? 13:23
(there are a few, and hopefully we can drag in more people. =)
(putting them in a todo for now.) 13:28
pmichaud: the "undefined identifier 'lexpad'" is coming from "if". 13:37
13:48 ruoso joined
pmichaud issues in github are fine for now -- whatever will work best for you in the long run :) 13:53
13:53 zak_ joined
pmichaud what code generated the unreachable rethow? 13:53
*rethrow 13:54
Coke pmichaud: it's in src/gen 14:05
added a TODO. 14:06
e.g. src/gen/pmtcl-actions.pir:224 14:08
looks like that one might be the implicit return at the end of concat_atoms 14:09
14:22 patspam joined
pmichaud looks like the spurious rethrow is a fossil from an incomplete refactor 14:26
(bisecting to find out where/why) 14:27
yes, that's what it is. 14:29
Coke++
Coke I have not been able to find what variant of [if] is causing the 'lexpad' error yet. 14:34
pmichaud I'm guessing it may have something to do with expr 14:38
dalek rrot: r42600 | pmichaud++ | trunk/compilers/pct/src/PAST/Compiler.pir:
[past]: Remove unreachable rethrow instruction in routines (Coke++).
14:48
14:52 lucian joined 15:10 Psyche^ joined 15:12 PacoLinux joined 15:13 payload joined
nopaste "pmichaud" at 72.181.176.220 pasted "r42598 -- methodcache may need invalidating with add_method (for chromatic)" (39 lines) at nopaste.snit.ch/18788 15:16
pmichaud purl msg chromatic r42598 -- we probably need some way to clear method caches when new methods are added to classes (see nopaste.snit.ch/18788) 15:18
purl Message for chromatic stored.
15:18 cognominal joined 15:25 cognominal joined 15:30 bubaflub joined 15:34 Andy_ joined
dalek kudo: 6bf0179 | masak++ | src/setting/Any-list.pm:
[Any-list.pm] removed Int constraint on $num in .pick
15:44
a: 378a9d6 | fperrad++ | (49 files):
convert tests to PIR (from Perl)
15:56
purl I don't know how to convert tests to PIR (from Perl).
16:08 darbelo joined
darbelo ls 16:08
Ouch. Wrong window.
cotto_work good morning
darbelo good localtime()
clock? 16:09
purl darbelo: LAX: Fri 8:09am PST / CHI: Fri 10:09am CST / NYC: Fri 11:09am EST / LON: Fri 4:09pm GMT / BER: Fri 5:09pm CET / IND: Fri 9:39pm IST / TOK: Sat 1:09am JST / SYD: Sat 3:09am EST /
dalek rrot: r42601 | jkeenan++ | trunk/docs/configuration.pod:
Make explicit that new configuration steps should be proposed via Trac ticket.
16:10
TT #1189 closed by jkeenan++: t/steps/*/*.t: Replace reliance on init::defaults 16:14
bubaflub hey ya'll, i'm converting t/library/md5.t to PIR. any objections? 16:15
(more of a "anyone else working on this?") 16:16
darbelo bubaflub: Break first, apologize later ;) 16:17
bubaflub roger that
darbelo That's my MO, at least. 16:18
mikehh All tests PASS (pre/post-config, smoke (#30076), fulltest) at r42600 - Ubuntu 9.10 amd64 (gcc with --optimize) 16:23
dalek a: a7d205a | fperrad++ | t/ (39 files):
chmod +x t/*.t
16:29
a: 7574cbd | fperrad++ | t/pmc/ (16 files):
chmod +x t/pmc/*.t
a: b9ccf38 | fperrad++ | setup.pir:
build LUA_INIT from the config
a: e97ab92 | fperrad++ | plumage/lua.json:
add Plumage description
a: 256ef88 | fperrad++ | .gitignore:
update .gitignore
16:33 zak_ joined
dalek a: 26be3f8 | fperrad++ | lua/lib/luapackage.pir:
fix LUA_PBCPATH (for batteries)
16:46
mikehh All tests PASS (pre/post-config, smoke (#30077), fulltest) at r42601 - Ubuntu 9.10 amd64 (g++ no --optimize) 16:50
Coke is "num .= floor" in p6 "num = num.floor()" ?
16:52 payload joined
Tene Yes. 16:53
bubaflub is there any array syntax so i can set multiple items at once 16:56
cotto_work bubaflub, not in pir 16:57
bubaflub bummer.
this test is going to be ugly
fun, but ugly
haha
Coke you can use json. 16:58
or split. 16:59
$P0 = split 'a b c d e' is a quicky.
(you can even do it inside a .const sub so it happens at compile time.)
bubaflub ah, very nice Coke++
Coke pokes.
github.com/partcl/partcl/blob/maste...ing.pir#L4 17:00
(prolly overkill for a test, but good for something you'd otherwise have to split multiple times at runtime.) 17:01
bubaflub true
cotto_work bubaflub, note that you'll always get a ResizableStringArray with split. 17:03
bubaflub ok 17:04
nopaste "coke" at 72.228.52.192 pasted "for pmichaud stacktrace question..." (18 lines) at nopaste.snit.ch/18789
cotto_work (probably not an issue, but good to know)
Coke cotto_work: s/RSA/RSA or the HLL equivalent/
(which you can abuse to force it to return any other core type you like.)
PerlJam Coke: how well-versed are you in how partcl-nqp works? 17:05
Coke PerlJam: who the what now?
PerlJam What connects the subs in Commands.pm to the stuff in Actions.pm?
maybe there's some PASTism that I'm missing.
Coke PerlJam: I know where the PIR entry point is. I know there is HLLCompiler glue holding it together. I know where to poke the grammar, the actions, and the runtime.
ah. moment. 17:06
... yah, i have no idea. 17:09
You'd think that method command() would be it (in Actions.pm)
oh. it is. 17:10
It's pulling the name of the command, creating an op invocation, and then parsing the ast that's left into the args.
so that turns "set a 3" into "set"("a","3")
make sense to you? 17:11
PerlJam Sure.
Coke whee!
now can I get you to supply a patch? =-)
PerlJam But by making the Op :name('set') (in your example, that's what happens), does that mean "call the sub named "set" ? 17:12
And why are all of the subs "our"?
oh, that might be becaue of tcl scoping I guess 17:13
Coke: what do you need patched?
pmichaud there's nothing that connects Commands.pm to Actions.pm 17:15
but yes, PAST::Op.new( :name('set') ) creates a node that will call the subroutine named 'set' 17:16
bbi10
Coke PerlJam: just updated the TODO. (could use more basic versions of those tcl builtins) 17:18
"incr" is probably an easy one.
er, /just/ updated.
(no changes to grammar required as yet for builtins, just add something to Commands.pm)
(happy to give you commit bits.)
Coke wonders how to match a regular expression in NQP. 17:20
where in rakudo-ng is the grammar? 17:28
dalek rrot: r42602 | mikehh++ | trunk/t/pmc/eval.t:
remove TODO for passing test - TT #1142
17:29
Coke found it.
17:30 allison joined
pmichaud Coke: src/Perl6/Grammar.pg 17:32
er, .pm
PerlJam looks at partcl-nqp's TODO
pmichaud github.com/rakudo/rakudo/blob/ng/sr...Grammar.pm
NQP doesn't have full regex support yet -- I should probably add that soonish.
Coke token infix:sym<==> { <sym> <O('%compare_numeric, :pirop<eq>')> } 17:33
pmichaud adding eq and == should be pretty straightforward
Coke eq_p_p dies; how can I coerce my args?
pmichaud you don't want :pirop<eq>
you want iseq
or cmp_num 17:34
Coke The opcode 'iseq_p_p' (iseq<2>) was not found. Check the type and number of the arguments
pmichaud the better grammar to follow is NQP's
Coke pmichaud: as opposed to nqp rx's?
pmichaud no, nqp-rx's 17:35
github.com/perl6/nqp-rx/blob/master...Grammar.pm
Coke pmichaud: all i did was copy what was already in partcl-nqp's grammar.
pmichaud token infix:sym«==» { <sym> <O('%relational, :pirop<iseq INn>')> }
the "INn" part is what coerces the arguments
Coke does the %foo matter?
pmichaud the %foo is pulling in the precedence 17:36
here, let's back up
PerlJam Coke: gimme a commit bit then (perlpilot on github)
Coke right, but do the names matter?
pmichaud you can name them whatever you want
Coke or can I pick whatever I want for them?
pmichaud so
(but they have to look like Perl hashes)
NQP::Grammar.O(':prec<t=>, :assoc<left>', '%additive');
defines %additive as having prec => 't=' and assoc => 'left'
Coke PerlJam: done. 17:37
pmichaud then later
token infix:sym<+> { <sym> <O('%additive, :pirop<add>')> }
says that an infix + token should have the attributes defined by %additive, as well as pirop => 'add'
the string '%additive, :pirop<add>' becomes the same as writing ':prec<t=>, :assoc<left>, :pirop<add>' 17:38
Coke do the capitalizations on INn matter?
pmichaud yes
I = int register
N = num register
n = num register or numeric constant
i = int register or integer constant
S = string register
s = string register or string constant 17:39
P = pmc register
Coke I get the idea. =-)
pmichaud there is also
* = anything
~ = string register, string constant, or PMC
+ = anything numeric
v = void
diakopter learns 17:40
pmichaud so, iseq INn forces the opcode to look something like $Ixx = iseq $Nxx, ##
PerlJam builds a better parrot
pmichaud where ## will be a numeric constant if the argument is already numeric, otherwise it's cast into a $Nyy register
I'm thinking of modifying the :pirop syntax to be iseq__INn (using double underscore instead of space), so that it more closely matches the pir::iseq__INn syntax in NQP 17:41
(the old space separate form will continue to work through 2.0, of course :)
time for lunch here -- bbiah 17:42
(wife is treating me to lunch :)
btw, is there somewhere that has a better description of what {*} does exactly? 17:46
it seems to me that it's just a form of :flat
PerlJam Coke: okay, teach me a little tcl syntax: How do I set a variable and then output its value? I tried "set x 3 ;puts [expr x]"
pmichaud PerlJam: set x 3; puts $x 17:47
$x is the rvalue form
(waiting on wife to be ready to go)
Coke also, [set x] 17:48
(though that fails atm.)
PerlJam How do I make an array? 17:49
(llength looks easy enough too if only I knew more tcl :) 17:50
Coke llength == list, not array.
PerlJam sorry, list then
Coke array in tcl means associative array.
well, in a real tcl, you could do [list a b c]
but if you stringify that, you get "a b c"... which conveniently listifies if you try to call llength or something listy on it. 17:51
(so just use space separated strings for now.)
PerlJam so, "set x [list a b c]" ?
Coke yes.
pmichaud is that substantially different from set x {a b c} , ooc? 17:52
Coke pmichaud: in one, you end up with a list object internally. in the other, you end up with a string.
but if you treat the string like a list, it morphs to one.
pmichaud and same for treating list like a string?
Coke yes.
pmichaud okay, that's what I thought. I didn't write the custom list or string types needed to do that.
PerlJam wonders if pmichaud is making the other pmichaud wait or if it's the other way around.
Coke pmichaud: I obviously already have most of that in PIR. 17:53
pmichaud Coke: right -- thus I figured I didn't need to worry about it :)
PerlJam Is it just me or is github being a little slow? 17:57
lucian PerlJam: i think it's just you
bubaflub github website or github push/pull? 17:58
PerlJam push/pull
purl well, push/pull is a pain because you can't change default push to not match pull
pmichaud Coke: uplevel is uplevel 3 {code} which runs code in a context three levels up? 17:59
Coke yes, where 3 could also be of the style #N where it's then N levels down from the topmost context. 18:01
so, uplevel #0 {code} runs code in the global context.
pmichaud oh. I think that's pretty easy to implement in the nqp version
does that mean that eval {code} is essentially the same as uplevel 0 {code} ?
yay, we finally can go to lunch now 18:02
bbiaw
nopaste "coke" at 72.228.52.192 pasted "3 examples for pmichaud" (13 lines) at nopaste.snit.ch/18791 18:03
Coke (I think eval does a little more processing on the input)
enjoy l unch.
I hope to hear "easy in nqp" very often, btw. =-) 18:04
PerlJam++ #that was quick. 18:05
PerlJam I'll happily implement LHF if you point me at it :) 18:07
(though I'm still not sure how to think about lists in tcl) 18:08
Coke LHF?
purl somebody said LHF was Low Hanging Fruit
Coke ah.
PerlJam: lists are kind of like scalars in tcl. 18:09
18:09 chromatic joined
Coke They're one of the types that stringifies and back. (as opposed to arrays, which are the only real "container" type.) 18:09
dalek rrot: r42603 | fperrad++ | trunk/runtime/parrot/library/distutils.pir:
[distutils] add a target 'win32-inno-installer'
Coke PerlJam: feel free to strike incr from the todo list. 18:10
er, the TODO list.
PerlJam oh, yeah, I forgot about that
Coke puts stderr/stdout (with just literals for those channel ids) would probably be pretty easy.
www.tcl.tk/man/tcl8.5/TclCmd/puts.htm 18:11
dalek TT #1142 closed by mikehh++: test 12 of t/pmc/eval.t fails in testr (passes in other runcores) 18:17
18:20 eiro joined
dalek TT #1310 created by bubaflub++: [PATCH] convert t/library/md5.t to PIR 18:20
PerlJam how do you even write to stderr in parrot? Is there a say-equivalent for stderr (that doesn't die :) 18:22
Tene PerlJam: I think there's a way to get the stderr object, and then you write to it. 18:23
cotto_work PerlJam, use the getstderr op and pass that as the first argument to say 18:24
18:24 jan joined
cotto_work wait, scratch that 18:24
you have to use print 18:25
mikehh bubaflub: I like that patch - will test it in a bit and apply it if it is ok 18:30
bubaflub mikehh: okey dokey.
PerlJam Coke: what are your plans for partcl's test suite? 18:34
Coke: (I feel a little weird adding some functionality with no tests)
Coke PerlJam: I was trying to get it to the point where I could just run partcl's test suite.
(and fail most of it miserably.)
perhaps a "sanity" test file for "things we need to get to get test_more working." 18:35
PerlJam Coke: well, checkout what I just pushed and tell me if I did anything very wrong :)
Coke (just a single .t for now)
I am almost willing to admit that NQP looks nicer than .hllmacros. =-) 18:36
PerlJam++ #nice. 18:37
PerlJam almost?
Coke PerlJam: (you can remove puts from the todo. =-) 18:38
PerlJam ack! I forget again.
Coke I don't know how I'd write an NQP based .t 18:39
(that runs tcl)
I wonder how return would work. it throws a control exception (of type return), but wouldn't that interfer with the NQP that the command is now written in? 18:40
(test) guess I could just do it the hard way. 18:41
18:42 joeri joined
chromatic Do I remember that someone wrote a test for using the wrong type of register with :opt_flag? 18:44
mikehh All tests PASS (pre/post-config, smoke (#30080), fulltest) at r42603 - Ubuntu 9.10 amd64 (g++ with --optimize)
cotto_work chromatic, I recall seeing something like that fly by. 18:45
Coke chromatic: me, yes. 18:46
regressions.t 18:47
chromatic Lovely, thanks
bubaflub hey ya'll, after running `make realclean` `git status` shows some files that are still untracked 18:49
shouldn't realclean nuke everything that isn't tracked?
cotto_work bubaflub, parrot's vcs is svn
;)
bubaflub yeah, i'm using git svn
cotto_work ah
bubaflub it looks like some stuff in runtime/parrot/library/*.pbc 18:50
HLL.pbc, P6Regex.pbc, Regex.pbc, and nqp-rx.pbc in there
and then parrot-npq stuff as well
18:50 payload joined
Coke PerlJam: there, sanity test. 18:52
bubaflub: yes. 18:53
bubaflub should some of those files be added to the makefile? 18:55
18:57 darbelo joined
pmichaud back from lunch 19:04
dalek rrot: r42604 | chromatic++ | trunk (4 files):
[IMCC] Made IMCC throw a syntax error when using :opt_flag on a register that's

Weeks). This passes and unTODOs the three tests added in r42569.
19:06
pmichaud Coke: yes, throwing return from a NQP "return" sub would likely get caught.
pmichaud maybe the answer is to have "return" written as a bare block instead of a routine
Coke well, we do have to dispatch to it. not sure how bare block would handle that. 19:07
pmichaud I'm thinking GLOBAL::return := { ... };
or, since you'll want args
GLOBAL::return := -> *@args { ... };
Coke just slap that into Commands.pm ? 19:08
pmichaud probably needs to be in an INIT block in order to run
and we need the code in the ... to create and throw the return exception
although... 19:09
'return' already does that
hmmm
dalek nxed: r183 | julian.notfound++ | trunk/examples/parser.winxed:
parser example: temporary registers are now temporary
pmichaud simple form of return only takes a single argument?
so I'd guess
INIT { GLOBAL::return := -> $result = '' { return $result; }
} 19:10
then we need to get proc-defined blocks to catch return exceptions
which, iirc, is just $block.control('return_pir'); 19:11
Coke pmichaud: looks like it works without changing proc.
19:11 particle joined
Coke is proc already of a type that understands what a return exception means? 19:11
pmichaud no
it's just a Block, iirc 19:12
normally it wants to have a .control()
Coke (works) tclsh8.5 != pmtcl. :)
Could not find non-existent sub return
pmichaud hmmm. 19:13
dukeleto 'ello 19:14
pmichaud oh, fwiw, I was generally keeping the commands in Commands.pm in alphabetical order (noticing 'incr' at the bottom)
puts was the exception, because we needed it before being able to do anything else :)
omg, we have -nonewline?! 19:15
cooooool
19:15 KatrinaTheLamia joined
Coke PerlJam++ was busy. 19:16
pmichaud Could not find non-existent sub return 19:19
....weird.
I can see in the trace where it's indeed being set.
Coke is that tcl or nqp complaining, I wonder? =-)
pmichaud It's parrot.
pmichaud@orange:~/partcl-nqp$ ./pmtcl 12248 set P0, PC810 P0=PMCNULL PC810=Sub=PMC(0x8320d60 pc:12262) 12251 capture_lex P0 P0=Sub=PMC(0x8320d60 pc:12262) 12253 set_hll_global PC799, "return", P0\tPC799=Key=PMC(0x834336c) P0=Sub=PMC(0x8320d60 pc:12262) 12257 trace 0
ugh
irssi paste fail
Coke right, but it is complaining about tcl's return sub that we efined with INIT... or is it complaining about that sub's use of nqp's return? 19:20
pmichaud (nopasting)
nqp's return doesn't result in a subroutine call
so, it's the former.
Coke ok. INIT (GLOBAL::) is very magical to me, so I don't know where to start, there. 19:21
(how does that differ from "our sub") ?
pmichaud INIT { ... } simply defines things to be run when the code is loaded
GLOBAL:: refers to the global hll namespace
the difference is that "our sub" places a return handler in the block 19:22
bubaflub i'm having trouble converting a regex to something usable in PIR ... where is the doc for the syntax for new style regexes? 19:25
chromatic Hm, I can parse 127.1 lines of Actions.pm per second.
pmichaud chromatic: is that after your changes of last night? I was going from the timings as of yesterday. 19:26
chromatic Yes, this is after my changes.
Coke bubaflub: the p6 regexes are described in synopsis 5. 19:27
bubaflub coke, thanks
pmichaud (i.e., when it took 16sec for me to compile a 685 line Actions.pm .
Coke perlcabal.org/syn/S05.html
chromatic It takes me 5.4.
pmichaud I'll try it again.
chromatic Are you using an optimized build?
pmichaud oh, probably not. 19:28
Coke insert rant about not being able to build optimized on os x. :|
pmichaud I can try with optimize.
chromatic Here's a nickel, kid. Go buy yourself a Unix written sometime this millennium.
pmichaud "And bring back my nickel when you're done."
Coke: aha. Looks like the nqp-rx in parrot is a bit out of date. 19:29
it's not the version that understands GLOBAL::
Coke waits for the inevitable update! 19:30
pmichaud double-checking that it indeed works in nqp-rx master, first.
it doesn't. 19:31
bug bug bug
ohhhhhhh
no.
hrm.
ohhhhhh
fixing.
Coke "aaaaaah ooooooh whatcha gonna dooooo?" 19:32
PerlJam "bad bugs, bad bugs, ... " ? 19:33
Coke was referring to the fu schnickens, but points for pop culture reference. 19:35
bubaflub arg, these new fangled perl 6 regex are killing me softly 19:39
dukeleto bubaflub: why so?
bubaflub dukeleto: i'm so use to "regular" regular expressions, i.e. Perl 5 style
pmichaud ugh, I need to run to store for a bit. Will fix GLOBAL:: when I get back 19:40
bubaflub and all their convoluted nonsense
pmichaud in meantime, can do
bubaflub that the simpler stuff is actually taking some getting use to
PerlJam bubaflub: once you do get used to it, you'll never want to go back.
pmichaud INIT { pir::set_hll_global__sP('return', -> $result = '' { return $result; } ); } # I think
bubaflub PerlJam: last time i heard that, it was about switching to git from svn and they were totally right 19:41
PerlJam heh.
PerlJam wonders if he was the one who said that about svn->git too
(I would have said something like that anyway)
bubaflub PerlJam: well, i had to start learning last year for work 19:42
long before i was hacking parrot
but no doubt it is the case
that you also said that
chromatic Hah, STRINGNULL is a performance improvement. 19:47
Coke chromatic: vindicated much? 19:49
chromatic I like when correctness AND performance improve together. 19:51
Oh yes, and the resulting code is *shorter*.
Coke pmichaud: I cannot make that work; complains that set_hll_global is getting /3/ args instead of 2. 19:52
dropping the __sP, it then complains that the types are wrong.
chromatic: how much of a performance improvement? 19:53
dalek TT #1311 created by bubaflub++: [PATCH] convert t/library/uuid.t to PIR 19:54
Coke ponders running another spectest run on partcl0
Tene chromatic++
dalek rrot: r42605 | chromatic++ | trunk/src/pmc/string.pmc:
[PMC] Used STRINGNULL in String PMC's init() instead of a new empty STRING,
19:55
mikehh bubaflub: commited your patch at r42606 20:02
dalek rrot: r42606 | mikehh++ | trunk/t/library/md5.t:
convert test to pir - patch from bubaflub++ (TT #1310)
purl I don't know how to convert test to pir - patch from bubaflub++ (TT #1310).
bubaflub cool
pmichaud Coke: working on return now 20:06
(updating nqp-rx first)
dalek nxed: r184 | julian.notfound++ | trunk/examples/parser.winxed:
labels and goto in example parser
20:08
dukeleto chromatic++ # stringy nulls! 20:10
Essobi Is it save to blackrain
woops.. wrong window. Heh
Coke next up? stringy squirrel.
dalek rrot: r42607 | fperrad++ | trunk/runtime/parrot/library/distutils.pir:
[distutils] add a target 'smoke'
20:12
dukeleto prefers meaty squirrels
Coke pmichaud: (return) thanks.
(as long as you're in there, basic versions of continue/error/break would also be similar. =-) 20:13
japhb dukeleto, somewhere around here I still have an old copy of the Joy of Cooking which has a whole section on preparing squirrels and other similar small mammals for ... well, one presumes "eating", but perhaps just to scare the neighbors.
Newer versions seem to skip that section .... 20:14
dukeleto japhb: nice. is that the backwoods edition?
Coke *thbbthp*
japhb Older JoC's were ... folksier. 20:16
I remember back a decade or two buying the "now with (some) vaguely healthy food" edition.
dalek a: 05607fb | fperrad++ | setup.pir:
use target 'smoke'
20:17
p-rx: b387ccf | pmichaud++ | (2 files):
Allow bareword GLOBAL:: package identifier.
p-rx: 2443dcc | pmichaud++ | src/stage0/ (3 files):
Update bootstraps.
TT #1312 created by bubaflub++: [PATCH] convert t/library/protoobject.t to PIR 20:20
bubaflub i'm out for now, everyone have a great weekend
dalek nxed: r185 | julian.notfound++ | trunk/examples/parser.winxed:
minor fixes
20:22
20:23 cognominal joined
Coke wonders how S| in p6 is different from || 20:26
dalek rrot: r42608 | pmichaud++ | failed to fetch changeset:
[nqp]: Update to allow bare GLOBAL::symbol handling.
pmichaud pushed update for return 20:28
so, anywhere that I can find a better explanation of {*} in tcl ?
dalek a: 010a358 | fperrad++ | (5 files):
remove testclean,
20:29
Coke the "list of twelve" there doesn't help? checking the tclers wiki...
Coke (list of twelve is the "Dodekalogue", btw.) 20:30
pmichaud {*} is described there, but not clearly enough that it matches what I see from tclsh
I think I'm missing something. 20:31
Coke here's the original TIP (like an RFC):
www.tcl.tk/cgi-bin/tct/tip/157
(where * was spelled expand)
pmichaud: verified, that makes 'return' work. 20:32
dalek rrot: r42609 | chromatic++ | trunk/src/pmc/resizableintegerarray.pmc:
[PMC] Modified ResizableIntegerArray PMC to use accessor macros instead of

the NQP-rx Actions.pm benchmark.
rrot: r42610 | NotFound++ | trunk/src/ops/cmp.ops:
use STRING_IS_NULL in if_null and unless_null ops
Coke (I'd write a test, but sanity.t is dying. =-)
actually, I'll write a test anyone, one more thing to pass...
pmichaud so, it looks to me like {*} means "perform substitutions, split into words, pass as flattened arguments"
...except that it does do backslash and brace handling... or, something. 20:35
Coke backslash is part of perform substitutions. 20:37
(note that real tcl provides [subst] to do these substitutions at run time as well, as an aside.) 20:38
so, yes, as I understand it, {*}<WORD> will replace that with [subst <WORD>] - and then replace that one word in the AST with all the words that result after the subst. 20:39
so... yes, pretty much what you said.
so, I would make a {*}<WORD> a special kind of word that you can use in a command (at any point, even as the command itself), and then have the ast there do a pass of substitutions (can we just do something like eval there and have it return the ast?) and wedge the ast from that into the ast of the command. Yes? 20:44
chromatic Hm, get_bool is 5.66% of execution time. 20:50
Coke r42609 breaks encapsulation, yes? 20:52
(or no, because it's SELF?)
(is it all SELF?)
japhb chromatic, did you fix pmichaud's issue about needing to invalidate the method cache on add_method? I've gotten lost in the flow of commits ....
chromatic I haven't yet.
japhb k
Thought I just didn't notice it go by.
chromatic I have most of an algorithm in my head, but haven't had the brainpower to make it work.
Coke (would GET_ATTR_foo even work on another type?) 20:53
chromatic If it's a subclass.
Coke k. so i won't worry about it. =-) 20:54
pmichaud chromatic: my suggestion is have a global counter or marker somewhere that gets cleared whenever a new method is added (to any class) 20:58
protoregexes have to deal with something of the same issue-- they have to recalculate tables whenever a new regex is added 20:59
each cache keeps track of the marker that was in place when the cache was created; if the marker changes, then the cache invalidates itself and starts anew 21:00
more sophisticated mechanisms are possible, but this one is fairly simple and works okay when adding methods occurs infrequently (and in batches, such as with load_bytecode) 21:01
japhb dukeleto, ping 21:02
pmichaud Coke: surely the substitutions take place at runtime, not at compile time though? 21:03
I don't think {*} is like an eval.
Coke the trick is that compile time doesn't happen until that command. =-)
pmichaud I think it's like a "take the result of normal substitutions to the following word and interpolate them here"
so cmd {*}"a b c" is the same as cmd a b c 21:04
Coke as long as it happens before the command getting invoked sees it, we're fine.
pmichaud right, that's definitely the case
but with something like
{*}{abc [expr 3+5] def} 21:05
...what happens there?
Coke that invokes the command "abc" with the arglist "8 def", I believe.
pmichaud well, something like puts {*}{abc [expr 3+5] def} then
21:06 theory joined
pmichaud % puts {*}{abc[expr 3+5]def} 21:06
can not find channel named "abc[expr"
Coke puts("abc",8,"def") ?
moment.
pmichaud in this case, the "substitution" is a brace substitution, no further substitutions occur, so the result is puts("abc[expr", "3+5]def")
(which is an error, because the first argument isn't a channel) 21:07
but with
% puts {*}{abc\\ndef}
abc
def
the \\n substitution gets performed.
Coke yah, that's not what I was expecting, apologies. (verified with tclsh8.5) 21:08
checking the docs again... 21:09
pmichaud [5] says
"After substitution, the word is parsed again without substitutions, and its words are added to the command being substituted."
Coke right, but for me "substitutions" is all 3 kinds.
(so the docs are a little misleading there.)
pmichaud sure
Coke seeing if there's a spectest.
pmichaud substitutions is all three kinds, but that would be 21:10
hmmm, nm.
Coke basic.test has a lot of tests, one of which is: 21:11
catch {namespace delete {*}[namespace children :: test_ns_*]}
OH. 21:12
puts {*}{abc [expr 3+5] def} NEQ
puts {*}"abc [expr 3+5] def"
TimToady S| returns a junction, not the first true value
Coke TimToady: ah, thanks.
purl ah, thanks. is it fast enough?
Coke no, thanks is <reply>
pmichaud Coke: right, I understand the difference between the quoted version and the brace version
in the quoted version, the substitution takes place before the split 21:13
in the brace version, I would expect no substitutions to occur... but backslash substitutions do. 21:14
% proc xyz {} {return 8}
% puts {*}"abc[xyz]def"
abc8def
% puts {*}{abc[xyz]def}
abc[xyz]def
% puts {*}{abc\\ndef} 21:15
abc
def
it's just weird that backslash substitutions are included.
when other "substitutions" are not.
Coke Yup. I agree, that is wierd. (checking to see if partcl can deal with any of these properly...) 21:16
sorry I misunderstood the problem you were pointing at.
pmichaud the TIP mentioned Tcl_SplitList -- is there a command that corresponds to that?
Coke that's the raw C function in the Tcl API. 21:17
pmichaud right
Coke (which we're not using.) I'd have to skim tcl source to see what calls it.
pmichaud okay.
Coke partcl does handle those 3 cases properly. =-) 21:18
I think mdiep did the original version of that.
pmichaud While extracting the arguments, Tcl_SplitList obeys the usual rules for backslash substitutions and braces. 21:19
dcolish will following trunk on launchpad be essentailly the same as following svn TRUNK? 21:21
Coke note that if we can just get a {*} that only passes 2 of those 3 samples, that's might get us through test_more.tcl
(but doing it right the first time++, of course.)
pmichaud: pinging #tcl...
dcolish: I'm not sure if that's automatically synced. I am not sure launchpad is used for anything at this point, though. 21:23
(huh. seems to be nearly up to date with annoyncements, at least.) 21:24
dcolish looks like it gets imported every 2 hours, but yeah i was sort of asking if it get used or not
Coke it was allison's push to get us on there. I think she was the only one that actively used it. 21:25
pmichaud Coke: okay, I think I have it figured out now from tclsh. It's not the same as any of the existing substitutions -- it is its own beastie.
dukeleto dcolish: hola
dcolish dukeleto: hey !
dukeleto dcolish: i wanted to come to the pdxpug meeting last night, but IRL got in the way
Coke pmichaud: [::facepalm::]
chromatic Perl 5 has a similar marker. I think it's possible to walk MRO backwards and touch only the affected classes, but we'll see.
dukeleto who wants to be a @parrotvm social media ninja? 21:26
dcolish dukeleto: not a problem, i'll be doing a phase 2 talk at one point
pmichaud chromatic: ...but how to walk mro forwards?
dcolish you did miss cupcakes although
chromatic We do have a GC which knows how to walk classes.
pmichaud chromatic: i.e., if I add a method to a parent class, how does all of its subclasses learn of it?
okay, I could see how the gc could help a bit. 21:27
just seems... weird.
Coke pmichaud: this may be instructive:
lindex [list {*}{abc\\ndef}] 0
21:27 mikehh joined
chromatic Mostly I mean that all classes have a single root. 21:28
Coke this may be covered by partcl's list/string shimmering
(which would explain why it jfw for us.)
pmichaud Coke: this one surprised me a bit:
% puts {*}{abc\\n{def\\nghi}}
abc
{def
ghi}
chromatic Though walking all classes and filtering by presence in MRO may be more expensive than the naive "increment a generation number" approach.
allison Coke: I really only use launchpad for Ubuntu package testing (it is good for that) 21:29
particle dukeleto: www.king5.com/news/local/Police-Wou...91187.html 21:30
pmichaud afk, kid pickup
Coke pmichaud: I think the string -> list conversion there is what is surprising us. (and then it has to be converted back to a string for display) 21:31
dcolish is the docs.parrot.org/parrot/latest/html/...p.pod.html page still valid for nqp-rx? 21:33
Coke pmichaud: "parsed again /as a list/ without substitutions" is probably slightly more accurate. 21:34
there is an objection that this makes Tcl.n non-self-contained, but I argue that the code isn't, so neither should be the man page.
(opening a tcl tracker...) 21:35
21:36 payload joined
dalek TT #1310 closed by mikehh++: [PATCH] convert t/library/md5.t to PIR 21:37
pmichaud oh, I get it a bit 21:43
in the last case, the braces aren't normal braces. 21:44
but they still count for bracketing equality... which is kinda weird.
ah, I see why they count for bracketing equality. 21:46
very interesting :-)
okay, I think I've got it. 21:47
let's see if I can get a reasonable attempt for {*}
Coke +10
purl 10
pmichaud another errand, bbiab
Coke well, then only +8! 21:49
diakopter +16!
Coke pmichaud: sourceforge.net/tracker/?func=deta...tid=110894 (doc bug reported on {*}) 21:50
nopaste "NotFound" at 213.96.228.50 pasted "Fix for examples/benchmarks/primes.pasm" (26 lines) at nopaste.snit.ch/18797 21:56
NotFound Is this fix correct?
chromatic Seems reasonable to me. 22:00
dalek TT #1313 created by bubaflub++: [PATCH] convert t/library/parrotlib.t to PIR 22:04
rrot: r42611 | NotFound++ | trunk/examples/benchmarks/primes.pasm:
[examples] fix primes.pasm to show the same "last is" as the other versions
22:05
NotFound Forgot to add: PacoLinux++
mikehh All tests PASS (pre/post-config, smoke (#30083), fulltest) at r42610 - Ubuntu 9.10 amd64 (gcc with --optimize) 22:11
bubaflub: will check out your new patch after a bit of a break
dalek nxed: r186 | julian.notfound++ | trunk/winxed.cpp:
relax restrictions on ++ and -- operators
22:16
nxed: r187 | julian.notfound++ | trunk/winxed.cpp:
allow usage of <, <=, > amd >= with var
22:26
chromatic tries describing a small, short-term project on the wiki 22:27
dalek tracwiki: v1 | chromatic++ | ClassVtableOverrides 22:29
tracwiki: a plan and a plea for volunteers
tracwiki: trac.parrot.org/parrot/wiki/ClassV...ction=diff
tracwiki: v2 | chromatic++ | ClassVtableOverrides
tracwiki: formatting improvements
tracwiki: trac.parrot.org/parrot/wiki/ClassV...ction=diff
chromatic That should be an afternoon's worth of work for an Infinoid, a NotFound, a Tene, a Whiteknight, a cotto, or a bacek. 22:31
Tene What am I doing this weekend?
oh, it's a wiki! Hello, wiki! 22:32
NotFound chromatic: I've been thinking about that sveral times, but never materialized. 22:34
chromatic Object's get_bool() is 5% of the NQP-rx benchmark I've been using, all thanks to checking for vanishingly few VTABLE overrides. 22:35
NotFound Interesting. 22:38
pmichaud note that vtable overrides are quite common in Rakudo, though.
chromatic If the suggested approach works, we don't pay the penalty for checking for them. 22:39
pmichaud that's fine
just making sure that nqp-rx isn't taken as HLL representative in that respect
(because nqp-rx is explicitly designed to work with native Parrot PMCs and not custom types, unlike HLLs which will tend to do a lot more overriding)
NotFound Another improvement might be to avoid entering a runloop in opcodes that does only a vable call, but I fail to imagine a plan for that. 22:40
chromatic I've had the same idea, NotFound, but I don't have a good plan either. 22:41
22:43 lucian joined
Coke chromatic: +1 on that mini project. will save a bunch of (#&*$ annoying code. 22:53
23:10 ilbot2 joined
moderator Parrot 1.8.0 Zygodactyly released | Latest modified TT's: icanhaz.com/parrotbugs | Parrot Languages: icanhaz.com/parrotlang
nopaste "pmichaud" at 72.181.176.220 pasted "{*} expansion in pmtcl -- for Coke" (16 lines) at nopaste.snit.ch/18798 23:10
23:11 particle joined
Coke sweet! 23:11
did you roll your own list->string->list conversion?
pmichaud string->list conversion, yes.
It's handled by the 'list' rule in the grammar.
it parses a string into a list, performing brace and backslash handling in the process 23:12
github.com/partcl/partcl-nqp/blob/m...mar.pm#L60 23:13
dalek rrot-plumage: e03130c | japhb++ | :
Beginnings of speculative changeover to contextual globals; blocked on u...
rrot-plumage: 83bef3a | japhb++ | :
[CORE] Glue.pir: Use less painful way to set dynamic lexicals that may n...
rrot-plumage: 3968bb3 | japhb++ | :
More contextuals edits; CAN HAZ WURKNG NOW
23:13 baest_ joined, sri joined 23:14 mj41 joined
pmichaud btw, there's definitely a problem with 23:15
PmTcl::Grammar.O(':prec<13>', '%multiplicative');
PmTcl::Grammar.O(':prec<12>', '%additive');
PmTcl::Grammar.O(':prec<9>', '%compare_numeric');
PmTcl::Grammar.O(':prec<8>', '%compare_string');
precedence comparisons are string compares
so you probably want "09" and "08"
Coke k 23:16
23:17 particle joined
Coke fixed. 23:21
23:25 particle1 joined
dalek nxed: r188 | julian.notfound++ | trunk/winxed.cpp:
relax type restrictions o *, /, % and %% operators, unfinished
23:25
Coke pmichaud: any clues on the lexpad issue? 23:29
Coke <- needy.
23:33 payload joined
Coke I wonder if <script> needs the same lexpad init as <body> 23:35
23:40 payload joined
japhb Is there a PIR way to determine whether a code PMC is a sub or a method? 23:43
chromatic $S0 = typeof $P0 ? 23:45
japhb chromatic, should I expect 'Sub' and 'Method' back from that? 23:46
Somehow I expected it to be more contorted than that, given that the only difference is a flag on the .sub declaration ... 23:47
23:47 Hunger joined
chromatic Hm, good point. 23:48
pmichaud afaik, Parrot doesn't make a type distinction between subs and methods
japhb pmichaud, I'm having problems with setting object attributes from within inner blocks. Like within a for loop inside a method.
(in nqp-rx) 23:49
pmichaud have a short code example?
japhb Since the inner block is a separate pir sub, no 'self' exists.
pmichaud it's supposed to be lexical 'self' anyway
japhb give me a sec, and I'll try to get it minimal
23:50 mariano__ joined
japhb parrot-nqp -e 'class Foo; has $!foo; sub foo () { for 1,2,3 -> $a { $!foo := $a } };' 23:51
The opcode 'setattribute_ic_sc_p' (setattribute<3>) was not found. Check the type and number of the arguments
And with --target=pir, you can see why ... the for loop block isn't a method, and has no way of finding self, but that's what the generated setattribute code uses. 23:52
urg
Same error if I correctly use method instead of sub above, sorry. 23:53
23:56 kid51 joined
pmichaud ....doesn't need to find 'self' as a register, because 'self' is lexical. 23:58
it can't be a method. 23:59
just a sec, it's obviously a bug.
23:59 particle1 joined