Hi, I'm doing REPL work using the kotlin compiler ...
# scripting
l
Hi, I'm doing REPL work using the kotlin compiler API. By manually managed PlainEngine.kt, warmed up session could compile fast and make it possible to REPL. I'm kotlin newbie, hoping if anyone could review and discuss this idea and implemention details github.com/lolifamily/Minecraft-MCP
i
That's a very cool idea! But as far as I can see after some brief scanning of the source, you're using deep compiler internals in the
PlainEngine
. We guarantee no stability whatsoever for these parts, so your code will likely be breaking on every release. I highly recommend you to rather use this approach.
❤️ 1
l
I knew that but suggested ways are more buggy (ir/fir issues) than my plain engine, for example some implicit receivers bugs already fixed on my path but not this one), and suggested path locked friends options to previous one (I needs to make friends to all dependencies), and I don't want to keep previous val available to next script(can't assume one client per session and makes naming harder for a temporary script) My PlainEngine does use "internal" APIs because I need a managed session by myself, but the path is copied from what kts script (like Gradle configuration) evaluated so that bugs are fixed frequently and widely tested. I also suspect the scripting API doesn't have much effort to be maintained as it couldn't follow the fix of upstream issues. Yes I knew updating kotlin's version would require lots of effort checking and wrote this decision into comment but I do think it's more stable and usable