2 ms·
Interestingly, Scala has a great solution to this, namely Scala-CLI[0]. You can do all the things... use whatever deps you want, pick the scala version, include
by Quekid5 3y ago
Interestingly, Scala has a great solution to this, namely Scala-CLI[0]. You can do all the things... use whatever deps you want, pick the scala version, include tests in your script, etc. etc. So you can really have a self-contained scripts. (You'll need to have Scala-CLI installed, obviously, but they're working on a 'bundle-a-script-into-a-jar' thing so you'll only need a JRE.)
The dependencies thing is due to Maven repositories being The Repository standard for JVM languages. It's a low-key superpower of the JVM ecosystem, warts and all.
[0] https://scala-cli.virtuslab.org/ https://scala-cli.virtuslab.org/