In our backends we use Kotlin Scripting quite exte...
# scripting
p
In our backends we use Kotlin Scripting quite extensively. Scripts are often not written by us. We wanted to add the capability of writing scripts via web editor since we wanted integrate this to our web solutions . We managed to do this with Kotlin Compiler Server (https://github.com/JetBrains/kotlin-compiler-server) like REST API and additional logic on top of Kotlin Playground (https://github.com/JetBrains/kotlin-playground). Currently we are using KJvmReplCompilerWithIdeServices with some additional indexes. This is working quite well for us. Based on the blog about Kotlin Scripting (https://blog.jetbrains.com/kotlin/2024/11/state-of-kotlin-scripting-2024/) KJvmReplCompilerWithIdeServices will stop working with Kotlin 2.3. My question is if your plan have changed and you plan to add this on top of K2. Do you maybe plan to add support for this in kotlin-lsp (https://github.com/Kotlin/kotlin-lsp) and if you do, do you maybe have any timelines for this feature.
amaze 3
v
cc @ilya.chernikov
m
I have this bookmarked: https://github.com/Kotlin/kotlin-jupyter/blob/eca3418a3e1246c187a4d4c6a4f5dd6d24fdc2a8/src/main/kotlin/org/jetbrains/kotlinx/jupyter/repl/impl/InternalEvaluatorImpl.kt#L106 As I said when the state of scripting dropped, either we get an analysis api backed by K2 that we can use, or kotlin jupyter becomes closed, absorbed into Kotlin Notebook. So … I’m waiting?
i
This is a question for the Kotlin Notebooks team (cc: @Ilya Muradyan); they are the authors and main users of the
KJvmReplCompilerWithIdeServices
. And I think this is the issue to watch.
❤️ 1
i
Hi! We're unfortunately not there yet: we still don't have K2 REPL in the stable-enough state that could just compile and execute snippets. Once it's done (and it's a question of months, I guess), we can think of providing basic completion and errors highlighting
👍 2
p
Thank you all for clarification. I now already have the two provided links bookmarked. Do you maybe have any insights if kotlin-lsp will support scripting?
i
I think there is a good chance that it will, since, afaik, it is based on the more general framework (Analysis API) that is used in the IntelliJ as well. And IntelliJ supports it. You will probably need some custom code to setup script dependencies and other parameters.
❤️ 1