Live data from Hacker News

Scala Native v0.1

scala-lang.org

51–60 of 254 posts

Re: Scala Native v0.1

#51

Will macros work with Scala Native, as they do with ScalaJs? (I believe that compile-time metaprogramming is the way forward, especially if the target doesn't support reflection or dynamic code loading).

"We support the whole language including the more advanced features such as method dispatch via structural types and even macros."

Re: Scala Native v0.1

#53
post #44
post #43

Earlier quoted context omitted.

Easy interop with C++ or Rust? I'll believe it when I see it.

It looks like it can! http://www.scala-native.org/en/latest/user/interop.html >Scala Native provides an interop layer that makes it easy to interact with foreign native code. This includes C and other languages that can expose APIs via C ABI (e.g. C++, D, Rust etc.)

> languages that can expose APIs via C ABI

That's what I thought.. another C-based FFI. Better than nothing, I suppose.

Re: Scala Native v0.1

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

Servers very frequently benefit from lower memory footprints, as it can also dramatically improve performance by improving cache efficiency.

Re: Scala Native v0.1

#56
post #44
post #43

Earlier quoted context omitted.

Easy interop with C++ or Rust? I'll believe it when I see it.

It looks like it can! http://www.scala-native.org/en/latest/user/interop.html >Scala Native provides an interop layer that makes it easy to interact with foreign native code. This includes C and other languages that can expose APIs via C ABI (e.g. C++, D, Rust etc.)

From that page, it looks like Scala-C interop is decent, but that's a far cry from C++/Rust interop. For C++ at least, you more or less need to write a pure-C wrapper API to call from Scala, since it doesn't handle C++ types.

Re: Scala Native v0.1

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

The biggest benefit should be a powerful and expressive language, the biggest downside would be incompatibility with lots of existing (java-oriented) Scala code.

Re: Scala Native v0.1

#58
post #43
post #33

Earlier quoted context omitted.

Well, this is just targeting a different VM, LLVM instead of the JVM. You get easy interop with all LLVM languages with this, including C.

Easy interop with C++ or Rust? I'll believe it when I see it.

Nim has pretty decent interop with C++. In general, though, you are right that C is much much easier to interop with

Re: Scala Native v0.1

#59

Will macros work with Scala Native, as they do with ScalaJs? (I believe that compile-time metaprogramming is the way forward, especially if the target doesn't support reflection or dynamic code loading).

"We support the whole language including the more advanced features such as method dispatch via structural types and even macros."

D'oh, thanks! Can't believe I missed that.

Re: Scala Native v0.1

#60
post #44

Earlier quoted context omitted.

It looks like it can! http://www.scala-native.org/en/latest/user/interop.html >Scala Native provides an interop layer that makes it easy to interact with foreign native code. This includes C and other languages that can expose APIs via C ABI (e.g. C++, D, Rust etc.)

From that page, it looks like Scala-C interop is decent, but that's a far cry from C++/Rust interop. For C++ at least, you more or less need to write a pure-C wrapper API to call from Scala, since it doesn't handle C++ types.

You would need the same for Rust as well.
Post reply on HN