Hacker News new | ask | show | jobs
by johnnycerberus 2110 days ago
I think we can do better than Java, Scala and Kotlin. All of these ended up to be piles of abstractions and complexity. Scala went too hardcore for somebody that just wants to deliver. Kotlin gives you anxiety everytime they push for supporting a new platform. Java, though it is still nice, has accumulated too much cruft during the years. I wish for a Go-like language on the JVM. A modern language that offers you a minimum number of features from which you can build upon. Moreover, lower, well-thought out abstractions would give a boost in perfomance with the new garbage collectors that have been added in the JVM. I can imagine Clojure is something that I would like to try again sometimes, but the fact that it is a LISP and lacks even simple types make it less attractive to the majority of devs. Also, Clojure wouldn't be my choice for high-perfomance if I want to do mostly imperative stuff.
3 comments

Scala is perfect for just delivering, myself and my business partner have been using it to rapidly prototype and build for a decade now. You just avoid all the stuff that tries to make scala into haskell and use it as the hybrid OO/functional language is was designed as.
You're lucky that you can do that kind of work. I've been working for a state company in Bulgaria and we had to maintain some Scala pipelines built with Apache Spark some years ago. It wasn't a pleasant experience, just a sea of vars/vals and cases of reinventing the wheel only to use some functional constructs when it could be simply done in Java by just adding a dependency that has already solved that problem like 10 years ago. It wasn't even some complicated logic in that, just calling different APIs and playing with dataframes, but the fact that they hid from me so much behavior only to reduce verbosity gave me some stressful days.
Any partitular reason scala was chosen? Spark has Python and Java API's as well.
Why not use that java dependency in scala?
Culture it seems.

Functional style is cool and some people will go to great lengths to use it.

Like shaving a few characters of a perfectly fine piece of code by using currying and instead make one single long line of code describing it.

Guest language syndrome. All libraries must be idiomatic instead of reusing the platform language based libraries.
Exactly that.
Use Groovy.
+1 to Groovy.

Can be very simple and elegant, like a better Python, on the JVM.

But also very rigorous, as a Java superset, with powerful features like mixing dynamic and static compilation in the same class.

Or even deep, with run-time metaprogramming and compile-time AST manipulation capabilities (giving tools like Gradle, Spock...).

And you have of course multiline interpolated Strings. And so much.

I've been using Groovy extensively to script and automate inside of Jenkins, and hoo boy it's actually kinda nice.

My absolute favorite thing is being able to do something like:

    someIntegerCollection = someStringCollection*.toInteger()
I also find the use of closures for things like collection filtering to be quite nice:

    canadianUsers = someUserCollection.findAll { user ->
      user.countryCode = "CA"
    }
The equivalent in Python is a little more cumbersome and overly verbose:

    canadianUsers = [user for user in someUserCollection if user.countrycode = "CA"]
I'll still be writing things in Python whenever I can, but when I do write in Groovy there's a lot of nice stuff I get to have.
And if you need it, static typing is one annotation away... This is such an underestimated feature. While prototyping it might be easier to use dynamic typing, but once a project becomes complex and has more people working on it etc, - you might want to switch it to statically-typed. Groovy simplifies this immensely and minimizes the amount of code that needs to rewritten.
I guess that is the stack behind the great Aviato? Groovy from back to front.
I'd be good with TypeScript running on the JVM, even.