functional programming - Opt-in tail call support in the JVM on a per-language base? -
while doesn't tail call optimization ever added common optimization technique, after sun bought, wouldn't technically possible let languages running on vm decide if compiler emits tailcall
instructions in byte code?
e. g. java, groovy can decide not use instruction, while more functional languages scala or clojure can emit , hotspot vm optimize ones marked tailcall
?
yes, technically possible -- in fact there experimental patch arnold schwaighofer openjdk that, although isn't easy apply patch , build, isn't kept date @ present.
an explicit tail call instruction has advantages on transparent optimisation of function calls in tail position jvm, jvm can verify have specified tail call see tail call blog post john rose explanation of of verification can done.
i think future of jvm not java, , hope time , talent pushes tail calls jvm forward.
Comments
Post a Comment