3 ms·
There's no TCO in many languages, even proudly functional ones like Clojure, so that doesn't seem to be as make-or-break as you and I would have expected. (Cloj
by tines 5y ago
There's no TCO in many languages, even proudly functional ones like Clojure, so that doesn't seem to be as make-or-break as you and I would have expected. (Clojure does have recur though, but it doesn't help for mutual recursion.)
- sitkack 5y agoClojure has no TCO so it can interop with Java. It is the last language I would bring up as evidence. https://clojure.org/about/functional_programming https://clojure.org/about/functional_programming
- tines 5y agoI don't think it matters why; the fact is that it's a popular "functional" language that doesn't support (full) TCO.
- thayne 5y agofwiw, scala has some limited TCO, and it also runs on the JVM
- e12e 5y agoKotlin has explicit tail-calls via tailrec: https://kotlinlang.org/docs/functions.html#tail-recursive-functions https://kotlinlang.org/docs/functions.html#tail-recursive-fu...
- tines 5y agoLooks like the equivalent of Clojure's `recur`. Unfortunately doesn't work for mutually recursive routines.