Parrot 2.10.1 Released | parrot.org | Log: irclog.perlgeek.de/parrot/today | Onward and upward with Google Code-In | Please test rakudo with bleeding edge parrot!
Set by moderator on 11 December 2010.
dukeleto ~~ 00:02
00:10 lucian_ joined 00:13 lucian left
cotto dukeleto, are you can chromatic coordinating? 00:22
loritowise
dukeleto, did someone review the German README? 00:27
lucian_ when lorito design is more finalised, i'd like to find time to write one with PyPy 00:36
dukeleto cotto: i gave it a cursory view. I took a few years of German. The student is Swiss, who seems to be fluent in (at least) English and German. 00:55
cotto: chromatic is seemingly committing without seeing that i have a branch
cotto: i would love to coordinate with him 00:56
kapace_ If i call a function that sets a register with a variable, can I use that variable in the register after it returns? 00:57
nwellnhof the german README is really ugly.
i think the translation tasks for GCI are a bad idea. 00:58
Matt221 In PLA when you set a keyed value like so: $P0[0;0] = "SOME STRING", how does Parrot know to call set_string_keyed ? 01:00
cotto dukeleto, ok. I'd prefer to have moritz or another German speaker look over it, but it's probably fine. 01:01
NotFound nwellnhof: Hurrah, I'm not alone!
kapace_ Matt221: Magic. 01:02
NotFound Matt221: because "SOME STRING" is a string. 01:03
Matt221: the pir compiler generates different opcodes according the type of the register or value used. 01:04
dalek rrot/lorito: 597049c | dukeleto++ | src/pmc/loritocontext.pmc:
Give LoritoContext PMC some useful attributes
dukeleto nwellnhof: would you mind improving our German readme a bit? 01:05
Coke Matt221: the intermediate step is that it's compiling down to an opcode like set $Px, $Px, $S0 , and that opcode is using the vtable 01:06
NotFound is tempted to say that rm is a great improving tool
Matt221 Ok thanks guys! Do you know if I can break on VTABLE ... method to see what exactly is going on?
nwellnhof dukeleto: it needs a complete rewrite. 01:07
cotto Matt221, sure. They get mangled into functions named Parrot_NameOfType_vtable_name()
NotFound Matt221: creating classes with subs with the :vtable modifier is the easier way to look at what parrot is doing. 01:08
cotto We haven't been having the best of luck with README translations.
01:08 Coke left 01:09 Coke joined
nwellnhof cotto: i think translations are not a good task for GCI students. i guess they're more into technical stuff than (spoken) languages. 01:10
NotFound .sub set_string_keyed :vtable | .param pmc key | .param string value
And so on
cotto dukeleto, what do you think about not having N registers in Lorito, at least for now.
plobsing Matt221: breaking on vtables is doable, but the pmc compiler messes up line numbers, if you want to step them, you'll have to reconfigure with --no-line-directives. 01:11
NotFound And don't forget good old fprintf stderr debugging. 01:12
01:20 AzureSto_ left 01:21 AzureStone joined 01:25 kapace_ left 01:26 bacek left 01:27 allison left, allison joined 01:28 bacek joined
Matt221 I am pretty sure this should work yet the test fails. Any ideas? cl.ly/3t3B3T1w1G0m3r210j2X 01:28
(I harded coded a value - 15 for testing to isolate the bug) 01:29
01:30 kapace_ joined
NotFound Matt221: what value does it get? 01:31
I guess "15" 01:32
Matt221 yup 01:33
and the assert still fails 01:34
I noticed complexmatric and pmcmatrix have similar implementations that work
NotFound I suppose the assert_equal function is doing a string equal, not a numeric one.
"15" != "15.0" 01:35
Matt221 Thanks! So obvious 01:36
01:39 rfw left, rfw joined 01:45 fbrito joined
fbrito cotto: ping 01:47
cotto fbrito, pong
fbrito cotto: you are the mentor of this task, right? www.google-melange.com/gci/task/sho...9186823954 01:48
atrodo may end up regretting making lorito a attn word
cotto atrodo, it'll get more prominent.
plobsing attn word? 01:49
atrodo when lorito is seen in chat, chatzilla will flash and try to get my attention 01:50
plobsing argh. I'd hate that.
cotto fbrito, claim accepted 01:51
somehow melange let me accept both your claims
I hope that's intentional
fbrito hm, both my claims? 01:53
atrodo cotto> (about $N) I would say if anything, logically, dropping $I would make more sense 01:54
I wouldn't advocate doing it, but
cotto fbrito, actually it may have been yuki's 01:55
fbrito cotto: ahh, now I see. Yes, he claimed the other task 01:56
01:58 lucian_ left 02:01 cottoo joined, cotto left
cottoo atrodo, why? 02:02
02:02 cottoo is now known as cotto
kapace_ btw, can anyone accept? www.google-melange.com/gci/task/sho...9131467680 02:02
cotto goes afk for a while
NotFound kapace_: there is an updated version of the example in the winxed svn repo 02:04
Not much difference, anyway. 02:05
dalek rrot/embed_api2: 4b624c6 | Coke++ | / (4 files):
improve makefile deps.
atrodo ;\\ 02:07
(sorry, that was a mistake)
kapace_ ok, thanks for the tip NotFound
atrodo cotto> from a only having one number type available, float makes more sense since it's more flexible. Not the more efficient, clearly 02:08
NotFound Are you looking for ways to make parrot slower? 02:12
plobsing atrodo: Even if lorito doesn't have N-regs, float operations can be accomplished by using black-box allocated memory and farming out manipulation to a native code library. Think of it as a math co-processor 02:14
NotFound I'm starting to think that instead of a redesign of the parrot VM lorito is going to be a brand new machine designed from scratch. 02:16
atrodo Well, I was thinking about it from this angle. How many dynamic languages make a distinction between ints and floats? 02:19
Coke tcl does. 02:20
plobsing perl does, if you're careful enough
atrodo: we shouldn't be thinking about impelementing dynamic languages in lorito. we should be thinking about implementing a full-featured VM in lorito.
NotFound atrodo: how many languages are *implemented* without int or floats? 02:21
plobsing forth doesn't have floats at all, using fixed-point math pervasively 02:26
NotFound forth is a 70' tool.
I have a Z80 assembler, if you want to go retro. 02:28
plobsing I'm fairly sure forth is still used for BIOS, embedded, and such
NotFound plobsing: sure, and Z80 is still used in embedded devices, 02:30
But this is parrot. And Parrot has N and I registers, 02:31
I strongly oppose to destructive redesigns.
plobsing if @lorito-implementers do things right, people on top should not very little if at all 02:34
atrodo NotFound> Exactly what I would advocate. I think ints and floats should both be there for performance reasons 02:35
plobsing PIR can *emulate* N-regs by allocating an FNA for functions that use them and using C-library functions to replace ops that operate on them. 02:36
02:37 Andy joined
NotFound plobsing: nice ideas, but I'd like to see working proofs before discarding anything. 02:37
plobsing NotFound: that's why its only a prototype until we can prove it works. N-reg emulation is likely one of the criteria for "it works". 02:39
NotFound Also, using extern C functions will be hardly JITable, and people here seem to think that most speed gains will come from JIT. 02:40
plobsing who does? let me show them benchmarks proving how little overhead op-dispatch is costing us. 02:41
lorito's primary benefit is fixing the inferior runloops problem.
NotFound plobsing: just look at the logs.
plobsing people implying JIT will have benefits is different from people beleiving JIT will improve performance. 02:42
if you can say you have a JIT, many morons who think they know much more than they actually do will be impressed. Sadly the world runs on such morons. 02:43
NotFound I don't care about morons nor about impressing people. 02:44
02:44 whiteknight joined
nwellnhof the main reason why JIT won't improve performance is that parrot is slow in other areas. i hope that we'll get to a point where JIT matters performance wise. 02:44
NotFound If N or I registers go out of parrot, I'll also go.
plobsing number of volunteers and hype are important
nwellnhof: the reason JIT increases performance in other VMs is that their ops are generally lower level and they have more of them. 02:45
NotFound plobsing: hype without code is vaporware.
plobsing NotFound: an army of morons can become an army of minions 02:46
NotFound plobsing: maybe, but I'm not going to be an officer of such army., 02:47
dalek rrot: 6b79d24 | petdance++ | / (42 files):
Merge branch 'master' of github.com:parrot/parrot
02:48
nwellnhof plobsing: it depends on the benchmarks. but many of the things parrot is used for now wouldn't see a big benefit.
Andy Huh, that shouldnt' have happened 02:49
ping kid51 02:51
whiteknight Parrot is going to get faster in all areas over time 02:53
Matt221 whitenight: Can you approve this task: www.google-melange.com/gci/task/sho...1784253#c1 Already got a head start :) 02:55
*whiteknight
whiteknight let me look
Approved. Good luck 02:56
Melange is very slow tonight 02:57
Matt221: If you look in the parrot repo, src/string/api.c, there is a function in there that can parse a STRING to a Float
I don't remember the name
Matt221 Its ALWAYS slow here
whiteknight anyway, use existing functions and don't try to write your own parsing routine 02:58
fbrito I really think that there should be tasks to improve Google Melange performance :P
whiteknight I'm sure Google isn't running it on their good hardware 02:59
Matt221 Yes! I actually wrote an iPhone app that displays the current rankings as well as a native 'task tracker'
whiteknight They're using the cheap crap-o hardware for open source work
Matt221 Speeds things up a bit..
whiteknight Okay, I have to go to bed now. I was only signing on to check messages 03:00
goodnight
Matt221 Anyway: here is the work I have so far for the task: github.com/mattrajca/parrot-linear...e9a6137964 It seems like the float parsing logic is overkill
whiteknight oh yeah, that looks good 03:01
if it works, that's what matters now. We can optimize it later if we need to
okay, now I am leaving. Goodnight
03:01 Yuki`N joined
Matt221 ok - goodnight! 03:01
03:01 whiteknight left
Yuki`N cotto, the Iterator PMC seems to be mostly subclassed, so I'm not quite sure how I'm going to go about this. 03:01
Also, the iterator.t is in Perl, not PIR like I'm used to. 03:02
How does the Perl test harness work?
kapace_ argh! why does gedit suck so much
fbrito kapace_: what do you mean? 03:03
kapace_ I don't know, its just I used notepad2 for so long, and gedit looks so weak comparing the two 03:05
plobsing kapace_: there are other editors for linux... 03:06
kapace_ I guess i should have learned Vi earlier so I would have its power
fbrito there are lots of plugins to gedit :P. but I still prefer Vim
atrodo i initially learned vi by using gvim 03:07
plobsing with great power comes great time wasted customizing
kapace_ thats the thing: I don't have time to waste 03:08
i guess wine + notepad2 will do for now 03:09
fbrito what do you miss in notepad2? :P 03:10
03:10 Coke left
kapace_ I need to be able to convert CR-LF to LF etc 03:10
plobsing kapace_: dos2unix? 03:11
kapace_ I need to have a count of selected bytes available in status
plobsing: too much work to pop a shell, cd to work dir and execute command
in notepad2, its a one-button operation
plobsing unless your editor has a shell built in, or you are already in a shell, or both. 03:12
kapace_ I should look in to that
Yuki`N nautilus-open-terminal :P 03:13
I'm trying to run a PIR test. 03:18
And I get error:imcc:build_key: wrong register set
plobsing that's a new one. 03:20
oh. it means you've used something that isn't an I-reg or an S-reg in a key 03:21
Yuki`N Oh.
Yeah, I didn't know how [''] syntax worked. 03:22
The line number however was completely wrong.
plobsing known problem. it's a won't-fix.
(IIRC) if you want accurate line numbers, your best bet is to remove all leading spaces. 03:23
03:23 nwellnhof left
kapace_ anyone know how to convert a hex string to int? 03:26
Yuki`N aloha, coverage? 03:27
No, it doesn't like me?
kapace_ aloha isn't here... 03:28
cotto NotFound, it's nice to see that you have a strong opinion about N registers. Why are you so opposed to losing them?
Yuki`N Oh that's interesting.
cotto (in Lorito, since PIR will have to retain compatibility) 03:29
dalek rrot: 31ca7a2 | petdance++ | include/parrot/p (2 files):
updated headers for headerizing
03:36
kapace_ www.perlmonks.org/?node_id=441152 this guy implemented hex2decimal.. there isn't a builtin method? 03:41
cotto My thinking is that Parrot should be optimized for the common case, and that the float manipulation isn't common enough to have specialized ops. 03:42
kapace_, why do you need that? 03:44
kapace_ cotto: the chunked encoding's length is in hex
the length is hex string.
"1000" = 4096 (decimal) 03:45
cotto kapace_, looking at the task now 03:46
kapace_ int l = sl.to_int(16); in the example 03:47
plobsing parrot lacks builtins for parsing octal/hex. the various internals that need to deal with such things delegate atol, atoi, or strol
kapace_ ok, so ill just use the guy's implementation, yes?
Yuki`N What exactly is a KEY. 03:49
i.e. in the opcode exists.
cotto kapace_, String has a to_int method 03:50
can you use that?
kapace_ oh, I should have thought of that, let see 03:51
cotto kapace_, it's hard to know where to look
but you should never have to implement hex to decimal conversion
we have more interesting problems to solve 03:52
plobsing cotto: what about hex-floats? (wanted for java, c, etc)
kapace_ yes
i agree with not re-inventing the wheel
cotto: works! just had to convert my string into a PMC. Thanks! 03:53
cotto kapace_, great
kapace_ ok, halfway done, this task is pretty fun. But I must leave to eat. 03:55
cotto kapace_, commit early and often 03:56
kapace_ cotto: I'm not too keen on using git. I have parrot-master cloned. If i commit here can it be merged later some how? 03:57
cotto plobsing, you can convert those if you want
kapace_, sure. Do you have your own fork? 03:58
kapace_ no
should i make on on github?
plobsing cotto: I don't want to; but I need to do so to fully implement perk (java), which I *do* want
cotto kapace_, it's up to you. It's probably easier to do so. 03:59
kapace_ ok forked. how do I setup my local clone to commit to my fork? 04:00
Yuki`N I was saddened by the fact that java on parrot didn't work. 04:02
plobsing doesn't work *yet* 04:03
cotto kapace_, I'd clone from github and apply the patch manually, but that's because my git-fu isn't strong yet.
kapace_ ok, that Way makes sense. 04:04
Yuki`N kapace_, git remote set-url origin
Um
And then the URL to your fork on github.
i.e. mine is git@github.com:nol888/parrot.git 04:05
I have to say, I started out using SVN, and I just like git a lot. 04:06
The only thing I miss is the integrated keywords systeim in SVN.
*system
kapace_ oh, thanks Yuki`N 04:07
git remote set-url origin just returns the help though 04:08
Yuki`N Yeah.
You need to add your url to the end
kapace_ oh sorry didn't see that heh 04:09
Yuki`N e.g. git remote set-url origin git@github.com:kapace/parrot.git
And then you can `git push'
kapace_ Permission denied (publickey).
Yuki`N You need to add your public key to github. 04:10
And if you don't have a public key you need to make one.
help.github.com/linux-key-setup/
If you're on Windows all you have to do really is use git bash. 04:11
kapace_ ok, thats going to take some time, I think ill get to it later. Thanks for your help 04:12
fbrito (is Google Melange down?) 04:14
Yuki`N Works for some tasks. ;-; 04:16
fbrito :/ 04:17
Yuki`N I claimed the wrong task. 04:18
Claimed "complex" instead of "iterator"
Doesn't help that they have the same title.
fbrito cotto: I am done with my portuguese README translation: github.com/parrot/parrot/pull/30
but the task page is down, so don't bother with it right now :P 04:20
cotto fbrito, ok. We'll need to find someone else who can verify the file. 04:25
04:26 Matt221 left
fbrito Sure, no problem. Who was the other brazilian guy here? I think it was Kovensky 04:26
cotto sounds plausible 04:27
Kovensky, ping 04:34
Yuki`N cotto, I'm going to be pulling out of increasing Complex.pmc's coverage in favor of the Iterator.pmc task. 04:35
As soon as Melange is working again.
Can anyone explain to me how I can call the method of a base class from PIR? 04:46
fbrito Yuki`N: Melange is working now for me 04:52
Yuki`N Ah, thanks,. 04:53
Still not working for my task though.
fbrito Yuki`N: oh, I was wrong
It worked because I wasn't logged in
Yuki`N Oh lol.
cotto Yuki`N, ok 04:56
let me see if I can dig something up
Yuki`N cotto, I wasn't sure, since there's no way to instantiate the Iterator base class but I still need to test overridden methods somehow. 04:57
TiMBuS_ plobsing, is this parrot-libjit-fb thing on github not complete? or am i missing something here =/ 05:01
05:01 TiMBuS_ is now known as TiMBuS
cotto Yuki`N, you can test the Iterator code indirectly by testing a subclass that doesn't override the methods or VTABLE functions. 05:03
plobsing TiMBuS: it's complete as far as I know
Yuki`N Hm, ok. I'll try looking for one.
plobsing what problems are you having?
TiMBuS well, no problems, i was just wondering how it worked
wanted to try making a libffi version of it
plobsing you load it. it works the same way as parrot's nci system 05:04
TiMBuS: too late. we had a gsoc project this summer that did exactly that
TiMBuS oh?
plobsing it's part of core now. if parrot config detects libffi installed on your system, it gets built, and automatically loaded on parrot startup 05:05
no user intervention required
TiMBuS well then..
might as well delete this old ffi PMC i made then
plobsing sneaky features you didn't even know you had :) 05:06
TiMBuS so that means rakudo can pretty much load any C lib now?
plobsing *if* you have libffi, yes. which means either gcc or msvc compiler. 05:07
TiMBuS gotcha 05:08
plobsing if that's not good enough, you have to fall back on static thunks. 05:09
there is *no* 100% portable way to do ffi
fbrito ok, now Melange is back (at least for my task) 05:20
Yuki`N Melange is back. 05:23
cotto, I withdrew from the Complex task, and claimed the Iterator task, socghop.appspot.com/gci/task/show/g...9193194564 05:27
fbrito, you're free to do the Complex task.
fbrito I was going to ask that right now :P
Thank you
05:28 rurban_ joined
fbrito Yuki`N: but I still have to get my translation reviewed, so if you finish your Iterator task, feel free to claim the Complex one 05:29
Yuki`N I looked at the complex one and it was. :/
Most of the untested functions are hyperbolic trig functions or something like that. 05:30
And they apparently don't work.
I don't know hyperbolic functions, much less how they work for complex numbers.
Even applying normal sin cos tan to complex numbers is a bit confusing. 05:31
plobsing "don't work" sounds like hyperbole
05:31 rurban left
plobsing :[ 05:31
05:31 rurban_ is now known as rurban
plobsing s/[/p/ 05:31
Yuki`N i c wut you did there.
That's legit what the comments in complex.pmc say though lol.
plobsing Yuki`N: cosh = (e**x + e**-x)/2 ; sinh = (e**x - e**-x)/2 05:32
Yuki`N How am I supposed to test the set_integer_native function of the Iterator base class? The method body is basically:
PARROT_FAILURE("Iterator: implementation have to override this method");
And without the ability to directly call base class methods it's pretty useless. 05:33
Unless I subclass Iterator for the test.
plobsing that sounds like a good plan 05:34
Yuki`N Oh dear. 05:36
Creating classes in PIR.
cotto Yuki`N, accepted 05:41
Yuki`N cotto, thanks.
Just figuring out how to add methods to classes in PIR. 05:42
cotto I hope this part of the gci dance goes away next year.
Yuki`N Heh. 05:43
cotto, pastebin.com/xXqBwyX3 06:01
I don't understand what I'm doing wrong.
When I use newclass, it works. If I try subclassing, the Iterator's init vtable method gets called.
fbrito (off-topic: just watched an amazing TED interview with Julian Assange. that guy really rocks) 06:03
cotto Yuki`N, looking 06:10
Yuki`N Apart from that though, all of Iterator is covered. 06:20
fbrito I am going to bed. Good night guys 06:31
cotto Yuki`N, I'm not sure why that doesn't work. 06:33
Yuki`N Yeah, it's strange.
Should I try committing what I have so far?
It covers everything except that one stub. 06:34
cotto Sure. Just TODO the test.
Yuki`N K.
06:36 fbrito left
Yuki`N From 15% to 85% XD 06:36
cotto Nice.
Yuki`N Given, the Iterator PMC only has about 10 or 11 methods.
cotto coverage is coverage
Yuki`N Indeed. 06:37
Let me commit.
cotto, here's my pull request. github.com/parrot/parrot/pull/31 06:46
sorear um 06:49
Yuki`N Night all.
sorear why are we testing Iterator
06:50 Yuki`N left
sorear the Iterator API needs to die in a fire, not have tests written against it 06:50
opbots names
plobsing sorear: the idea is to increase code coverage. Iterator API, while poor, is not unworkable like other aspects of Parrot currently receiving work. 06:52
07:12 Andy left 07:14 cognominal left 07:46 bacek left
kapace_ when anyone has a minute, could you take a look at or test github.com/kapace/parrot/commit/d2...1dbe68895d 08:22
kapace_ goes to sleep
08:35 rfw left 08:43 rfw joined 08:52 theory left 09:23 rfw left 09:37 fperrad joined 10:03 preflex left 10:06 preflex joined 10:12 cognominal joined
dalek rrot: c24b844 | mikehh++ | src/list.c:
fix codetest failure - line length
11:38
12:08 lucian joined
NotFound cotto: you asked I want to keep N registers? The answer is winxed/examples/fly.winxed 12:15
mikehh make corevm/make coretest FAIL - t/pmc/integer.t .. error:imcc:loadlib directive could not find library `sys_ops' 12:16
all other tests PASS (pre/post-config, smoke (#1611) fulltest) at c24b844 - Ubuntu 10.10 i386 (gcc-4.5 with --optimize)
NotFound sorear: I've been doing experimental ports of some C++ standard algorithms and the provisional conclusion is yes, iterators sucks. 12:19
They are workable, but not enough powerful and flexible.
lucian NotFound: try better ones! :) 12:26
NotFound: i mean better iterators. C++-style iterators do suck indeed 12:27
NotFound lucian: I tried what we have now. 12:28
lucian NotFound: you'd probably expect me to say this, but have you looked at python's iterators/generators? 12:29
NotFound lucian: I'm looking at ways to do things in parrot. If adapting python idioms is a way, I'd like to see examples. 12:33
lucian NotFound: docs.python.org/library/stdtypes.ht...ator-types
NotFound: stackoverflow.com/questions/19151/b...n-iterator 12:36
NotFound: www.ibm.com/developerworks/library/l-pycon.html
NotFound lucian: I mean, parrot examples. 12:38
lucian NotFound: right. don't think there are any :) 12:39
NotFound: i'd think of the same concept, an object(pmc) that manages how others iterate it
nopaste "NotFound" at 192.168.1.3 pasted "Fun with iterators" (87 lines) at nopaste.snit.ch/26977 12:40
NotFound This is what I've been doing
lucian NotFound: i see. seems quite verbose 12:42
12:43 Alexandru20 joined
lucian NotFound: how does for(var i in cont) work in winxed? 12:44
NotFound iterates the content, not the indexes like javascript. 12:45
lucian NotFound: and what does "content" mean in this case? 12:46
NotFound: does it iterate over array elements, or object elements, or ... ?
NotFound lucian: whatever iter cont provides.
lucian NotFound: right, so cont provides an iterator 12:47
NotFound It cretaes the iterator under the hood and uses it to control the loop and to get the values for i
lucian NotFound: right, so very similar to python 12:48
NotFound: so in this particular case, the problem is binding a lot of things in different ways
could you make the iterators explicit? or are they already? 12:49
like developer.mozilla.org/en/JavaScrip...Generators
NotFound This is an exercise of adapating C++ idioms using current parrot iterators 12:50
lucian NotFound: do you want c++ idioms in particular? or just being able to solve the same problems as easily/cleanly? 12:51
NotFound lucian: I like this C++ idioms, but the idea is checking power and flexibility of our iterators. 12:53
lucian NotFound: i see
NotFound: the way i see it, if iterators are composable (and lazy while doing so), there's nothing you can't do with them 12:54
NotFound Sure I can write classes with provide iterator interface. But in C++ I can do lot of things without writing a class, just specializing templates and using algorithms. I'd like to have ways like that in parrot. 12:56
lucian well, you can remove the need to write classes without the C++ nastiness 12:57
NotFound That's what this examples are about. They do with closures what C++ does with template classes. 12:58
lucian NotFound: yes, i see
it still seems a bit more verbose than it should be 12:59
maybe i'm just not used to winxed
NotFound lucian: is just an experiment, optimized only for legibility. 13:00
Well, if it looks verbose in winxed, don't look at the generated pir X-) 13:02
lucian NotFound: of course not :) 13:06
NotFound The get_iter vtable in Iterator return SELF, so the iterator can be used just like the container. 13:20
13:28 rurban_ joined
lucian NotFound: i see, so they should be easily composable 13:29
NotFound The problem I'm looking now is that creating an iterator at runtime may mean to generate a class on the fly. 13:30
lucian NotFound: which doesn't work right now?
NotFound: btw, writing a class may in fact be less verbose than all those closures 13:31
13:31 rurban left, rurban_ is now known as rurban
NotFound lucian: that verbosity don't worry me, will be inside a library or something. What worries me is easy of usage. 13:32
lucian NotFound: does winxed support generators of some sort (yield)?
NotFound lucian: yes
lucian can't you use a generator function for iterating?
NotFound Just use yield instead of returm
lucian: a coroutine can't provide the interface that functions expecting a parrot iterator use. 13:33
lucian NotFound: that's sad
i find that to be a nice idiom 13:34
NotFound Maybe we can encapsulate the coroutine inside an iterator-alike class, but for doing that in generic way we need to create that class on the fly. 13:35
lucian NotFound: that seems a rather arbitrary restriction, Class not being an Object 13:36
NotFound: it'd be nice to be able to pass a coroutine to a higher-order function that returns an iterator 13:37
NotFound lucian: it's hard to clear that restriction, too much parts of parrot uses directly class internals instead of calling its vtable and methods.
lucian so you could do for(var i in iter(cycle([1, 2, 3])))
i see 13:38
13:38 Alexandru20 left
NotFound lucian: I'm doing some experiments on that direction. 13:38
lucian in fact, iter could be implicit
again, that's what python does. perhaps i like the language too much :)
NotFound lucian: I don't have any problem in borrowing ideas for python or any other, I'm basing the tests on C++ ways because is what I know better. 13:40
lucian python takes this idea further with decorators
13:42 Alexandru20 joined
NotFound lucian: if we can manage some basic games with iterator creation, we'll can take any idea as far a we want. 13:43
13:43 whiteknight joined
lucian NotFound: www.artima.com/weblogs/viewpost.jsp...ead=240808 13:44
13:48 Alexandru20 left
NotFound lucian: takes forever to load that page. 13:49
lucian i see
NotFound: the pep is clear enough www.python.org/dev/peps/pep-0318/ 13:50
nopaste "NotFound" at 192.168.1.3 pasted "Testing class creation on the fly" (26 lines) at nopaste.snit.ch/26979
13:51 Alexandru20 joined
dalek rrot-linear-algebra: ac6c417 | mattrajca++ | / (2 files):
Implemented set_string_keyed in NumMatrix2D
13:57
rrot-linear-algebra: 8ba9b28 | mattrajca++ | / (2 files):
Efficiency improvements
rrot-linear-algebra: dd21b96 | Whiteknight++ | src/pmc/ (3 files):
remove some old TODO notes
rrot-linear-algebra: 9039596 | Whiteknight++ | / (12 files):
Merge branch 'master' of github.com:Whiteknight/parrot-linear-algebra
rrot-linear-algebra: 99cd55d | Whiteknight++ | / (2 files):
Merge remote branch 'origin/gci_set_string_keyed'
nopaste "NotFound" at 192.168.1.3 pasted "Iterator that calls a coroutine" (43 lines) at nopaste.snit.ch/26980 14:07
NotFound lucian: this way works
lucian NotFound: that looks pretty nice 14:09
NotFound: can you write for(var i in create_iterator(aux)) ? 14:10
NotFound A bit more complicated that should be, but abstracting the details in some functions it can be workable, and adaptable to future parrot changes. 14:11
lucian yep 14:12
NotFound lucian: sure, I used the object var for flexibility of the test.
for (var i in create_iterator(aux)) does the same.
lucian you can have an Iterator class that takes a coroutine as an argument at creation
or is that what you're doing? i'm not familiar with class syntax in winxed 14:13
NotFound lucian: yes, but I'm looking more at ways for custom creation from pir.
lucian i see
NotFound lucian: no, in that case the class is created on the fly. The function creates the class and instantiate it.
lucian NotFound: i see. is that necessary? 14:14
NotFound I'm using winxed as a higher-level PIR, doing this kind of tests in pure pir is hard.
lucian can't parrot objects have vtable methods of their own?
NotFound lucian: no. 14:15
14:15 kid51 joined
lucian NotFound: ah, that's so sad 14:15
NotFound: so would an .iterator directive be possible for pir subs?
NotFound In this simple case a static class can be used, but I'm testing towards the higher genricity possible.
lucian right 14:16
dalek rrot/embed_api2: d74cf45 | Whiteknight++ | / (2 files):
fix build warnings in src/embed/api.c
14:17
rrot/embed_api2: eaafc83 | Whiteknight++ | tools/build/parrot_config_c.pl:
fix build warnings in generated *_config.c files
rrot/embed_api2: 13686bc | Whiteknight++ | / (6 files):
merge, fixing conflicts
NotFound The problem is that the iterator interface needs at least to functions: checking it we are at end, and getting the value. 14:18
kid51 whiteknight good morning
NotFound A simple sub can't do that.
lucian NotFound: i see 14:19
NotFound: well, the coroutine iterator example uses a sub at some point 14:20
NotFound: so would an equivalent for the sub directive work? like .generator 14:21
NotFound lucian: it avoids the problem by never ending.
lucian NotFound: oh, right. one option is throwing an exception
NotFound lucian: throwing an exception in the sub and caching it in the enveloppe? Sounds doable. 14:22
lucian NotFound: well, that's what python does. StopIteration
parrot also has the option of inspecting the coroutine's frame, right? 14:23
NotFound lucian: yes, but I we want genericity we shouldn't make assumptions about the kind of object used as fun. 14:24
lucian NotFound: yes, of course. i favour exceptions, but i don't know if that's desirable for parrot
NotFound The excpetion idea is nice, but if we want maximum genericity we should use that idea also in the core iterators. 14:26
lucian NotFound: yes, that would be nice. (and again, it's what python does)
NotFound Mmm... in fact it might be working right now, if you just don't call get_bool. 14:27
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS, 14:28
"StopIteration");
That's what ArrayIterator does.
But existing code doesn't do that, it calls get_bool. So a proposal and a deprecation period will be needed to go in that direction 14:30
A workaround is an envelope that gets the value in advance an catches the exception to set a flag, and use that flag for the get_bool result. 14:31
lucian NotFound: yes, that would also work 14:32
14:39 slavorgn joined
dalek rrot: f76eee7 | jkeenan++ | / (2 files):
Now that we rely on 'git ls-files' to identify files which are candidates for

traversed, which means we can remove one TODO-ed test. (This should have no impact on functioning of tools/dev/mk_manifest_and_skip.pl.)
14:40
rrot: 23f2e8d | jkeenan++ | / (2 files):
Add one generated .o file to .gitignore so that it is not reported by 'git status'. Regenerate MANIFEST.SKIP.
rrot: 6b44353 | jkeenan++ | .gitignore:
Remove outdated references to 'svn:ignore' from .gitignore.
14:53 perlite_ joined, perlite left 14:54 perlite_ is now known as perlite
mikehh where's aloha? 15:08
nopaste "NotFound" at 192.168.1.3 pasted "Iterator from coroutine, improved" (74 lines) at nopaste.snit.ch/26983 15:09
kid51 Out surfing on the North Shore
mikehh ha, bacxek ain't around either, should be around 2am Monday for him :-} 15:11
bacek/bacek_at_work
NotFound lucian: here is a more complete version 15:12
mikehh we really need to host aloha on one of our servers 15:14
(or bring back purl) 15:15
NotFound A problem with this approach is that anonymous classes created on the fly will probably never be collected. 15:18
15:24 whiteknight left 15:39 Patterner left
lucian NotFound: hmm, sort of ugly unfortunately 15:41
NotFound: and ideally, StopIteration would get thrown when the coroutine stops yielding 15:42
NotFound lucian: in the current implementation, if a coro return ugly things happen. 15:43
lucian NotFound: i see 15:44
NotFound: that seems like a pretty nasty bug to me
dukeleto ~~ 15:46
NotFound lucian: yeah, I've looked at the problem but is hard to solve.
I'm liking this way of class creation on the fly, it can be a way to the workaround the problem of not being able to inherit from Class. 15:47
15:49 Psyche^ joined, Psyche^ is now known as Patterner
lucian NotFound: i don't know, it still seems to me like a hack because parrot's classes/objects suck 15:51
NotFound lucian: yes, but hacks that works and allow doing things can provide tests and real usage cases that helps refactor it to less hackish ways. 15:53
lucian NotFound: yes, true
mikehh make corevm/make coretest FAIL - t/pmc/integer.t .. error:imcc:loadlib directive could not find library `sys_ops' 15:55
all other tests PASS (pre/post-config, smoke (#1617) fulltest) at 6b44353 - Ubuntu 10.10 i386 (g++-4.5 with --optimize)
NotFound Sigh... sysinfo again. 15:57
15:59 kid51 left 16:08 Alexandru20 left
dalek TT #1180 reopened by coke++: examples/nci/ls.pir prints only lines with one character each 16:12
TT #1180: trac.parrot.org/parrot/ticket/1180
rrot: c871227 | plobsing++ | t/pmc/integer.t:
skip if sys_ops unavailable
16:14
NotFound plobsing: uh... skiping all Integer test in coretest kinda invalidates the purpose of coretest. 16:16
Of course, failing to compile it is hardly better. 16:18
plobsing to run under coretest is the wrong default for tests. coretest should be opt-in, not opt-out.
NotFound plobsing: I think the Integer PMC is core enough. 16:19
plobsing true, and some of those tests should be moved to t/core/pmc/integer.t (or something like that) 16:20
another alternative would be to run each test in its own sandbox, like we used to when we still used perl for these tests. 16:24
NotFound plobsing: I've looked at that, but there are lots. 16:26
Mmm... let me try something... 16:27
dalek TT #1889 created by coke++: fix makefile deps 16:28
TT #1889: trac.parrot.org/parrot/ticket/1889
mikehh rakudo (d1e6636) - builds on parrot (2_10_1-762-g6b44353) - make test PASS, make spectest_smolder(#1618) PASS - Ubuntu 10.10 i386 (g++-4.5 with --optimize) 16:37
t/spec/S02-magicals/pid.rakudo - TODO passed: 1
27,052 ok, 0 failed, 610 todo, 1,856 skipped and 1 unexpectedly succeeded
17:07 whiteknight joined 17:21 kid51 joined
dalek rrot: 8d73990 | NotFound++ | t/pmc/integer.t:
skip only Integer tests that depend on sysops when unavailable
17:44
NotFound mikehh: this should fix the problem with coretest 17:50
17:57 ok22_ joined 18:00 ok22 left, ok22_ is now known as ok22 18:08 kid51 left 18:21 theory joined 18:50 rfw joined 19:05 Yuki`N joined
nopaste "NotFound" at 192.168.1.3 pasted "Metclass experiment" (82 lines) at nopaste.snit.ch/26990 19:37
dukeleto waves from the PDX airport. 2.5 hour delay may lead to some Lorito hacking 19:45
20:05 whiteknight left 20:14 rfw left, rfw joined 20:16 perlite_ joined 20:19 perlite left 20:20 perlite_ is now known as perlite 20:44 M_o_C joined, bluescreen left 20:52 contingencyplan joined 21:28 rurban_ joined 21:31 rurban left, rurban_ is now known as rurban 21:34 lucian left
plobsing where can I find concise documentation on NQP grammars? I am specifically interested in how the associated actions are supposed to work and the way items get put into $/. 21:35
dukeleto the nqp-rx/docs directory is sorely lacking useful info 21:39
plobsing yes, the only documentation I can find are "build a compiler" tutorials. I don't care about most parts of building a compiler. Specifically, I already know enough about the grammars syntax, and enough PAST to get to what I want to do. 21:41
I don't want to wade through pages to find a couple lines here and there that are relevant 21:42
I have 'token EscapeSequence { | <SpecialEscape> | <OctalEscape> | <UnicodeEscape> }'. Each of those sub-tokens has an appropriate rule with a 'make String.new(...)'. How do I get at those strings? I don't really care which sub-token matched. 21:46
sorear $<SpecialEscape> // $<OctalEscape> // $<UnicodeEscape> iirc 21:47
plobsing in nqp-rx?
urg. I'm going to have to change this whole damned grammar.
sometimes it isn't just 3 options. sometimes it is many, many options. I just want "whatever the alternation matched". 21:48
repeating the names of all the options is a serious DRY violation 21:49
dukeleto plobsing: there is probably something easier
plobsing: tcurtis is a good person to ask. He wrote the PAST optimizer stuff
plobsing: perhaps his code would be useful to read
plobsing I thought his PAST optimizer was based on objects and didn't use a textual representation (obviating the need to implement grammar/actions) 21:50
jnthn plobsing: You get at the thing you set with make using the .ast method, e.g. <OctalEscape>.ast. Yes, it *will* be longwinded the way you're doing it. Use protoregexes. 21:51
er, I meant $<OctalEscape>.ast 21:52
plobsing I picked up perk on the premise that the grammar was more-or-less a working recognizer, just needing a set of actions to provide a backend. If I need to re-architect the grammar, I might as well start from scratch. 21:54
jnthn If it is older than nqp-rx then it may have been done before the time of proto-regexes.
dukeleto plobsing: perk is pre-nqp-rx 21:58
plobsing: is uses plain nqp, iirc
plobsing I got it to build with nqp-rx
and distutils
jnthn nqp-rx is laregely backward compatible in nqp. Even to the degree that Rakudo's old nqp grammar just about built and worked on nqp-rx. 22:00
s/in/with/
22:09 M_o_C left
dalek TT #1889 closed by coke++: fix makefile deps 22:26
TT #1889: trac.parrot.org/parrot/ticket/1889
22:29 Matt221 joined 22:34 mikehh left 22:37 fperrad left 22:56 bluescreen joined
Yuki`N Anyone want to go over my pull req? 23:04
23:20 mikehh joined 23:28 ingy joined
dalek nxed: r715 | NotFound++ | trunk/winxedst1.winxed:
fix a mistake when chomp predef is used
23:31
Yuki`N cotto, ping
mikehh All tests PASS (pre/post-config, make corevm/make coretest, smoke (#1621) fulltest) at 8d73990 - Kubuntu 10.10 amd64 (g++-4.5 with --optimize) 23:34
Yuki`N mikehh, thanks for fixing the Integer tests. 23:35
mikehh Yuki`N: not me - it was NotFound
Yuki`N Oh, yes, right. 23:36
Well, I'm sorry I even made it need a fix.
23:36 TonyC left
Yuki`N :P 23:36
NotFound Yuki`N: not your fault, it was a problem that needed good solution since some time. 23:37
23:47 nopaste left 23:50 nopaste joined, TonyC joined