I've abandoned the jvm, but I found Scala much better designed than Kotlin. Things in Kotlin felt consistently ad hoc and I would frequently run into weird special casing whereas Scala actually had general principles that could be applied to more use cases.
Kotlin on the other hand had better IDE support in intellij for obvious reasons. That was not nearly compelling enough for me.
Also, see my comment about kotlin scripting (kts) elsewhere in this thread.
But, in short, you can write kts shell scripts; import any library you want, use anything in the JVM or the Kotlin or Java library ecosystem that you need, etc.
Works on the command line (you need a jvm and kotlin installed from your favorite package manager). The Kotlin Jupyter kernel also uses kts and this is a nice way to use Java stuff in jupyter.
- Top-level functions/main is supported
- data classes are approximately as good as records
- A scripting mode comes built in, and can use annotations to import and use dependencies within the same file
- There's a repl
- The keyword 'var' exists, and the keyword 'val' is more ergonomic than 'final var'
The only thing I remember missing from the article is the implicit imports which I don't remember Kotlin having. Regardless, I'd reach for Kotlin every time. I think funnily enough Java never fully clicked for me until I started using Kotlin, which in many ways is "Java, except many best practices are on by default".