#parrot Parrot 2.1.1 Released! | parrot.org/ | Channel log: irclog.perlgeek.de/parrot/today | Tasks: Fix HLL bugs! Fix and test corevm target!
Set by moderator on 9 March 2010.
00:01 tetragon joined 00:16 kid51 joined 00:53 AndyA_ joined
Whiteknight does the new nqp support multi-dimensional keys with native syntax? 01:02
like, can I do $c[1, 2]?
ash_ you can do $c[0][1]; 01:04
or $c[1][2]; in your case
github.com/perl6/nqp-rx/blob/master...ists.t#L42 tests that syntax so, i assume it should be working 01:05
Whiteknight I'm not sure I really understand that test 01:09
is that last test directing to get_pmc_keyed with [0;1], or is it calling get_pmc_keyed_int with 0 then 1?
01:12 AndyA joined
ash_ i think its doing get_pmc_keyed_int with 0 then 1 01:18
i am recompiling right now, otherwise i'd tell you for sure one way or the other
dukeleto 'ello 01:35
Whiteknight hello duke 01:45
ash_: okay, thanks
Austin_away whiteknight: it's two different evals 01:49
Whiteknight Austin: what?
Austin The [0][1] thing is two different get_pmc_keyed ops. 01:50
And yeah, I committed todo.
To kakapo master.
Whiteknight damnit 01:51
Austin Sorry, now there's no excuse for not testing 01:52
Whiteknight Austin: is todo_test exported? 02:04
Austin It should be exported as "todo"
Whiteknight oh 02:05
Austin So you can do "use( 'UnitTest::TestCase' );" .... method test_something() { todo("Not working"); }
02:05 eternaleye joined
Whiteknight yeah 02:07
Austin Look at t/UnitTest/TapListener.nqp
At the bottom is a todo
Whiteknight right
one of my test methods is hanging 02:08
Austin Heh
I know the feeling.
pir::trace(4)
Whiteknight and since it's randomly ordered, i donk know which
Austin do this: method main() { self.set_up(); self.test_foo(); } 02:09
You can run just one test, with no tap
Or just run the .nqp file directly, and you'll get the tests that *do* pass listed. 02:10
austin$> t/UnitTest/TapListener.nqp
Whiteknight I am running it directly 02:11
Austin How many tests do you have?
Never mind. Try putting this method in your testcase: 02:13
method run_test() { say("Running test: ", self.name); super(); }
Whiteknight found the test 02:14
Austin Cool.
nopaste "whiteknight" at 68.46.29.192 pasted "test hang for Austin++" (15 lines) at nopaste.snit.ch/19936 02:15
Austin I think your $a := 1+1i is creating a string pmc. 02:16
Whiteknight any obvious faux pas?
Austin ^^ 02:17
Try pir::assign__vPS($a, '1+1i');
Whiteknight well, that's not intended, but will that hang the test?
Austin Oh, the hang is in the exception handler.
You shouldn't catch that exception - use assert_throws_nothing. 02:18
But if you *are* going to catch exceptions, you catch them, record them, exit the catch block (and the try block) and then throw them.
Whiteknight where to do that, end of the try? 02:19
Austin Because the fail() throws an exception, which the CATCH catches, and then fail() throws an exception, which the CATCH catches, and then ...
Whiteknight with assert_throws_nothing, do i need try{} at all? 02:20
Austin Have a look at "assert_throws" at line 122 in src/UnitTest/Assertions.nqp for an example of how I do it. 02:21
02:21 hudnix joined
Austin No, you just make the assertion about a block. I do the catching, and if anything is thrown, I fail. 02:21
assert_throws_nothing("WTF? I said throws NOTHING!!", { throw Exception.new; } );
Whiteknight ah, so i need a block. 02:22
Austin Or a sub
assert_throws_nothing("should not throw", { my $m := ... }); 02:23
FYI: I know about the whole catch/throw/rethrow because I spend an hour or so chasing that particular snipe... 02:24
Whiteknight infinite exception loops are lousy, but remarkably easy to do in parrot 02:34
I can't even imagine a way to do it in C#, definitely not in a way that would be unintentional 02:35
dalek kapo: 023da94 | austin++ | src/Internals/ (2 files):
Added $Id$ to Kakapo.nqp, with a sub to access it.
02:44
Whiteknight If I had a dollar for every stupid I was, I would be a damn billionaire
Austin Heh.
Whiteknight can we create subs in subs in nqp? 02:59
or, can I make a block that takes arguments? 03:00
Austin Yeah
Whiteknight one of them pointy doodads? 03:01
Austin my &block := -> *@args, *%named { say("Blah blah: ", %named<foo>); };
You want a sub, or a closure?
nopaste "Austin" at 68.39.12.202 pasted "Closures in nqp" (33 lines) at nopaste.snit.ch/19938 03:02
Austin Worked on that last night, I think
For the Cuckoo stuff
Whiteknight I need a callback function that takes a fixed parameter list 03:03
so I guess a pointy block
can pointy blocks have return values? 03:04
Austin Sure
They're subs.
my &block := { 1; }; say( &block() ); 03:05
Whiteknight nevermind, the test passes so I guess I can return a value
Austin :) 03:06
03:06 mikehh joined
Austin Or the test is wrong... 03:06
but shhh..
dalek rrot-linear-algebra: beb7e09 | Whiteknight++ | t/pmc/complexmatrix2d.t:
update complexmatrix2d.t to kakapo's UnitTest framework. Code is MUCH nicer
03:10
Whiteknight is there syntactic sugar for getattribute/setattribute? 03:26
like $m.attr = whtever
or am I calling pir::getattribute()?
Austin You're calling getattribute, unless you've got it in self. 03:27
If it's in self, you can say 7 has $!foo; and then reference $!foo, but the twigil has to be a '!' (sigil can be anything: $@%&) 03:28
Whiteknight for non-self, I can do $m.attr := "whatever"?
Austin Nope.
Whiteknight damn 03:29
Austin Kakapo classes can do that, because I autogenerate those accessors.
But your PMC stuff isn't a kakapo class.
Unless you register and proxify it.
(And then it'll work.)
nopaste "Austin" at 68.39.12.202 pasted "Whiteknight, try this" (18 lines) at nopaste.snit.ch/19940 03:32
Austin Modulo spelling of Char2d 03:33
Whiteknight okay, I see what you
re doing 03:34
Austin That would set up a proxy namespace, which is probably enough for what you want.
03:48 janus joined
Whiteknight okay, I'm out for the night. Later 04:05
dalek rrot-linear-algebra: fb070be | Whiteknight++ | t/pmc/complexmatrix2d.t:
fixes/updates for complexmatrix2d.t
04:09
rrot-linear-algebra: 3ddc267 | Whiteknight++ | t/pmc/pmcmatrix2d.t:
convert pmcmatrix2d.t to use kakapo
purl I don't know how to convert pmcmatrix2d.t to use kakapo.
rrot-linear-algebra: af8af91 | Whiteknight++ | t/pmc/ (2 files):
start updating nummatrix2d.t to use Kakapo. Lots of work here yet to go
04:30 atrodo joined, tetragon joined 04:34 mikehh joined, tetragon_ joined 04:36 parthm joined 05:06 plobsing_ joined 05:10 parthm left 05:13 bubaflub joined 05:41 kurahaupo joined 05:50 sorear joined 06:37 plobsing joined
sorear Is it possible for code which is called from deep inside a PMC vtable method to call back into Parrot code? (for binding to C libraries with callbacks) 08:21
09:00 iblechbot joined 09:02 payload joined 09:15 payload joined
chromatic sorear, see Parrot_pcc_invoke_sub_from_c_args 09:18
sorear I see. How does this interact with continuations, in particular continuations that return more than once? 09:20
chromatic The same way anything you invoke from C interacts with C. 09:49
sorear I don't quite follow 09:54
Parrot_pcc_invoke_sub_from_c_args; free(tmp); /* is this a double free waiting to happen? */ 09:55
chromatic You invoke a Parrot sub from C. 10:00
It returns to C.
You decide what happens next.
sorear chromatic: I invoke a Parrot sub from C. It captures the current continuation somehow. It returns to C twice. The next line of code is executed twice, causing a double free. 10:01
10:01 payload joined
chromatic Why does it return to C twice? 10:02
sorear Because it stores the continuation somewhere and calls it again after already having returned once 10:03
Or are Parrot continuations only usable once?
chromatic They're full continuations.
If you capture them, you can invoke them as many times as you like.
Once Parrot has returned to C, how does Parrot magically invoke that continuation again? 10:04
sorear Because the C code might call Parrot again 10:05
chromatic Yes, with either a new continuation you've created for calling into Parrot or an existing continuation you've retained for calling into Parrot again. 10:06
sorear (define evil (if (not-nil? storedcont) (storedcont) (call/cc (lambda k (set! storedcont k))))) 10:07
chromatic Why is that evil?
sorear Parrot_invoke_blah("evil"); printf("How many times is this printed?"); Parrot_invoke("evil")
chromatic One time. 10:08
purl one time is enough
sorear Why
The continuation is saved
chromatic Parrot's continuations don't capture C's control flow. Why would they? (Better yet, *how* would they?)
10:08 payload joined
sorear Because I don't see how they *couldn't* 10:08
chromatic Why would they? They have nothing to do with C calling conventions, because C doesn't support continuations. 10:09
sorear After the second call to evil, if parrot doesn't return to C again, where does control transfer to?
chromatic It returns to C again, after the second function call to C.
Just like calling any other C function.
sorear But the return continuation which would have caused the second call to return, was discarded 10:10
chromatic I don't know how to respond to that. 10:12
Perhaps you can tell me why you think that is the case and I can tell you how Parrot works. 10:13
sorear consider the case of continuations used to implement (cooperative) multithreading 10:15
chromatic Sure, I know how that works.
sorear now there's a parrot function coop_thread_yield() which captures the current continuation, attaches it to the current thread, and restores the continuation for the next thread
now suppose you have a couple long C functions which call coop_thread_yield in the middle 10:16
both of them have activation records; how does Parrot switch between them
chromatic The C functions?
purl the c functions are generally byte string operators
sorear Yes, the C functions. 10:17
purl the c functions are generally byte string operators
chromatic Parrot doesn't.
Parrot's not in charge of however you call into libparrot.
sorear What does Parrot do instead?
In the presense of continuational control flow, how does Parrot_call know when to return?
chromatic It invokes the appropriate return continuation and returns to C. 10:18
Or, more precisely, the little state machine which implements Parrot ops hits the invoke op for the return continuation created when you called Parrot_call and exits the state machine.
sorear What happens if the wrong return continuation is hit? 10:19
C -> Parrot -> save continuation here -> C -> Parrot -> invoke saved continuation
chromatic Then you get to keep both pieces as a reminder not to do silly things. 10:20
Let me be clear.
10:20 allison joined
chromatic What makes you think Parrot_call saves the state of the C stack? 10:20
sorear Nothing, which is precisely what makes me wonder about the semantics involved 10:21
chromatic What makes you think Parrot continuations care about the C stack?
Because they don't.
sorear If Parrot_call did save the C stack, things would be simpler (and wrong)
simpler to explain that is
to me
chromatic Parrot_call is a C call which follows C's calling conventions. 10:22
When does it return? When C thinks it returns.
sorear Next question: s/continuations/exceptions/
chromatic If Parrot invokes the "wrong" return continuation, that's something you did wrong within Parrot. 10:23
That has nothing to do with C.
That has nothing to do with *where* you return in C.
Parrot_call does not call setjmp and there's no longjmp involved in invoking a return continuation.
sorear In other words, it is an error/bad idea/won't work to use a continuation to attempt to exit the dynamic scope of Parrot_call. 10:25
chromatic Sure it'll work.
You call Parrot_call. It creates return continuation Alpha. It invokes several Parrot subs. Deep in that call graph, something invokes return continuation Alpha. 10:26
BAM.
Parrot's run out of inputs for its little state machine.
Parrot_call returns.
sorear By the dynamic scope of Parrot_call, I was including alpha
10:27 kjeldahl joined
chromatic Where's the problem then? 10:27
purl the problem then is just getting users to use it.
sorear Parrot_call never returns and the abstract view of C functions as the same as Parrot functions breaks down and you have to deal with a slightly less mathematically perfect world 10:28
chromatic Why does Parrot_call never return? 10:29
I can assure you with the full force of the Parrot test suite that it indeed does return.
sorear 02:24 < sorear> C -> Parrot -> save continuation here -> C -> Parrot -> invoke 10:30
saved continuation
02:24 <@chromatic> Then you get to keep both pieces as a reminder not to do
silly things.
purl silly things are missing. or just don't work.
sorear I took that to mean:
The inner Parrot_call doesn't return because the continuation it's waiting for is never hit. 10:31
chromatic Parrot_call doesn't care about continuations.
sorear No, but runops does
chromatic Sure, and when runops runs out of ops to execute, it returns.
sorear but it will never run out of ops to execute, because the saved continuation pointed entirely outside of the callback 10:32
chromatic The saved continuation doesn't care about the callback.
sorear exactly 10:33
chromatic So what's the problem?
sorear there isn't one
you've already explained it to me
except that when I tried to explain it to you, you said I was wrong 10:34
chromatic Then why do you say " but it will never run out of ops to execute, because the saved continuation pointed entirely outside of the callback"?
sorear so now the "problem" is in your courtr
chromatic: Op chains only end inside callbacks. Leave the dynamic Parrot scope of the callback, and the op chain has no end.
chromatic Nonsense. 10:35
purl nonsense is probably stopgeek.com/wp-content/uploads/200.../sense.jpg or www.ratemyeverything.net/post/1219/..._Head.aspx
sorear ok 10:36
suppose I have a function
(define (exceptions-were-nih) (call/cc (lambda k (external-function (lambda () (k))))) (exceptions-were-nih)) 10:37
if external-function is implemented in Parrot, and calls its first argument, this is simply an infinite loops
-s 10:38
chromatic Sure.
sorear if external-function is implemented in C, and Parrot works like I understand, this function leaks memory
chromatic Sure, it consumes the C stack.
sorear yes 10:39
chromatic So far so good.
sorear because the recursive calls to Parrot_call never return in C-space
chromatic Right.
But not because you're not "invoking the right return continuation", but because you're never returning from *anything*. 10:40
sorear Ok, so I was just using a different definition of "return", confusion solved 10:41
now suppose I change that function to use exceptions instead of call/cc
will it still leak C stack frames? 10:42
chromatic That... depends on what kind of exception handler you have.
sorear A totally vanilla unwinding try{}catch kind. 10:43
I don't remember how they're spelled in Scheme
chromatic Implemented in C or in PIR?
I don't know anything about Scheme exception handling.
If it's in PIR, you're fine.
sorear Neither do I, so a change of language is in order 10:44
chromatic If it's in C, I haven't convinced myself that our current implementation is free of bugs.
sorear while(1) { try { external_func(); } catch(Exception ex) {} }
chromatic And you want to talk about the PIR equivalent of this?
sorear yes 10:45
where external_func is C
chromatic That I honestly don't know. 10:46
I haven't read that code with that use case in mind.
sorear I guess I'll have to test it when my project is more advanced then
chromatic That one's tricky. 10:47
sorear easy to test though
chromatic You have to cross the C barrier backwards, with an exception at the PIR level.
sorear just put it in an infinite loop, with a small stack rlimit, and leave it running for a month 10:48
*minute
what a typo
purl rumour has it a typo is a bitch to run
sorear Is the PIR level the same as the HLL level in this context?
chromatic allison or Tene should know better.
Yes, it's effectively the same.
sorear goody 10:49
sorear is mucking around with perl5/parrot binding
chromatic Yes, I'm interested to see that working. 10:50
sorear so am I 10:53
I wanted to use perl5 from perl6, johnathan said he needed a perl5 guts expert, no knowledge of Parrot required, hey I fit the bill 10:54
chromatic Things shouldn't be too awful. See ext/Parrot-Embed/ in the Parrot source distribution for some starters. 10:55
sorear yeah, starters I need
mikehh All tests PASS (pre/post-config, make corevm/make coretest, smoke (#32648) at r44906 - Ubuntu 9.10 amd64 (g++ with --optimize) 11:00
sorear mm
interesting
though I want to do better :) 11:06
11:10 fperrad joined 11:37 payload joined 11:45 bacek joined 12:08 iblechbot joined
dalek izkost: e8b44cd | (Stefan O'Rear)++ | docs/SEMANTICS:
Add a design draft
12:25
sorear where do I tell dalek that I'm actually sorear 12:27
12:59 payload joined 13:16 Whiteknight joined 13:21 joeri joined 13:35 mikehh joined
dalek rrot-linear-algebra: c658172 | Whiteknight++ | t/pmc/nummatrix2d.t:
more updates for nummatrix2d.t. Still not complete
13:53
14:06 kid51 joined 14:24 payload joined 14:33 ruoso joined 15:31 TiMBuS joined
dalek kudo: a078e49 | masak++ | src/core/Any-str.pm:
[Any-str] format should be hexadecimal, not float
15:36
15:54 fperrad joined 16:14 theory joined 16:30 ash_ joined 16:44 dolmen joined 17:14 brooksbp joined 17:19 Patterner joined 17:22 brooksbp joined 17:25 tetragon joined
dalek izkost: 1dd01ce | (Stefan O'Rear)++ | docs/SEMANTICS:
Braindump insights on generic HLL protocol
17:40
17:40 bubaflub joined 17:57 chromatic joined 19:18 bacek joined
bacek ~~ 19:43
Morning
dalek kudo: 3ddd002 | jonathan++ | src/ (3 files):
Implement 'use MONKEY_TYPING'; augment and supersede are now forbidden without it. Infinitesimally small chance of entire works of Shakespeare being written as a side effect.
19:59
bacek msg cotto opsc now in same stage as before grammar changes - failing pct/complete_workflow. 20:28
purl Message for cotto stored.
dalek rrot: r44907 | bacek++ | branches/ops_pct/compilers/opsc/src/Ops/Compiler/Actions.pm:
Fix handling of 'restart NEXT'
rrot: r44908 | bacek++ | branches/ops_pct (2 files):
Use 'goto ADDRESS' in find_method. 'restart ADDRESS' is broken in trunk
20:38 payload joined 20:39 davidfetter joined
dukeleto 'ello 20:43
davidfetter oh hai
dalek rrot: r44909 | bacek++ | branches/ops_pct/compilers/opsc/TODO:
Update TODO.
20:44
mikehh bacek: ops_pct branch - make corevm/make coretest PASS, make test FAIL - t/compilers/pct/complete_workflow.t 20:54
still need to work on codetest 20:55
got a lot of it but problems with nqp files 20:57
and of course testing generated files 20:58
21:13 bubaflub joined
dalek tracwiki: v17 | dukeleto++ | AllHackathons 21:14
tracwiki: trac.parrot.org/parrot/wiki/AllHack...ction=diff
tracwiki: v1 | dukeleto++ | OpenSourceBridge2010Hackathon
tracwiki: trac.parrot.org/parrot/wiki/OpenSou...ction=diff
dukeleto cardinal? 21:17
purl rumour has it cardinal is mail.freesoftware.fsf.org/pipermail...dinal-dev/ or the Ruby-on-Parrot project. or xrl.us/uyz3
dukeleto languages?
purl somebody said languages was trac.parrot.org/parrot/wiki/Languages or icanhaz.com/parrotlang
dukeleto cardinal2.rubyforge.org/ is sorely out of date 21:18
Tene dukeleto: github.com/cardinal/cardinal/
bubaflub afternoon dukeleto
dukeleto bubaflub: howdy 21:20
purl hey, dukeleto.
dukeleto Tene: yes, but if you search for "cardinal parrot" on google, that link comes up first and the github link is nowhere to be found 21:21
Tene that's unfortunate
dukeleto Tene: yes 21:22
davidfetter any way to take that rubyforge link down? 21:23
Tene treed: SEO better!
davidfetter: maybe ask tewk...
tewk: any way to take cardinal2.rubyforge.org/ down, do you know? 21:24
davidfetter wonders whether mr. tew is around
treed Huh?
I SEO like shit.
Tene Exactly. 21:25
treed Actually. 21:26
I have time to work on shit now.
I probably should.
You needed test cases for exceptions and subclassing, yeah? 21:27
Tene treed: maybe we should work on Cardinal when I visit on Friday.
treed: Yeah. They work in the exceptions_refactor branch.
treed No tests yet? 21:28
By they you mean both?
Or just exceptions?
Tene Erm, what do you mean "both"? Subclassing works in general, it's just specific cases where it doesn't.
treed Subclassing Class? 21:29
Tene subclassable exceptions work in that branch.
No, that doesn't work anywhere.
treed Yeah.
Tene And afaik, it's not tested either.
treed That's what I was asking about.
Tene there's been some discussion on parrot-dev recently about how it might be mixed. 21:30
fixed.
But nobody's working on it yet.
treed I think I'm ready to abandon the has-a approach.
It's just too hard to work on.
Too many levels and directions of indirection to keep in my head at once.
dalek tracwiki: v2 | dukeleto++ | OpenSourceBridge2010Hackathon 21:31
tracwiki: trac.parrot.org/parrot/wiki/OpenSou...ction=diff
treed I'm not actually sure how to get at that branch. 21:38
Tene git checkout -b er exceptions_refactor 21:39
if using git
treed git svn
Tene svn co .../branches/exceptions_refactor
if using svn
Yeah.
treed k
Actually.
No, it is svn
purl okay, treed.
treed purl forgot it
purl treed: what?
treed purl forget it
purl treed: I forgot it
Tene purl: gdiaf 21:40
purl Tene: huh?
treed I really wish I knew how to fix this HD issue without buying a new HD.
I'm pretty certain it's just contention.
But it shouldn't be this bad.
Tene use ionice on the non-interactive disk-using apps? 21:41
treed OS X
I mean, I can't listen to music and browse the web at the same time without things stuttering. 21:42
Tene ouch
treed It didn't do this before.
Spotlight is completely disabled because it made things even worse. 21:43
May just need a new HD, but I also just want to replace the laptop wholesale.
I just need to save more.
chromatic msg whiteknight See r44911; I think we're very close. The interaction of :vtable and :method might not be quite right yet though. 21:58
purl Message for whiteknight stored.
21:58 hercynium joined
dalek rrot: r44910 | chromatic++ | branches/tt389_fix/src/pmc/pmcproxy.pmc:
[PMC] Tidied some code in PMCProxy; no functional changes.
22:06
rrot: r44911 | chromatic++ | branches/tt389_fix/src (4 files):
[OO] Made second stage class initialization create a PMCProxy for all intrinsic

fail, but this is closer to fixing TT #389.
dukeleto we have a hackathon planned for OSBridge: opensourcebridge.org/2010/wiki/Hack...Hackathons 22:19
dalek tracwiki: v3 | dukeleto++ | OpenSourceBridge2010Hackathon 22:20
tracwiki: trac.parrot.org/parrot/wiki/OpenSou...ction=diff
tracwiki: v1 | dukeleto++ | OSCON2010Perl6Hackathon
tracwiki: trac.parrot.org/parrot/wiki/OSCON20...ction=diff
kudo: 5ec16a7 | jonathan++ | src/core/ (4 files):
Get several more cases of smart-matching to work again.
22:34
kudo: 8edd6c9 | jonathan++ | t/spectest.data:
Turn five more test files on again.
22:34 kid51 joined
dalek rrot: r44912 | mikehh++ | branches/ops_pct/lib/Parrot/Ops2c/Utils.pm:
tidy up Utils.pm to conform to coding standards a bit more
22:38
rrot: r44913 | mikehh++ | failed to fetch changeset:
replace generated files
rrot: r44914 | mikehh++ | branches/ops_pct/lib/Parrot/Distribution.pm:
put core_ops files in exemptions
23:13
rrot: r44915 | mikehh++ | branches/ops_pct/t/codingstd/linelength.t:
put src/ops/core_ops.c in ignored files
23:29
kudo: 04102ca | jonathan++ | src/ (3 files):
Get $x.Foo::bar method syntax working again, minus a bug the version in alpha had.
23:38
kudo: 3282274 | jonathan++ | t/spectest.data:
Turn back on two inheritance related test files.
rrot: r44916 | mikehh++ | branches/ops_pct/compilers/opsc/src/Ops (2 files):
remove trailing spaces
23:45
23:58 kurahaupo joined