Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Previous Scala versions emitted version 49.0 of the byte code, which corresponded to Java 5. With Scala 2.10 version <a href="http://www.scala-lang.org/node/43#2.10.0">the default was changed to version 50.0</a>, corresponding to Java 6 and which has the principal advantage of activating the faster verifier introduced with that version, so it should lead to (slightly) better run time performance.</p> <p>As you note, with 2.10 it became possible to emit version 51.0 byte code, which corresponds to Java 7. There are a few differences between version 50.0 and version 51.0: the biggest is the inclusion of the <code>invokedynamic</code> instruction, with the plumbing that goes with it (see <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html">the class file format definition</a> for the gory details).</p> <p>As far as Scala usage of the 51.0 byte code goes, even though the technical parts are in place it is my understanding that work is still at an experimental stage in using this feature. See <a href="http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2012Q4/2012-11-04-FasterClosures.pdf">this EPFL presentation</a> and <a href="http://thread.gmane.org/gmane.comp.lang.scala.internals/14411">this thread</a> which shows that the team is working on getting the performance benefits of method handles without having to introduce a dependency on Java 7.</p> <p>Scala 2.11 maintained the default of emitting version 50.0 bytecode, but the <a href="http://www.scala-lang.org/news/2.12-roadmap">official plan</a> is now to jump straight to Java 8 bytecode with Scala 2.12. In the meantime, there is a <a href="http://magarciaepfl.github.io/scala/">new back-end</a> available for Scala 2.11 that will let you try out <a href="http://thread.gmane.org/gmane.comp.lang.scala.internals/16941">some of the features</a> that are being prototyped for Scala 2.12, and which will become the default back-end with Scala 2.12.</p> <p>Anyway, the long-awaited proposed benefits all come from using the <code>invokedynamic</code> bytecode (and its associated MethodHandle structures). They include:</p> <ul> <li><a href="http://thread.gmane.org/gmane.comp.lang.scala.internals/15435">reducing code size and execution time for closures</a></li> <li><a href="http://thread.gmane.org/gmane.comp.lang.scala.internals/9397">improving specialization of generic datatypes</a></li> <li><a href="http://thread.gmane.org/gmane.comp.lang.scala.user/61476">potentially faster structural types</a></li> </ul> <p>(Spoiler: Using <code>MethodHandles</code> to implement closures in the experimental backend is currently <em>slower</em> than the present optimised closure creation!)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload