Live data from Hacker News

Scala Native v0.1

scala-lang.org

11–20 of 254 posts

Re: Scala Native v0.1

#11
post #3

That's a great news ! We are exclusively using scala at work for back end and I wonder if it could be interesting to switch new projects to scala native. Did you test scala native against well known and massive open source scala project ? Did the performance improved or regress ? Did you wrote a brand new scala compiler for native code ?

Never touch a running system ;) Scala on JVM is much more tested than the new shiny thing. Also don't expect improved performance... many people think that the JVM is bloated and makes programs slower (this is mostly not true). The downsides of the JVM are more memory consumption/footprint (when you have e.g. small servers or micro instances) and the cold startup time of the JVM itself (which is not relevant on a ser…

Long time Java lover here. I agree with all your points, but in the context of Java at least (does Scala support this?) there is no simple static binary that can be built and released, which includes the JVM. I think 1.9 will have this option, but this is something I didn't realize I missed until I started work with Rust and Go. It makes deployment so much simpler.

Re: Scala Native v0.1

#12
post #3

That's a great news ! We are exclusively using scala at work for back end and I wonder if it could be interesting to switch new projects to scala native. Did you test scala native against well known and massive open source scala project ? Did the performance improved or regress ? Did you wrote a brand new scala compiler for native code ?

I think for Server-Application Scala on the JVM will probably beat Scala-Native. The benefits of Scala-Native over Scala JVM are: - faster startup time - (drastically) lower memory footprint - fine hand-tuning of you application All these things are not super important in server-applications. For example Java trades memory for throughput (higher memory footprint, but also higher throughput. These usually go hand in h…

But can be important if you only have a 512MB DigitalOcean instance or using small Linux containers/Docker.

Re: Scala Native v0.1

#13
The generated binary for simple Hello World is 3.45 MB which is quite a lot for printing one line of text but it can be compressed to 326K using UPX.

Re: Scala Native v0.1

#14

Earlier quoted context omitted.

I think for Server-Application Scala on the JVM will probably beat Scala-Native. The benefits of Scala-Native over Scala JVM are: - faster startup time - (drastically) lower memory footprint - fine hand-tuning of you application All these things are not super important in server-applications. For example Java trades memory for throughput (higher memory footprint, but also higher throughput. These usually go hand in h…

But can be important if you only have a 512MB DigitalOcean instance or using small Linux containers/Docker.

I used the JVM on the 512MB DO instances and containers and they run fine. I think for containers there are other issues (most likely you are going in a micro service-direction where latency is eventually going to be important, so picking another JVM GC-algorithm might be suitable). There may be applications for which the 512 instances and JVM are not suitable, but you can most likely just upgrade the instance.

Re: Scala Native v0.1

#16

Earlier quoted context omitted.

I think for Server-Application Scala on the JVM will probably beat Scala-Native. The benefits of Scala-Native over Scala JVM are: - faster startup time - (drastically) lower memory footprint - fine hand-tuning of you application All these things are not super important in server-applications. For example Java trades memory for throughput (higher memory footprint, but also higher throughput. These usually go hand in h…

But can be important if you only have a 512MB DigitalOcean instance or using small Linux containers/Docker.

The JVM itself doesn't add a huge memory footprint. I remember Charles Nutter of JRuby fame calling it the "20-30 MB memory tax" (see http://blog.headius.com/2008/11/noise-cancelling.html).

A lot of the extra memory usage of Java apps comes from sloppy programming and from depending on lots of heavyweight libraries and frameworks.

Re: Scala Native v0.1

#17
post #3

That's a great news ! We are exclusively using scala at work for back end and I wonder if it could be interesting to switch new projects to scala native. Did you test scala native against well known and massive open source scala project ? Did the performance improved or regress ? Did you wrote a brand new scala compiler for native code ?

I think for Server-Application Scala on the JVM will probably beat Scala-Native. The benefits of Scala-Native over Scala JVM are: - faster startup time - (drastically) lower memory footprint - fine hand-tuning of you application All these things are not super important in server-applications. For example Java trades memory for throughput (higher memory footprint, but also higher throughput. These usually go hand in h…

For me most important benefit is running without pre-installed VM. Not particularly important for backend, but huge win for user-space tools.

Re: Scala Native v0.1

#18
post #13

The generated binary for simple Hello World is 3.45 MB which is quite a lot for printing one line of text but it can be compressed to 326K using UPX.

All of our binary size problems are mostly caused by a single well-known issue [1]. We hope to address that in one of the future releases. In the meanwhile, compressing binaries with upx is a temporary solution that can alleviate some of the pain.

[1] https://github.com/scala-native/scala-native/issues/180

Re: Scala Native v0.1

#20
I can't get hello_world to work, something about a unresolved dependency: org.scala-native#sbt-Scalia-native;0.1.0: not found

I'm not a regular Scala user.

Post reply on HN