Questions tagged [scala-native]

32 questions
13
votes
1 answer

Building an iOS application with scala-native

I'm trying to build an iOS application on os x with scala-native and running into a number of problems when doing the sbt build. Any hints about what to do are welcome. I set build.sbt, using Xcode directories for iOS files, as follows: …
8
votes
2 answers

How do I build a statically linked executable with scala-native?

I would like to write a program using Scala Native but it has to run on a linux host (centos 6.5) with a very old glibc. So I would like to deploy that program as a statically linked executable, e.g. as golang does. How do I build a statically…
gruenewa
  • 1,666
  • 11
  • 16
8
votes
1 answer

Is it possible/useful to transpile Scala to golang?

Scala native has been recently released, but the garbage collector they used (for now) is extremely rudimentary and makes it not suitable for serious use. So I wonder: why not just transpile Scala to Go (a la Scala.js)? It's going to be a fast,…
sscarduzio
  • 5,938
  • 5
  • 42
  • 54
6
votes
2 answers

Can I run my scala program without JVM using scala-native?

I heard about scala-native recently and it sounds very interesting ! I'm curious about what does native means here ? what does "ahead-of-time compiler" means ? I think descriptions in the web site and github repository are not clear.
Mahdi Zareie
  • 713
  • 6
  • 19
5
votes
1 answer

Scala Native Thread & GC issues

Currently ScalaNative is single threaded. But we can used POSIX API (for example) to create and manage threads (ans also shared resources). My questions are related to the garbage collector: is it safe to use scala native and its default GC (immix)…
Davidd12
  • 71
  • 2
5
votes
2 answers

Using scala-native for in-memory data processing

I'm wondering whether it is possible to leverage scala-native for performing large in-memory jobs. For instance, imagine you have a spark job that needs 150GB of RAM so you'd have to run 5x30GB executors in a spark cluster since JVM garbage…
lisak
  • 21,611
  • 40
  • 152
  • 243
4
votes
3 answers

Can scala-native use existing Java/Scala libraries?

I have not been able to understand if a project intended to be compiled by scala-native can: Use Java libraries? If yes, does it make scala-native an ahead of time compiler for Java as well as Scala? Use Scala libraries (compiled to JVM…
user2759511
  • 640
  • 7
  • 16
3
votes
1 answer

How to access struct members by name in scala native?

From the scala native docs at https://scala-native.readthedocs.io/en/latest/ this is how to access struct members: type Vec = CStruct3[Double, Double, Double] val vec = stackalloc[Vec] // allocate c struct on stack vec._1 = 10.0 //…
user573215
  • 4,679
  • 5
  • 22
  • 25
3
votes
1 answer

sbt scala plugin from github PR (ScalaNative) fails with value not found

If I needed to use the stable release version, I would have my project/plugins.sbt as below: addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0") I am trying to use a specific version (a PR to be precise) of ScalaNative for my…
3
votes
1 answer

Can I compile a string containing Scala code to machine code using Scala Native as a library of my program?

I succeed compiling a scala project to machine code using Scala Native. But I want to generate some executable code at runtime (I plan to implement a standalone compiler from a scala-like language to machine code). The goal is to have a self-hosted…
dawid
  • 663
  • 6
  • 12
3
votes
1 answer

How to run Scala test in Scala native application?

I have hello world scala native app and wanted to run small scala test to this app I use the usual test command but it's throw an exception : NativeMain.scala object NativeMain { val p = new Person("xxxx") def main(args: Array[String]): Unit =…
NaseemMahasneh
  • 485
  • 5
  • 19
2
votes
0 answers

Is scala native garbage collector compatible with C interoperability?

I wonder when Zone or stack allocation are necessary when using C interoperability. For instance, if I call C function which takes function pointer, can I use any Scala function (with conversion to CFuncPtr)? Or must I use only Scala function with…
abitbol
  • 487
  • 4
  • 8
2
votes
1 answer

How to determine Scala version at run-time for both Scala.js and JVM?

This question is similar to How do I get the Scala version from within Scala itself?, except I want to support Scala.js as well. I tried the util.Properties approach. Unfortunately it is not available on…
Yang Bo
  • 3,586
  • 3
  • 22
  • 35
2
votes
2 answers

Can I use JavaFX with Scala Native?

Given that there are compiled versions of the JavaFX SDK for mobile (iOS and Android), how feasible is it to generate Scala bindings from those files, and be able use them from a Scala-Native application?
Eduardo
  • 8,362
  • 6
  • 38
  • 72
1
vote
1 answer

Is it possible to use libcu++ with scala-native for GPU programming?

I am trying to build a super-optimizer in scala native and to perform better I would like to have GPU support. is this possible with some GPU programming library for C or C++?
Lambda Banquo
  • 81
  • 1
  • 5
1
2 3