3 ms·
Would native-compiled scala allow for some of the features that have been prevented by the need for Java semantic compatibility, like guaranteed tail call optim
by thinkpad20 11y ago
Would native-compiled scala allow for some of the features that have been prevented by the need for Java semantic compatibility, like guaranteed tail call optimization?
- densh 11y agoYes, especially talking about better tail call optimisation.
- duaneb 11y ago> like guaranteed tail call optimization? Isn't this what the @tailrec annotation is for? If it compiles it's tail recursive. This is separate than actually JIT'ing the call bytecode into a loop, I realize, but for a pragmatic engineer there's already a solution.
- densh 11y ago@tailrec works only for simple cases of tail recursion. For example it doesn't support mutual tail recursion at the moment.