3 ms·
This also exists for Kotlin: https://github.com/Kotlin/kotlin-script-examples/blob/master/jvm/main-kts/MainKts.md https://github.com/Kotlin/kotlin-script-exampl
by occz 1y ago
This also exists for Kotlin: https://github.com/Kotlin/kotlin-script-examples/blob/master/jvm/main-kts/MainKts.md https://github.com/Kotlin/kotlin-script-examples/blob/master... (note that the file extension is load bearing in this case, if you don't name it "*.main.kts", it will not work).
It's excellent for writing small scripts/prototyping where you need access to some Kotlin/JVM feature.
Ruby is still my preferred language for small scripts though - the backticks for running external programs is remarkably ergonomic
- bitwize 1y agoI think it also exists for Java itself now.
- vips7L 1y agoYes. You can just run java myfile.java
- carstenhag 1y agoIt's not going away entirely, but its future is also not so shiny: https://blog.jetbrains.com/kotlin/2024/11/state-of-kotlin-scripting-2024/ https://blog.jetbrains.com/kotlin/2024/11/state-of-kotlin-sc...