Coming from the other direction, I'd be very surprised if other JVM languages don't begin offering a solution based on invokedynamic once Java 8 adoption takes off.
Given that Oracle will be optimising the VM for this pattern in particular, the benefits in terms of size, performance, and interop are hard to ignore. On 2 October 2012 10:10, Matthew Farwell <[email protected]> wrote: > Is there any technical reason? Given that > > adding the option to create anonymous classes as well as invokedynamic > would certainly make the compiler more complex; > using invokedynamic will almost certainly be more efficient in terms of > .class files generated & probably execution; > and Oracle would probably want to push people to use the latest JVM (it is > 99% backward compatible after all) > > I see this as being a reasonable choice. But obviously, I don't know > anything :-) Of course, any particular compiler is free to implement > lambdas however it wants. > > Matthew Farwell. > > 2012/10/2 Andreas Petersson <[email protected]> > >> Am 02.10.2012 10:36, schrieb Fabrizio Giudici: >> >> >>> Definitely. Java is mostly backward compatible and I feel Java 8 will be >>> the first exception. >>> >> Is there any particular reason a java 8 compiler woudl be unable to emit >> bytecode (with a -target parameter) that is backwards-compatible? couldn't >> the compiler just emit anonymous classes instead of invokedynamic? >> >> -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
