I just discovered Kotlin and think it may fill a need I have. Groovy has the ability (essentially) to load a Groovy source file into a Java Class object and then execute it via getMethod/invoke - all at runtime. (I understand it compiles it to JVM code on the fly.) This is imprtant to me for two reasons:
1. My system has 15,000 classes. It takes a while to boot, and it takes a lot of memory to run even though one particular user may only use a small subset of its functionality. By dynamically loading the classes I need as I need them, I can speed boot time and only have to load the classes that are actually being used. This saves time and very important memory.
2. This is a production web app. Using the dynamic loading I can cause the system (when I choose) to re-load the source (re-compile the source file into JIT JVM code) file while the system is running. This allows me to modify a running system (without have to reboot the server).
(I know I can compile the Kotlin to a class file, hide the class file from the boot, dynamically load the class file when needed, and even reload it - but I’d still rather (essentially) load the source instead.)
I have Groovy doing this just fine, but I am curious about using Kotlin. Kotlin may have things I am interested in.