início

Scala is such a great language

Scala is amazing. The type system has the perfect balance between flexibility and powerfulness. match statements are great. You can write imperative code that looks very nice and expressive (and I haven’t tried writing purely functional things yet). Everything is easy to write and cheap and neovim integration works great.

But Java is not great. And the fact that Scala is a JVM language doesn’t help because over the years people have written stuff that depends on Java libraries – and these Java libraries are not as safe as the Scala libraries, they contain reflection, slowness, runtime errors, all kinds of horrors.

Scala is also very tightly associated with Akka, the actor framework, and Akka is a giant collection of anti-patterns. Untyped stuff, reflection, dependency on JVM, basically a lot of javisms. I just arrived and I don’t know anything about the Scala history or ecosystem or community, but I have the impression that Akka has prevent more adoption of Scala from decent people that aren’t Java programmers.

But luckily there is a solution – or two solutions: ScalaJS is a great thing that exists. It transpiles Scala code into JavaScript and it runs on NodeJS or in a browser!

Scala Native is a much better deal, though, it compiles to LLVM and then to binary code and you can have single binaries that run directly without a JVM – not that the single JARs are that bad though, they are great and everybody has Java so I’ll take that anytime over C libraries or NPM-distributed software, but direct executables even better. Scala Native just needs a little more love and some libraries and it will be the greatest thing in a couple of years.

This article on Nostr

naddr1qqyrzc33vv6nxefeqyghwumn8ghj7enfv96x5ctx9e3k7mgzyqalp33lewf5vdq847t6te0wvnags0gs0mu72kz8938tn24wlfze6qcyqqq823czqe977