is it possible to add a dependency on some library...
# kotlin-website
p
is it possible to add a dependency on some library in https://play.kotlinlang.org/?
rubber duck technique FTW, just found https://github.com/JetBrains/kotlin-playground/issues/119
v
Or https://github.com/JetBrains/kotlin-playground/issues/109, then you could hopefully use
@Depends
But yes, we think alike, I checked the same when reading the other thread 🙂
You could also request external dependency support and
.main.kts
support from JDoodle. They have Kotlin support but also only for normal Kotlin files and without dependencies. For Java they support defining external dependencies and for Groovy they added Grapes support (same as
@Depend
just for Groovy) after I requested it. I checked back half a year later and then it was available.
p
that’s cool! for Kotlin Playground, I imagine it would drastically change the architecture because you couldn’t have a single “warm” instance of the complier anymore
v
🤷
n
Hi there! Thanks for the question. Yep, unfortunately, it is not possible to do so now. However, we are considering this option and would like to add at least some limited list of popular libraries that can be imported (e.g., kotlinx.serialization). I can’t provide any ETA, but the Playground will become the main focus for our team in the second half of the year.
imagine it would drastically change the architecture because you couldn’t have a single “warm” instance of the complier anymore
It is not a problem since the new Compiler Server was implemented a couple of years ago. It is just a Lambda function in AWS that instancing for each user request.
e
any news on this? Is forking the kotlin-compiler-server still the only way to go right now?
n
Hi, Giuseppe. Unfortunately, there are no updates related to dependency management. Let me ask you: what library would you like to import?
e
custom ones
will forking the kotlin-compiler-server work for my scopes?
n
It is hard to say without details, but generally, it is feasible.
146 Views