I am experimenting a bit with Type Safe Builders in Kotlin. Now I have gotten the HML example to output by using the following.
val dsl = File("example.kts").readText()
val manager = ScriptEngineManager()
val engine = manager.getEngineByExtension("kts")
val html = engine.eval(dsl).toString()
Is this the right approach at all for running this from Kotlin?
If so, is there a way to make this work in Kotlin Multiplatform/Native, specifically when combining with Objective-C? (The ScriptEngine comes from a JVM dependency).
If not, what is the right way?