https://kotlinlang.org logo
Title
n

Nick Halase

07/31/2019, 6:21 PM
Does Kotlin have anything currently or in the works along the lines of GroovyShell?
m

Mark Murphy

07/31/2019, 6:24 PM
Do you mean running Kotlin scripts from the command line? If so,
.kts
files, run via
kotlinc -script
, offer that. If you mean "be able to run Kotlin scripts from within your program", Kotlin/JVM supports the JSR-223 APIs, both to run scripts and to have Kotlin itself run as a script. See https://kotlinexpertise.com/run-kotlin-scripts-from-kotlin-programs/ for some material on this. And, if neither of those are what you meant... could you explain a bit more about what you need? 😅
🙂 2
👍 1
j

jw

07/31/2019, 6:25 PM
Running
kotlinc
will also dump you into a
jshell
-like interactive session
n

Nick Halase

07/31/2019, 6:26 PM
The JSR-223 bit is what I was looking for! Thanks, that's awesome news.
r

Ruckus

07/31/2019, 6:27 PM
@Nick Halase In that case, check out #scripting
n

Nick Halase

07/31/2019, 6:28 PM
Perfect. I didn't know that channel was a thing.
c

cedric

07/31/2019, 6:57 PM
@Nick Halase Something like https://github.com/cbeust/kash maybe?
:kotlin-flag: 1
👍 2