5 ms·
In my mind, GraalVM native compilation has superseded scala-native. GraalVM native compilation works really well. Many projects will compile to native out of t
by spir 6y ago
In my mind, GraalVM native compilation has superseded scala-native.
GraalVM native compilation works really well. Many projects will compile to native out of the box. Many more with a bit of reflection config that's autogenerated. The native executables are slim, statically linked so they "just work", and startup instantly as one would expect.
Scala is now a great choice for CLI tools.
- vbezhenar 6y ago> The native executables are slim What's the size of hello_world.exe?
- LandR 6y agoDunno about Scala, but Clojure - another JVM language, has a GraalVM native executable for Hello WOrld about 8MB. Not that slim.
- vips7L 6y agoHow does that compare to similar languages? (Go, Nim, D, etc).
- kbd 6y agoFor reference: $ \cat hellogo.go package main import "fmt" func main() { fmt.Println("hello") } $ go build hellogo.go $ \cat hellonim.nim echo "hello" $ nim c hellonim.nim ... $ ll total 2.2M -rwxr-xr-x 1 kbd staff 2.1M Apr 11 20:55 hellogo* -rw-r--r-- 1 kbd staff 66 Apr 11 20:42 hellogo.go -rwxr-xr-x 1 kbd staff 87K Apr 11 20:55 hellonim* -rw-r--r-- 1 kbd staff 13 Apr 11 20:29 hellonim.nim Keep in mind these are the default compilation settings.
- zmmmmm 6y agoNot too bad if it's truly statically linked though ...
- abhijat 6y agoAre they statically linked by default now? Last I looked (a couple of months ago) the executable produced linked dynamically but there was a flag to link statically.
- vips7L 6y agoNative image works well without dependencies. I tried to get Weld and other JEE deps running in a smaller project and it was foot gun after footgun. I'm hoping in the future the native-image friction can be lowered, but as of now it's not trivial like other languages.
- tutanchamun 6y ago> statically linked so they "just work" If I remember correctly you have to redistribute some .dll (VC something) file alongside your .exe on Windows since fresh Windows installations don't have the .dll. Did that change?
- spir 6y agoI haven't tried GraalVM native-image on Windows :(