Live data from Hacker News

Scala Native v0.1

scala-lang.org

21–30 of 254 posts

Re: Scala Native v0.1

#21
post #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.

Please drop by our gitter chatroom [1] and we'll try to debug the issue together. It's likely some sort of environment misconfiguration.

[1] https://gitter.im/scala-native/scala-native

Re: Scala Native v0.1

#22

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…

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.

In the age of containers it's really not that much harder to build and deploy a JVM app.

Edit: thanks for the downvotes but you could at least tell me what's so crazy about my statement.

Re: Scala Native v0.1

#23
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.

Rust's is almost the exact same size (3.46 MB). It's probably just that the libraries that are statically linked by default (jemalloc, std, etc.).

Re: Scala Native v0.1

#24
Nice work, I hope this will eventually be a serious alternative to the JVM route.

Quick question: does this compile down to DOT before going to LLVM? Or has DOT not yet arrived in Scala Native?

Re: Scala Native v0.1

#26
post #17

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…

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

True, and if you wouldn't have to worry about Oracle licensing either (although you can avoid that currently with OpenJDK as well)

Re: Scala Native v0.1

#27
post #8

Somewhat relevant: https://blog.plan99.net/kotlin-native-310ffac94af2#.ijzik0jx... Title says Kotlin, but it is about JVM languages going native, in general. Or should they?

They should. The article basically throws in some FUD to convince people that they don't want what they think they want. Except, we do want it! The JVM ecosystem's general aversion to native code and native system integration is what gave C# the opportunity to take over as the closest thing we have to a WORA language. If I want to write code in a higher-level language than C++ that can run on any mobile device or desktop OS, I do it in C#, not Java.

The Java ecosystem is playing huge catch up here, and I don't think it's a bad thing that people are exploring alternatives, whether that's Avian, the now defunct RoboVM, or LLVM-based backends.

Re: Scala Native v0.1

#28
post #24

Nice work, I hope this will eventually be a serious alternative to the JVM route. Quick question: does this compile down to DOT before going to LLVM? Or has DOT not yet arrived in Scala Native?

DOT [1] is a theoretical calculus that is used as a foundation for our latest front-end compiler called dotty [2]. Scala Native is mostly a middle-end technology that bridges front-end compiler and LLVM. We plan to support dotty as a front-end in the future. 0.1 release is based on older Scala 2.11 front-end.

[1] http://www.scala-lang.org/blog/2016/02/03/essence-of-scala.h...

[2] https://github.com/lampepfl/dotty

Re: Scala Native v0.1

#29
It seems to me like Scala's biggest benefit and biggest downside are two sides of the same coin: easy interop with the JVM and Java code. Scala Native just seems like you're paying all the price of that for none of the benefit.

Re: Scala Native v0.1

#30
Important bit: "The project has reached a point of feature completeness in terms of the coverage of the Scala language. We support the whole language including the more advanced features such as method dispatch via structural types and even macros."

It must be frustrating to work on a project like this, see areas where the language can be improved, but only be able to do the work to make it purely compatible. Hopefully some good comes out in the form of some good SIPs.

Post reply on HN