https://kotlinlang.org logo
a

altavir

01/07/2020, 8:04 AM
@breandan Why are you fixed on using JSR-223? Why not use scripting engine directly, it gives much more flexibility.
i

Imran/Malic

01/07/2020, 9:18 AM
Hi @altavir how would that look like. I am also looking for alternatives?
b

breandan

01/07/2020, 9:18 AM
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

h0tk3y

01/07/2020, 9:22 AM
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

breandan

01/07/2020, 9:30 AM
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

edwinRNDR

02/08/2020, 1:25 PM
Any concluding remarks on script compilation/evaluation times? Is using the Kotlin scripting host faster than using the JSR233 interface?
d

DALDEI

03/13/2020, 4:50 AM
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
5 Views