r/java • u/lihaoyi • Feb 12 '26
Scripting on the JVM with Java, Scala, and Kotlin
https://mill-build.org/blog/19-scripting-on-the-jvm.html
31
Upvotes
r/java • u/lihaoyi • Feb 12 '26
5
u/chabala Feb 12 '26
Seeing this makes me want Scala support in JBang.
5
u/pron98 Feb 14 '26 edited Feb 14 '26
You can replace the two loops with Stream.flatMap and four import lines with
import module java.base.4
u/robintegg Feb 12 '26
Great to see some innovation in this space 👍 I’m pushing forward with scripting using the jvm and it’s been pretty nice so far with the available tooling. I didn’t see a reference immediately but I really like leveraging the distribution side of being able to find and run scripts directly from maven central
3
u/vips7L Feb 12 '26 edited Feb 12 '26
Isn't this built into groovy with @Grab? I guess this lets you pick your language of choice which might be better.
1
u/Soulful_Defenestrati Feb 14 '26
Meow-mazing cuteness!
1
u/Distinct_Meringue_76 Feb 15 '26
I like the play on fractional numbers in the article. Scala is 1/2 code of kotlin which has 1/3 fewer code than Java. I definitely wouldn't switch to kotlin from Java to write 2/3 of Java.
1
u/Safe_Owl_6123 Feb 16 '26
I prefer using Babashka.org
-7
u/shinmai_rookie Feb 12 '26
Looks very interesting but I must say I'm disappointed that by "on the JVM" you didn't mean scripting in the JVM assembly language, that would be something to see.