If the binary was not compatible it couldn’t be executed by the JVM.
Executive Transvestite
1

All bytecode will run on the JVM. The difference is that the compiled bytecode generated by Groovy is not binary compatible with Java or Kotlin.

Groovy and other languages compile to bytecode that no valid Java could ever produce, such as:

  • overloading methods based only on the return type (valid in bytecode, not in Java)
  • use of invokedynamic (which was added specifically for scripting language support, and used by JRuby long before Javac ever emitted the instruction)
  • goto/jumps, as used by Scala’s encoding of tail-recursive functions

Hence, instrumentation libs that work in Java will work just fine in Kotlin but miserably fail in Groovy or Scala unless they are prepared to work around it.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.