<@U0BA5R9KL> Why are you fixed on using JSR-223? W...
# scripting
a
@breandan Why are you fixed on using JSR-223? Why not use scripting engine directly, it gives much more flexibility.
i
Hi @altavir how would that look like. I am also looking for alternatives?
b
Simpler API and parity with other JVM scripting implementations, the goal is to compare apples to apples in a standard environment. Are you sure the JSR-223 API doesn’t just wrap the Kotlin scripting engine API? Seems to be the recommended approach https://stackoverflow.com/questions/44009515/dynamically-evaluating-templated-strings-in-kotlin/44009876#44009876 @h0tk3y?
h
The JSR-223 API was initially implemented for scripting support. The Kotlin scripting API appeared and stabilized much later and is a lot more advanced. Using the scripting API directly is a good approach.
b
I see, makes sense. Might want to update the artifacts or deprecate something to avoid similar confusion. Or maybe wrap the Scripting API with sensible default configurations for JSR-223 style evaluation. Hard to tell from the documentation which is preferred
1
e
Any concluding remarks on script compilation/evaluation times? Is using the Kotlin scripting host faster than using the JSR233 interface?
d
My experience is the kotlin scripting host is much faster and uses much less memory (10x-ish for both memory and overall load/compile/eval speed) then then JSR233 interface