3 ms·
How does it achieve full tail call elimination and csp while compiling to java bytecode?
by divs1210 6y ago
How does it achieve full tail call elimination and csp while compiling to java bytecode?
- tw25513397 6y agoPure speculation on my part (since I couldn't find any details either): their "Closed world assumption" and "No reflection" principles [1] could mean the compiler can output radically different bytecode, e.g., eliminating the tail call by eliminating the "call" altogether. That said, I might be wrong given that the FAQ [2] notes that tail call elimination "has some run-time performance cost"; maybe they're baking in a trampoline. [1] https://flix.dev/principles/ https://flix.dev/principles/ [2] https://flix.dev/faq/ https://flix.dev/faq/
- jorkadeen 6y agoAt the moment it uses a technique called "Impure Functional Objects" - which are a form of reusable stack frames. In the future we may switch to trampolines and eventually if Project Loom succeeds we will try to use whatever infrastructure they come up with. (I am one of the authors of Flix)
- divs1210 6y agointeresting, thanks!
- coldtea 6y agoDon't trampolines allow TCO in any language?