Hacker News new | ask | show | jobs
by PyComfy 3049 days ago
Does Graal support tail call optimization? It has been announced for hotspot +10 years ago but still not implemented as today.

edit: https://blogs.oracle.com/jrose/tail-calls-in-the-vm

2 comments

When executing on Java we are dependent on hotspot to support it in the native bytecode interpreter. In truffle interpreters we made some successful experiments with tail calls emulated using exceptions. It's pretty slow in the interpreter but as soon as graal optimizes it, it just turns into a tailcall loop. Here is some more info: http://epub.jku.at/obvulihs/content/pageview/508465

You may find some blog posts about truffle and tailcalls as well.

You may see support for tail calls added as part of project loom.