(no title)
sideeffffect | 11 months ago
If Clojure and Rust work well for you, more power to you. But at least in theory, you could very well use just Scala for these purposes
Scala can compile to JS https://www.scala-js.org/ if you target frontend.
And if you want portability, you can compile a Scala program with GraalVM's native-image and statically link everything with musl libc https://www.graalvm.org/latest/reference-manual/native-image...
And if you want both frontend and portability everywhere, Scala will soon have a support for compiling to WASM (with WASI, etc) https://github.com/scala-wasm/scala-wasm/ (to be integrated into Scala.js after developed)
crustycoder|11 months ago
Getting the musl stuff to work can be tricky, mostly-static (only libc dynamically linked) is an easier option.
I've built a CLI diagnostics app with Scala & NativeImage and I've embedded the Graal Python interpreter inside it to allow extension scripts to be written. The result is a zero-install executable that provides an n entire Python environment. I think that's a good showcase for one of Scala's strengths, it's interoperability with the Java ecosystem.
dmos62|11 months ago
crustycoder|11 months ago
The main issue is if you are using reflection, which needs metadata adding to describe it so the necessary metadata is included in the image. Some libraries already have it built in, and there are tools to help.
For building, https://github.com/sbt/sbt-assembly supports native Image.
znpy|11 months ago
According to https://www.graalvm.org/latest/introduction/#licensing-and-s... the community edition is free software (GPLv2 + classpath exception).
But it isn't really clear what the differences are between the free software version and the proprietary version.
There does not seem to be a page detailing the differences between the two (or at least I couldn't find it)
sideeffffect|11 months ago
But the AOT compilation (native-image) is available in the GPL community variant.