Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 23 14:51
    sideeffffect commented #2616
  • May 23 12:13
    WojciechMazur labeled #2616
  • May 23 12:13
    WojciechMazur closed #2616
  • May 23 12:13
    WojciechMazur commented #2616
  • May 22 22:25
    sideeffffect opened #2616
  • May 19 14:41
    sideeffffect edited #2611
  • May 17 15:31
    fiatjaf commented #2615
  • May 17 14:54
    ekrich commented #2615
  • May 17 13:08
    fiatjaf closed #2615
  • May 17 13:07
    fiatjaf commented #2615
  • May 17 07:13
    fiatjaf commented #2615
  • May 17 00:39
    ekrich commented #2615
  • May 17 00:00
    fiatjaf opened #2615
  • May 16 23:54
    fiatjaf closed #2609
  • May 16 23:54
    fiatjaf commented #2609
  • May 16 18:42
    armanbilge opened #2614
  • May 16 17:45
    armanbilge opened #2613
  • May 16 15:25
    catap opened #2612
  • May 15 19:28
    sideeffffect edited #2611
  • May 15 19:20
    sideeffffect edited #2611
Eric K Richardson
@ekrich
Very cool 😎
ayush9999-qa
@ayush9999-qa
Hello, is there any tool to perform RTS (Regression test selection) for scala?
Lorenzo Gabriele
@lolgab
@ayush9999-qa I think you want to ask this question in discord's #scala-users channel. This channel is specific to the Scala Native project: https://scala-native.readthedocs.io
1 reply
Hanns Holger Rutz
@Sciss
quick question - is it possible to use SN on a Raspberry Pi Zero 2W ? "a quad-core 64-bit ARM Cortex-A53". Has only 512 MB RAM so a bit prohibitive for JVM
Erik Bruchez
@ebruchez
I don't have an authoritative answer but I don't see why not given the hardware specs. Even 32-bit support has been in the works for a while scala-native/scala-native#1571
daniel-s
@daniel-s
Is it possible to use gdb with Scala Native?
Wojciech Mazur
@WojciechMazur
Yes, and no. You can debug assembly, but it does not contain source code/variables etc. Symbols are only present in function calls/stacktrace
Eric K Richardson
@ekrich
@Sciss I have run Scala Native on Rasp PI 4 with 64 bit Ubuntu and also have made hello world work for the 32bit branch. In both these cases I used Java on the box to run sbt to compile and link. With only 512, I think you would have to cross compile on something else with more memory.
Hanns Holger Rutz
@Sciss
Ok, thanks; so I take away that it does work on 64-bit ARM without requiring an experimental branch of SN. Can you compile on the desktop for that arch even if your host system there is AMD 64?
Eric K Richardson
@ekrich
Yes, it work unchanged on 64 bit ARM. I have not cross compiled on AMD for ARM. We added the ability to provide the target triple but don't know how the rest of that process works - install the ARM includes and libs? If you can achieve this is would be great to add a How-to in the docs. All we have so far - https://scala-native.readthedocs.io/en/latest/user/sbt.html#cross-compilation-using-target-triple
Hanns Holger Rutz
@Sciss
ok, i'll try
Eric K Richardson
@ekrich
:thumbsup: Good luck.
Ghost
@ghost~61b216ac6da03739848c2eaf

Hi folks, I've probably tried something wrong: I wanted to apply Scala Native on a small Vert.x application. I get the error message (on MacOS):

[error] (Compile / nativeLink) java.lang.ClassCastException: class scala.scalanative.linker.Unavailable cannot be cast to class scala.scalanative.linker.ScopeInfo (scala.scalanative.linker.Unavailable and scala.scalanative.linker.ScopeInfo are in unnamed module of loader sbt.internal.PluginManagement$PluginClassLoader @41da3aee)

Is this something that should work? My impression so far is that Scala Native is for more basic applications.

Eric K Richardson
@ekrich
Hi @oliver-brm I am not sure exactly what you are trying to do - call Java code?
There is also a newer chat for Scala Native here - https://discord.gg/scala
We can continue here but most of the group follows over there for Scala.
Ghost
@ghost~61b216ac6da03739848c2eaf
Hi @ekrich, I was naively trying to use Scala Native just like GraalVM. But the more I understand what Scala Native is, the more I think I was on the wrong track, right? :-)
Eric K Richardson
@ekrich
@oliver-brm If you want to do Scala and have have native then either Scala/JVM with graal or Scala Native is the choice. What do you want to do exactly? Do you want to stay here or move to the Discord? I am glad to help you get started or answer questions.
Denys Shabalin
@densh
Hi all this is a gentle reminder that this chat room is deprecated and we should continue chatting on discord channel instead.
Tobias Roeser
@lefou
Please update the description of the chat room to indicate, this room is no longer active.
Denys Shabalin
@densh
Done.
Tobias Roeser
@lefou
:+1:
nrktkt
@nrktkt:matrix.org
[m]
For matrix users, we now have #scala-native:matrix.org which is (or will shortly be) bridged into the Scala Native Discord channel
nrktkt
@nrktkt:matrix.org
[m]
!discord bridge 632150470000902164 635668881951686686
Discord Bridge
@_discord_bot:t2bot.io
[m]
ERROR: insufficient permissions to use this command! Try !discord help to see all available commands
Ashkan Kh. Nazary
@ashkann

