Could anyone out there point me to the updated doc...
# scripting
m
Could anyone out there point me to the updated document/tutorial describing how to compose and run kotlin script with package dependency management? I heard that somehow Kotlin can download (or use cached) jar-libraries given their gradle-like names and put those into classpath of the script.
m
So, Kotlin scripting now is on that stage, there user is supposed to create a tool to use scripts by themselves, right? I thought it could be possible to just create a *.kts file with dependencies marked by annotations, and
kotlinc
would make its magic on the fly.
@ilya.chernikov ^
i
@max sorry for the delay with the answer, I have some busy days now. Well, yes and no. You can craft a command line to the existing compiler jar that will do all the magic, but this is not an easy way. Our understanding right now that kotlin scripts are more useful for embedding into some infrastructure, and we providing tools for it now with some possibilities for customization. See for example
gradle-script-kotlin
or
kotlin-jupyter
. And default scripts are remaining lean and do not prescribe additional resolving mechanisms and do not require heavy dependencies, like maven artifacts handling. We may change default script behaviour in the future or may be add some pre-made tools for typical scenarios, but first we need to understand these scenarios and demands better. So, we’ll be glad to hear more about your scenario in particular.
m
@ilya.chernikov My scenario is pretty simple. I want to replace some of my python scripts with kotlin scripts. Being able to quickly change something without explicit recompiling is a huge benefit. In order to represent complex logic it would be cool to have such mechanism as
Grape
in Groovy.
s
@max i had added this issue which is fairly similar to what you are requesting for. it would be good to have your comment on that issue! https://youtrack.jetbrains.com/oauth?state=%2FissueMobile%2FKT-15266
@ilya.chernikov I would like to mention that there is keen interest to use kotlin as a full blown scripting language.. which needs a script based dependency management framework. I believe there is a clear path ahead based on other programming languages (that i mentioned in the bug). it would be good to see aome discussions around that!
m
Voted for this issue