I have a need to have many source files that get compiled in memory and run at runtime. I am successfully doing this with Groovy, but I am toying with the idea of switching to Kotlin. From Jave, it would look something like this:
KotlinClass MyClass = new KotlinClass("MyClass.kotlin");
Method meth = MyClass.getMethod("myMethod", signature...);
So, the text file MyClass.kotlin contains the Kotlin source code to the class I wish to use. I get a pointer to the method I seek in the class and execute it. The ‘new KotlinClass(“MyClass.kotlin”)’ reads the source text, compiles it in memory, does not save it to a file, and returns a KotlinClass object which allows further use of the class.
If the answer is yes, I have a number of other questions regarding threads and re-loading.