News for hackers. Stuff that matters.
Re:Notes on Virtual Threads and Clojure by funcDropShadow on Friday May 13, 2022 @11:07AM (#31368620)
E.g. Scala provides such an annotation, but that is implemented by rewriting the recursive method to a non-recursive method with a loop.
Re:Notes on Virtual Threads and Clojure by anamexis on Friday May 13, 2022 @12:15PM (#31369447)
Isn't that kinda how all TCO works?
Re:Notes on Virtual Threads and Clojure by pjmlp on Friday May 13, 2022 @12:50PM (#31369913)
First level TCO yes, however the annotation way doesn't work for mutually recursive calls.
Re:Notes on Virtual Threads and Clojure by jwesleyharding on Friday May 13, 2022 @01:00PM (#31370037)
to clarity just a tad, the Scala compiler does TCO out of the box and the annotation is added only to check that the method is in fact so optimizable
Re:Notes on Virtual Threads and Clojure by pjmlp on Friday May 13, 2022 @01:15PM (#31370223)
Unless something changed since 2.0.9 (last time I did anything relevant in Scala), only one level, it isn't clever enough to rewrite mutually recursive calls.

This is rather important, specially when coming from languages like Scheme that have TCO as part of the language specification compliance.