ohnosequences / nice-sbt-settings

sbt plugin with common settings for all era7/ohnosequences releases
GNU Affero General Public License v3.0
10 stars 2 forks source link

make java version a setting #20

Closed eparejatobes closed 10 years ago

eparejatobes commented 10 years ago

we are migrating to Java 8 for some projects

laughedelic commented 10 years ago

ok. but what about scalac? there is no option -target:jvm-1.8...

evdokim commented 10 years ago

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..)

eparejatobes commented 10 years ago

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)

laughedelic commented 10 years ago

So? what is the summary here?

eparejatobes commented 10 years ago

http://www.scala-lang.org/news/2014/03/06/release-notes-2.11.0-RC1.html

evdokim commented 10 years ago

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..

eparejatobes commented 10 years ago

I only care about this

https://github.com/scala/scala/pull/2606

laughedelic commented 10 years ago

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.

eparejatobes commented 10 years ago

@evdokim by method handles you mean invokedynamic? or what?

evdokim commented 10 years ago

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.