Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 15
    The JVM already has features that are intended to be implemented by languages other than Java. See: JVM Support for Non-Java Languages Commented Apr 26, 2015 at 13:42
  • 8
    I don't think every (valid) bytecode sequence can be produced from Java. Nor probably is this the case for scala. So this argument that the two languages are equivalent is not valid (although probably the are equivalent nevertheless) Commented Apr 26, 2015 at 13:44
  • @Marc Absolutely. For example goto (the bytecode) allows you to jump to any valid instruction offset in the same method, but javac would not generate code that jumps into the middle of a loop from outside since you can't express such a thing in Java. Some JITs exploit such properties to generate better code (not sure if HotSpot does too, I'd guess it'd need to fall back on interpreting methods that violate this #property). Commented Apr 26, 2015 at 16:40