Supppose I have kotlin product and I want to make parts of it scriptable by users run time. Could I load strings as kotlin script runtime, pass them objects and have them do something to those objects and return another object? Neither security or performance is important, but of course nice to have.
d
Dico
02/13/2020, 12:05 PM
You should be able to add the kotlin compiler as a dependency and get it to compile the script, then use a classloader to load its output. Assuming jvm.
Dico
02/13/2020, 12:05 PM
You can also use jdk's nashorn scripting engine
Dico
02/13/2020, 12:06 PM
Which compiles and evaluates javascript
Dico
02/13/2020, 12:07 PM
And there's jython, a python to java bytecode compiler.
Dico
02/13/2020, 12:07 PM
You may also consider graalvm
Dico
02/13/2020, 12:08 PM
I am not an expert in any of these but just some directions.