Live data from Hacker News

Scala Native v0.1

scala-lang.org

91–100 of 254 posts

Re: Scala Native v0.1

#91
post #80
post #71

This will be huge for getting Scala running on AWS Lambda. The cold-start times for JVM apps is just ridiculous and makes Lambda/API gateway essentially unusable for anything written on the JVM.

Actually, there are people using Scala.js to run Scala on AWS lambda, precisely for that reason. * https://github.com/tptodorov/aws-lambda-scalajs * http://underscore.io/blog/posts/2016/03/21/serverless-scale-...

Sure, but it'd be nice not to have everything in the known universe depend on JavaScript.

Re: Scala Native v0.1

#92
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…

At the moment, there isn't direct support for multithreading [1], so I'm guessing it would be very difficult to run any of the common web servers or computing frameworks natively. It may be possible for libraries that have pluggable concurrency, for example by creating an `ExecutionContext` that wraps OS threads, but that's waaay beyond my pay grade.

[1] http://www.scala-native.org/en/latest/user/lang.html#lang

Re: Scala Native v0.1

#93

How do the compilation times compare to targeting the JVM?

There is roughly 1-2s (after sbt warm-up) penalty to perform compilation to native on iMac (Retina 5K, 27-inch, Late 2015) with 4 GHz Intel Core i7. The linker is highly parallel so you can throw more hardware at it as your project grows bigger. Barebones project includes nearly 1000 classes and 2000 methods in transitive dependencies that are being compiled due to closed-world nature of the toolchain.

Re: Scala Native v0.1

#94
> This opens the door for Scala to be used in environments where full-blown virtual machine is usually an overkill

Not sure if I get this, don't Java VMs support this use case (J2ME) ?

Re: Scala Native v0.1

#95

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…

In general (not for server apps), two major benefits of Scala Native are: - Predictable latency if desired (optional GC) - Very low call overhead for C ABI As to your point about memory use, Java trades memory for convenience, not performance. GC requires substantially more memory for similar performance. I read an IBM blog (which I can't find at the moment) within the last week which showed a Swift web service runni…

> Predictable latency if desired (optional GC)

Does Scala Native support not using a GC? It seems like it would be difficult to get Scala working without a GC.

Re: Scala Native v0.1

#96
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…

Don't forget the ability to distribute binaries. This could be really nice for in-house tools.

Re: Scala Native v0.1

#97

Earlier quoted context omitted.

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…

At the moment, there isn't direct support for multithreading [1], so I'm guessing it would be very difficult to run any of the common web servers or computing frameworks natively. It may be possible for libraries that have pluggable concurrency, for example by creating an `ExecutionContext` that wraps OS threads, but that's waaay beyond my pay grade. [1] http://www.scala-native.org/en/latest/user/lang.html#lang

Cheers - this is the #1 item on my excitement checklist.

Re: Scala Native v0.1

#100
post #74

Earlier quoted context omitted.

Define "wildly successful"... I can't name a single company or project that uses Scala.js.

There is a small list under "Built with Scala.js" here: https://www.scala-js.org/community/ . And that's only for the public facing apps of companies who have explicitly sent a PR to the website to add themselves to the list. Other companies use Scala.js for internal tools.

that's hardly 'wildly successful'
Post reply on HN