Scala Native with Denys Shabalin – Software Engineering Daily Podcast
softwareengineeringdaily.com
softwareengineeringdaily.com
Based on the same principle as Scala Native, this one outputs javascript.
I've written a couple of projects where both the backend and front end is written in Scala, using one project, with different sub-projects for frontend/backend.
Scala.js will probably not convert Javascript developers en masse, but its very handy for Scala developers that prefer to write Scala to Javascript.
I do think Scala still has advantages: higher-kinded type support which OCaml and F# don't have, strict evaluation unlike Haskell, and better IDE/tool support than any except F#.
Besides ExcelsiorJET named in a sibling answer, the JDKs from Aicas, IBM, PTC, STMicroelectronics, Google with their ART implementation and a few smaller vendors for the embedded market.
Also Oracle just added initial AOT on Java 9, with plans to extend it to other platforms, and eventually (long term plan) rewrite everything in Java as part of Project Metropolis.
Oracle also had AOT compilers before Sun's acquisition, like JServe and JRockit.
Why does it seem no one does it?
Sun was religiously against AOT, leaving it to third party commercial vendors.
And since the rise of FOSS most developers think it is outrageous to pay for compilers, only Fortune 500s buy such compilers.
That, and "the JVM startup is slow!" seems to be a popular argument against Clojure and Scala here on the Intertubes.
One of the things that appeals to me about Scala Native is its interoperability with C, which I suspect is something that the LLVM Java frontend doesn't provide.
Native code is not much better as a compilation target for FP, but at least you don't have to fight through JVM constraints first (GHC compiles to pretty efficient native code).
Scala's JavaScript compiler (http://www.scala-js.org/) on the other hand is production ready and supported by the whole ecosystem, with plenty of libraries being cross-compiled to both the JVM and JS.
Scala Native piggybacks on top of the work made for Scala.js — it's harder, due to not being able to piggyback on another platform this time, so they have to deal with things like concurrency or garbage collection, but it's progressing nicely.
Scala Native isn't production quality yet, but it's at that stage where it's fun to play with it and the Gitter channel has some friendly folks you can interact with: https://gitter.im/scala-native/scala-native
The maturity of the eco-system.
Not having to deal with the borrow checker.
In any case, I would say in such cases OCaml and Haskell are also good candidates.
Scala, Haskell, OCaml are garbage collected languages. This makes them easier to use, but some problems are out of reach.
Embedded development, kernels, native apps requiring performance without frames dropped, real-time systems actually, including consumer stuff like decoding video, these have been the domain of C/C++.
Of course, there are projects out there using these languages, pushing the boundaries, like MirageOS (https://mirage.io/) which is built with OCaml. But those are like the exceptions confirming the rule.
The ongoing NLL work proves ergonomics are still not there, and it doesn't cover all scenarios like internal references as done typically for callbacks in GUI widgets.
It will surely improve, and the best thing for polyglot developers is that we can easily pick the best tool for the job.
I feel like if anything, Rust sounds more powerful to me, greater performance, control over memory, low level unsafe access, etc.