Conversation
Notices
-
back in the day you could write a function that ends in a call to another function in the same module, and the compiler could optimize out the stack frame for that call
I don't think you can do that with metadata-rich managed code systems like Java or .NET
-
@coldacid i'm not sure if java or .net support tail call optimization, but i know for a fact that it is possible. source: BEAM does it and i programmed a VM with tail call optimization for java-like bytecode in uni.
-
@coldacid yeah, it's a runtime feature in these languages
-
@lain if you can't JMP into the middle of another function, you can't TCO. The JVM or CLR may support it, but the language compilers can't.