-
-
Notifications
You must be signed in to change notification settings - Fork 114
Add Kotlin Lang #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1 |
+1 |
This repo demonstrates performance issues I encountered that prevent adding Kotlin: I plan to raise an issue with the Kotlin developers with this example code. |
I have created an issue with the developers. Perhaps they will be able to help. |
The K2 compiler might be faster, it's currently in beta, and going to be stable in 2.0. |
Should be easy enough to try it with this:
|
I cloned https://github.com/SirBogman/kotlinc-startup-too-slow and updated the Dockerfile to try the new Kotlin compiler:
Image was not building because libjansi.so was not found, so I removed this line:
to make the build succeed. Sadly, it's still slow. ./run-hello
./run-hello-sandbox
|
Can't we allow longer run times (10 seconds) for the languages Scala and Kotlin? I'm really a fan of golfing Kotlin, but sadly we still pass Kotlin Playground links around to compete with eachother. |
at least the sandbox version isn't slower anymore, the code.golf server is pretty fast, so maybe it could work I just tried Kotlin Playground, and it doesn't seem slow |
@SirBogman what's your thoughts, can I help in any way to get Kotlin on code.golf? |
It kind of looks like the overall startup speed got a little bit slower (5 sec now). However, it's nice to see that there no longer seems to be a sandbox-specific penalty. And overall it's faster now, since the penalty is gone, even with it being a little bit slower without the penalty. We could potentially consider allowing Kotlin a longer time to run, for example 10 seconds, however I would be very concerned that it would be a bad user experience. I know five seconds doesn't sound like a long time, but when you are waiting to test your solution (and see if it passes in 5 seconds), it can feel like an eternity. I don't know how others feel about that. I think the way that the devs recommend we do this is that we have a compiler service that keeps running. That's probably what Kotlin Playground does and IDEs do this as well. But we are worried that will be hard to maintain and it's different from all other languages. I don't know if there are any ways to optimize it more, for example removing any libraries that aren't relevant for code golf. |
I'm not sure if that is as bad as you think. People usually develop the code in an IDE or play.kotlin.org, it's not like the 10 second execution time will be a part of the dev cycle for golfers. I agree it's a bad user experience but it's better than nothing and it won't be as frequent like I said. |
Yes I would personally code in IntelliJ IDEA and copy-paste my code into code-golf editor to see if it passes all the test cases. It's better than nothing. |
Well if @JRaspass is OK with it, we could try to add Kotlin with a 10 second timeout (assuming that 5 seconds is the baseline that it takes to run anything). I think a lot of the work could be ported easily from the test repo. I also have a change in one of my local copies that adds Kotlin and perhaps we could start with that. |
When I first wrote it, the minimum runtime was 15 seconds, which was unreasonable IMO. |
@JRaspass what do you think? |
I think special casing Kotlin for 10s sounds fine, certainly for getting it onto the site in an experimental status. So if someone wants to put together a PR, be my guest! |
I can try to take a quick look later today. |
Ok I made a lot of progress but it's not fully working. Rock-paper-scissors-Spock-lizard doesn't seem to run. Perhaps it has something to do with the arguments. I didn't test all holes. |
* Add Kotlin language, with a little extra time to run. See issue #151 * Review feedback and fix timeout.
Thanks guys to all of you! |
* Add Kotlin language, with a little extra time to run. See issue code-golf#151 * Review feedback and fix timeout.
Alongside the addition of Java and a JVM container, this lang should be straightforward.
The text was updated successfully, but these errors were encountered: