On Apr 10, 2010, at 3:01 PM, James Thorpe wrote:
> If CPS is out - what about passing the loop condition and body into a
> function that does the looping for you.
http://blogs.sun.com/jrose/resource/jsr292/LoopHandle.zip -- John
___
mlvm-dev mailing
If CPS is out - what about passing the loop condition and body into a
function that does the looping for you.
in pseudo code
defn loop_fn(cond, body)
while (cond()) do
body()
end
end
this avoids the need for tail calls entirely - and I presume the whole
lot
With tail calling, it would certainly be possible. I think the
tradeoff would be accepting that you wouldn't be able to completely
compose a body of code in one shot; somewhere downstream you'd have to
defer a decision like whether to exit the loop or not. That would
probably mean slicing the nativ
This idea is a real gem!
Would it not be possible to remove the need for a looping handle by a
CPS conversion?
James.
On 10/04/2010, at 5:00 AM, [email protected] wrote:
>
> I ask because I still have a perverse desire to follow up on an idea
> John Rose gave me to implement
nto handles something like this:
GuardWithTest
..InvokeDynamic "foo" # condition
VariableLookup "a"
..InvokeDynamic "+" # then
VariableLookup "b"
VariableLookup "c"
..InvokeDynamic "bar # else
And because direct method handles get composed toge
Charles Oliver Nutter wrote:
> I ask because I still have a perverse desire to follow up on an idea
> John Rose gave me to implement JRuby's interpreter entirely with
> MethodHandles...with the obvious result being that by simply composing
> a set of handles they'll already be compiled to native co
Yes, that thought crossed my mind. If tail calling were there, the
only missing piece would be allowing a downstream handle (toward the
target) to be able to be rebound to an upstream handle. Currently
handles are a one-way street.
On Fri, Apr 9, 2010 at 2:20 AM, Emmanuel Castro
wrote:
> Maybe th
Maybe there is no need to have a special handle for loops if there is an
(hidden?) support for tail call in method handles ;-)
I remind me a blog page from John Rose:
http://blogs.sun.com/jrose/entry/tailcalls_meet_invokedynamic
There is questioning about putting coroutine in Java7. Will Java7 inc
It occurred to me today I may have never asked about this, but why is
there no looping handle? (or have I missed something?)
loopHandle(MethodHandle condition, MethodHandle body)
In the current set of handles, I don't believe there's a way to
construct a loop, since you can only link handles upwa