It's a very fast on-the-fly compiler. This means you get full speed.
Other JVM langauges (eg, Pnuts
) can compile to bytecodes on the fly. Of course, speed is going to vary depending on what the language is doing. I think you are saying that Janino compiled classes are exactly as fast as using bytecodes from javac?
It also means you can script full classes and it also means that you can replace them with compiled versions as soon as you're done with em.
I write Java classes using a standard Java IDE (Eclipse). If I change the Java source for a class and save the file, the IDE recompiles the class and (assuming my application is running) it uses Java HotSwap to patch the bytecodes for the class in the running application. I can't imagine Janino's workflow can be smoother than this?
IMO, the real benefit to use a JVM language other than Java-the-language is for added expressiveness. There is also the benefit of being able to load code at runtime, when an IDE is not present.
So far, the only argument I could accept for using Janino would be:
1) If you needed to compile Java source at runtime, with no IDE. But isn't there a JSR for this that made it into the JDK? Does Janino provide extra funcitonality?
2) If you absolutely needed the same speed as javac, and are willing to sacrifice expressiveness to get it. Then I wonder what the speed differences actually are in real world usage.