4 ms·
There is no need or reason to change or add any bytecode instructions to support proper tail calls. Take standard class files and execute them on a runtime wit
by happy_dino 14y ago
There is no need or reason to change or add any bytecode instructions to support proper tail calls.
Take standard class files and execute them on a runtime with proper tail calls. Done. Works.
- kragen 14y agoWhich JVMs support proper tail calls? Doesn't this violate requirements of the JRE?
- happy_dino 14y agoFor instance oss.readytalk.com/avian. Why should it?
- kragen 14y agoBecause the security manager needs to be able to introspect the stack. Avian isn't a JVM; it's "designed to provide a useful subset of Java's features" and can run some Java code.
- happy_dino 14y ago> Because the security manager needs to be able to introspect the stack. Not allowing certain “optimizations” in security-sensitive contexts is perfectly fine. In fact, this is exactly what Avian, the CLR (and pretty much everyone else) is doing. > Avian isn't a JVM; it's "designed to provide a useful subset of Java's features" and can run some Java code. Now you're talking about legal aspects. Frankly, I'm not interested in discussing those. Avian is a JVM for all practical purposes. If you disagree, please provide a test-case which runs on HotSpot but not on Avian.
- abecedarius 14y agoIt's actually possible to implement the stack inspection in a tail-call-friendly way (along the lines of Racket's continuation marks IIRC), though AFAIK nobody does it.