Hello everyone. How do I get access to a #define XXX in Scala ? the @extern , @name and other goodies work as long as it is a function but doesn't find the #defines :

@link("glfw")
@extern
object glfw {
  @name("GLFW_CLIENT_API")
  def CLIENT_API: CInt = extern

  @name("GLFW_NO_API")
  def NO_API: CInt = extern

  @name("glfwWindowHint")
  def windowHint(a: Unit, b: Unit): Unit = extern
}

finds the glfwWindowHint but not GLFW_CLIENT_API and GLFW_NO_API

[error] Undefined symbols for architecture x86_64:
[error]   "_GLFW_CLIENT_API", referenced from:
[error]       __SM5Main$D4mainLAL16java.lang.String_uEO in 2.ll.o
[error]   "_GLFW_NO_API", referenced from:
[error]       __SM5Main$D4mainLAL16java.lang.String_uEO in 2.ll.o
[error] ld: symbol(s) not found for architecture x86_64
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
Currently I don't think you can access defs directly.
You can write a forwarder function in C (that returns the constant), put it in src/main/resources/scala-native/ and then extern that in SN instead
Ashkan Kh. Nazary
@ashkann

looking into the src to see what scala-native does for its supported libs, I found this:

#include <math.h>

float scalanative_huge_valf() { return HUGE_VALF; }

double scalanative_huge_val() { return HUGE_VAL; }

float scalanative_infinity() { return INFINITY; }

float scalanative_nan() { return NAN; }

int scalanative_math_errhandling() { return math_errhandling; }

int scalanative_math_errno() { return MATH_ERRNO; }

int scalanative_math_errexcept() { return MATH_ERREXCEPT; }

Does this mean I'm basically out of luck :D ?

@velvetbaldmime:matrix.org yeah, apparently no way around it.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
Yeah, given that defs are inlined and not present in the linked code, SN has nothing to reference really
Ashkan Kh. Nazary
@ashkann
I can look at the value from C and define a val myself. I'm thinking pros/cons ...
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
I would use a forwarder function because of waves hands various #ifdefs for platforms/flags/compiler versions etc.
With a forwarder you don't have to worry that the value will go out of date if you link with different flags/on different platform
I'm writing a binding generator and the little knowledge I acquired suggests to me that I should not make any assumptions about the values of the constants in large libraries :D
1 reply
Ashkan Kh. Nazary
@ashkann
Yeah you are right. I just wasn't thinking straight for a moment. The dread of doing this for every #def I'm gonna use
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
Yeah it's pretty horrible, unfortunately. There are a few other gotchas with globals, which actually came up recently when David was trying to write a binding for sqlite, I think: indoorvivants/sn-bindgen#4

I had no idea that

/* Link global variable declared in global.c to this program */
extern int num1, num2;

was even a thing, so things like this probably need both setters and getters

Eric K Richardson
@ekrich
C has a flat namespace so lots of things are a bit weird.
Ashkan Kh. Nazary
@ashkann
global state is a dread on its own, with or without scala-native
Eric K Richardson
@ekrich
:100:
Stefanos Mandalas
@sealmove
Hi. I am playing around with c interop and I got stuck at the very beginning. The following code fails at compile time:
object Main {
  def main(args: Array[String]): Unit = {
    stdio.printf(c"a string: %s\n", c"the string")
  }
}
With diverging implicit expansion for type scala.scalanative.unsafe.Tag[T1]
Eric K Richardson
@ekrich
@sealmove Not many people here anymore as we moved to Discord. Hope you can join - https://discord.com/invite/scala
BracketMaster
@BracketMaster
Is there a way to run scala native without SBT?
João Costa
@jd557:matrix.org
[m]
There's mill and scala-cli
Srepfler Srdan
@schrepfler
can scala-native be used for something like Unreal engine?
Srepfler Srdan
@schrepfler
And did someone posted an article about using snunit and scala native recently, I seem to have lost that article.
Lorenzo Gabriele
@lolgab
This is the blog post :)
About the first one, if they offer a C api, why not? :)
Lorenzo Gabriele
@lolgab
Actually you might need to ability to create dynamic libraries which is not supported at the moment.