News for hackers. Stuff that matters.
Re:Show HN: Tail Recursion Optimization for the JVM by Gollapalli on Wednesday April 22, 2020 @01:30PM (#22948041)
This is exciting. I'm guessing since it applies to bytecode it works for clojure as well? That would mean we'll be able to use (func (when cond function)) instead of (loop [] (recur)).
Re:Show HN: Tail Recursion Optimization for the JVM by hencq on Wednesday April 22, 2020 @02:14PM (#22948510)
The use of recur in Clojure is by design. It would have been quite trivial to optimize this type of self recursion, but since it doesn't do general tail call optimization, they introduced the recur keyword. See also [1]. By the way, you don't need to use loop in Clojure either, it also works with functions.

[1]. https://clojure.org/about/functional_programming#_recursive_...

Re:Show HN: Tail Recursion Optimization for the JVM by Scarbutt on Wednesday April 22, 2020 @04:12PM (#22949684)
This library just does self-calls, doesn't optimize(and can't cause of JVM limitations) calls to others functions (mutual recursion).
Re:Show HN: Tail Recursion Optimization for the JVM by sipkab on Wednesday April 22, 2020 @01:54PM (#22948281)
It works on bytecode, so yes, it should apply to all JVM based languages. (Though I haven't done tests for them)