Closed eparejatobes closed 10 years ago
ok. but what about scalac? there is no option -target:jvm-1.8
...
there are no changes in bytecode in Java8, so it means that target for javac will be the same 1.7. The sources key can be safely changed to 1.8 because it has to be compatible with 1.7.
About scalac I don't know, it seams they steel didn't implement full support for target 1.7 (closures with methods handles..)
From Scala the only thing that we need to worry about is being able to read Java 1.8 sources, which if I remember well is in 2.10.4 (maybe 2.10.3 too? or it was 2.11?)
About Java, @evdokim of course they will be compatible from the Java side, but the source is definitely not backwards-compatible (public default
etc)
So? what is the summary here?
I was wrong they released new target (bytecode version 52), but I still don't why... scalac have to switch to method handlers at some point, because they are much faster, I think that they are working on it..
I only care about this
Ok. So I will set the default scalaVersion
to 2.10.4
and for these java-8 projects you can switch it to 2.11.0-RC1
in sbt config.
@evdokim by method handles you mean invokedynamic
? or what?
I mean this: http://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandle.html Java 8 closures are implemented by using method mandles, invoke dynamic and other stuff. Honestly I don't know a lot about it, but it should be much faster than anonymous classes.
we are migrating to Java 8 for some projects