Live data from Hacker News

Scala on LLVM

greedy.github.io

31–40 of 41 posts

Re: Scala on LLVM

#31
post #14
post #13

This may sound ridiculous, but I am literally sick of Java/JVM land. I would beg for native Scala backend (and it would be my first choice for doing pretty much every thing).I don't know people does share this opinion or not ,but I literally hate JVM.Slow Start up.Tremendously slow/unresponsive java app(I am talking about big apps, like android studio). Ridiculously bad font handling in Swing(there is no way to disab…

Well in my experience for heaps greater than 10-12GB server side Java apps can have long and unpredictable GC pauses. As for desktop apps I do not think many will share your opinion ,mainly because in large enterprises such as where I work, Java app not freezing every single time it is invoked would be considered a great experience.

It's very likely that Scala native will also be garbage collected. I don't think you will see improvements in gc pauses. JVM GCs have been tuned for years, so it will be an achievement to beat them.

Aside: Shenendoah was supposed to be an improvement over existing GCs in pause times, but it's not yet ready if it's alive and it's for very big heaps and when you want low latency over performance/throughput.

Re: Scala on LLVM

#32
post #15

This is a cool direction. Other than previous Scala knowledge, what are some advantages of using some sort of scala-native over Rust? I've used Scala and I always imagined that I'd use Rust if I wanted something similar without the ecosystem of JVM libraries.

I think D is closer to Scala than Rust is. D's metaprogramming is quite a bit more advanced than Rust and it has opt-in garbage collection. The type system isn't advanced like Rust, let alone Scala, but it mostly gets the job done. It's like C and Scala had a remarkably pleasant child.

Re: Scala on LLVM

#33

Apart from startup times, would this really be faster than the JVM? I don't know how the LLVM runtime stacks up - I'm guessing that there are a few targets eg traits that might be more efficient to implement in native code as Scala would be trying to work around what exists in the JVM and Java Bytecode but I have a feeling that it would be very specific use cases like embedded systems that would be considering LLVM a…

Actually you could already do it today.

RoboVM uses LLVM and quite a few People were using Scala with it.

As "the JVM" there are plenty to choose from.

Embedded vendors do have implementations that run with a few hundred KBs or 1-2 MB depending on the use case.

I would say it is just yet another implementation.

Personally I find healthy that languages have multiple implementations, specially since it clears the confusion between language and implementation.

Re: Scala on LLVM

#34
post #28
post #26

Earlier quoted context omitted.

What's the GUI story like for those other languages? I don't think I've ever seen a GUI program in Haskell. I've seen a few OCaml programs that use GTK and they don't look great (admittedly better than Swing, but worse than JavaFX IMO).

To be honest, I don't know. I've done very little frontend programming in the last decade. I've no idea about Scala for the GUI either. I'd be willing to learn how to write GUIs in any language. PS: I see that Leksah ( http://leksah.org/ ), a Haskell IDE, is written in Haskell using GTK. The screenshots look decent enough. Not sure if it's unpleasant to write a GUI app like that in Haskell.

ScalaFX is poorly documented but it's a joy to use, at least for simple stuff - I haven't made an IDE in it or anything.

Re: Scala on LLVM

#36
post #35

How about compile speed. I found Scala compiled much slower than Java.

Java's type system is barely doing anything for you in comparison with what Scala does. Higher kinded types, implicit parameters, implicit conversions and type inference are not free. The type level tools that libraries like Shapeless use let you do type checks that are unimaginable in the java compiler.

Guess what: The more work a compiler is doing, the slower it's going to run. Comparing Java and Scala compilation is like comparing the gas mileage of an 18 wheeler truck and a small city car. Guess what? The 18 wheeler won't do 30 mpg.

Re: Scala on LLVM

#37
post #36
post #35

How about compile speed. I found Scala compiled much slower than Java.

Java's type system is barely doing anything for you in comparison with what Scala does. Higher kinded types, implicit parameters, implicit conversions and type inference are not free. The type level tools that libraries like Shapeless use let you do type checks that are unimaginable in the java compiler. Guess what: The more work a compiler is doing, the slower it's going to run. Comparing Java and Scala compilation…

The scala type system is incredibly strong (and undecidable) but the implementation itself is not conducive to compilation speed. Two of the primary motivations for Dotty are 1) reducing the complexity of the language and 2) starting clean slate on a more reasonable compiler.

Im of the opinion that most groups don't want the complexity that scala brings, and we're going to see that in the community growing around spark. The databricks style guide clearly avoids a lot the complexity of the language, and the people who are coming to scala for the tech and not the language are going to follow their lead.

Re: Scala on LLVM

#38
post #13

This may sound ridiculous, but I am literally sick of Java/JVM land. I would beg for native Scala backend (and it would be my first choice for doing pretty much every thing).I don't know people does share this opinion or not ,but I literally hate JVM.Slow Start up.Tremendously slow/unresponsive java app(I am talking about big apps, like android studio). Ridiculously bad font handling in Swing(there is no way to disab…

Not ridiculous; I'm with you.* I think that Scala is a solid, relatively modern language and that the Java ecosystem is bonkers. Something like Scala-the-language + Go-like tooling and deployment would make my day. (Maybe what I'm describing is Rust, which I admit I haven't taken more than a cursory look at even though I think it's interesting.) *Assuming my agreement lowers the probability of being ridiculous, which…

Could you elaborate on what parts of go-like tooling you like? I also find it interesting given that golang is a much simpler language specifically to allow for the kinds of automated tooling they have. If you want that, then the complexity of scala is going to have to decrease.

Re: Scala on LLVM

#39
post #13

This may sound ridiculous, but I am literally sick of Java/JVM land. I would beg for native Scala backend (and it would be my first choice for doing pretty much every thing).I don't know people does share this opinion or not ,but I literally hate JVM.Slow Start up.Tremendously slow/unresponsive java app(I am talking about big apps, like android studio). Ridiculously bad font handling in Swing(there is no way to disab…

Not ridiculous; I'm with you.* I think that Scala is a solid, relatively modern language and that the Java ecosystem is bonkers. Something like Scala-the-language + Go-like tooling and deployment would make my day. (Maybe what I'm describing is Rust, which I admit I haven't taken more than a cursory look at even though I think it's interesting.) *Assuming my agreement lowers the probability of being ridiculous, which…

[deleted]

Re: Scala on LLVM

#40
post #36
post #35

How about compile speed. I found Scala compiled much slower than Java.

Java's type system is barely doing anything for you in comparison with what Scala does. Higher kinded types, implicit parameters, implicit conversions and type inference are not free. The type level tools that libraries like Shapeless use let you do type checks that are unimaginable in the java compiler. Guess what: The more work a compiler is doing, the slower it's going to run. Comparing Java and Scala compilation…

I agree the Scala compiler has more to do. (Although Java now does type inference.) But I'm like any user: greedy. I want it all and I want it fast ;)
Post reply on HN