4 ms·
> Clojure code calls into Java libraries, and these are regular Java functions so you cannot reuse the same stack frame for these. Somehow, programs written in
by catnaroek 9y ago
> Clojure code calls into Java libraries, and these are regular Java functions so you cannot reuse the same stack frame for these.
Somehow, programs written in <insert language that provides correctly implemented tail calls> can call routines written in C (of all languages!) without any problems. So I stand by what I previously said: the problem is political, not technical.
- pjmlp 9y agoThey do so, by having a FFI marshaling layer that creates a stack frame the way C expects it, which is in full control of the language runtime, something that languages that pretend to be Java cannot do on the JVM. Eventually one could do some tricks with invokedynamic, but I doubt the performance impact would be worthwhile.