Is it possible to use Kotlin Scripting as a way to...
# scripting
d
Is it possible to use Kotlin Scripting as a way to allow extending a C++ program? For example, if I were to create a game engine in C++, and wanted to enable Kotlin scripting, would there be an easy way to do that?
e
it should be possible insofar as Kotlin scripting can be embedded in a Java application and Java can be embedded in a C++ program, but you probably need to know how to do both those things
d
I would rather not pull in the JRE for it. I was thinking more along the lines of Kotlin Native.
e
Kotlin scripting is JVM only
👍 1
d
Okay, that answers my question then 😉
m
No idea how much effort is required. Probably not trivial
j
I'm thinking of writing a Kotlin IR runtime with implementations in graalvm/truffle + KMP right now for a similar use case. Although my game engine is also written in Kotlin.
d
I've also been playing with creating an engine in Kotlin (using LWJGL as a base). This does make it JVM dependent though.