as Rich Hickey stated

question: Is it fundamentally impossible to do TCO on JVM due to
current JVM lack of primitives to do so? Would TCO ever be possible on
the JVM without a new JVM design?
rhickey: TCO is easy if you are an interpreter - see SISC Scheme.
Using Java's call stack, the JVM would have to provide it. There are
no fundamental technical difficulties, but potential issues for the
security model, which uses the call stack to ensure privileges.

On Mon, Aug 2, 2010 at 10:16 PM, Dan Kersten <dkers...@gmail.com> wrote:
> Why can't the clojure bytecode compiler hand-perform this like
> functional languages do when compiling to native code? Is it to keep
> the clojure compiler fast (for dynamic runtime compilation), since
> performing tail call optimisation presumably requires a bunch of extra
> checks and more complex code generation? Perhaps this could be done on
> AOT compilation?
>
> On Aug 3, 2:58 am, Frederick Polgardy <f...@polgardy.com> wrote:
>> It means that the JVM doesn't look at method calls and figure out that 
>> they're in tail call position and optimize them. You can hand-write code 
>> that performs a goto in a tight loop (like recur does), but means you can't 
>> assume that method calls in general will be tail call optimized.
>>
>> -Fred
>>
>> --
>> Science answers questions; philosophy questions answers.
>>
>> On Aug 2, 2010, at 4:09 PM, Dale wrote:
>>
>> > The JVM has an unconditional goto opcode and the ability to re-bind
>> > function parameters, so why no tail-call optimization? Thanks.
>>
>> > Dale
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Clojure" group.
>> > To post to this group, send email to clojure@googlegroups.com
>> > Note that posts from new members are moderated - please be patient with 
>> > your first post.
>> > To unsubscribe from this group, send email to
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
Omnem crede diem tibi diluxisse supremum.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to