4 ms·
Apache Groovy (around v 1.0 or 1.5) used to produce bytecode that could easily be decompiled to Java code, but since version 1.6, the bytecode generated was cha
by vorg 10y ago
Apache Groovy (around v 1.0 or 1.5) used to produce bytecode that could easily be decompiled to Java code, but since version 1.6, the bytecode generated was changed so it couldn't be decompiled with the tool I was using at the time -- I forget what it was, could have been JAD. I know the JVM situation has changed a lot since then, but that breaking change was just one of those many little things that put people off using Groovy for anything more serious than quick'n'dirty scripting. I wouldn't imagine it would be easy to write a Groovy debugger if the bytecode generated is still so non-standard it can't be decompiled to Java source.
- eeperson 10y agoWhy would you need a decompiler to write a debugger for Groovy? The groovy compiler supports including source code line numbers and variable names in compiled jar files (just like Java). As a result you can use any Java debugger to debug Groovy. Also, why would you expect that Groovy can be compiled and then decompiled to Java? This doesn't even work 100% going from Java to Java, and Groovy is going to have idioms that doesn't map easily to Java idioms.
- vorg 10y ago> The groovy compiler supports including source code line numbers and variable names in compiled jar files I haven't used Groovy since v 1.8, and certainly didn't know about this facility then. > why would you expect that Groovy can be compiled and then decompiled to Java? It worked in Groovy 1.0, and the decompiles to Java were useful back then when Groovy often had unexpected behavior.