Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:43
    ekrich commented #1738
  • Mar 29 15:19
    lolgab commented on 5fc1189
  • Mar 29 13:53
    lolgab synchronize #1744
  • Mar 29 13:52
    lolgab synchronize #1744
  • Mar 29 13:12
    lolgab opened #1744
  • Mar 27 22:11
    ekrich commented on 5fc1189
  • Mar 27 19:28
    lolgab commented on 5fc1189
  • Mar 27 17:50
    ekrich commented on 5fc1189
  • Mar 26 17:39
    lolgab synchronize #1738
  • Mar 26 16:30
    lolgab synchronize #1743
  • Mar 26 15:59
    ekrich commented #1743
  • Mar 26 15:03
    lolgab synchronize #1738
  • Mar 26 15:01
    lolgab synchronize #1743
  • Mar 26 10:17
    lolgab synchronize #1743
  • Mar 26 10:08
    lolgab synchronize #1743
  • Mar 26 09:56
    lolgab synchronize #1743
  • Mar 26 09:34
    lolgab opened #1743
  • Mar 25 22:23
    ekrich commented #1738
  • Mar 25 21:35
    lolgab opened #1742
  • Mar 25 20:33
    lolgab commented #1738
Ergys Dona
@errikos
now that I think about it, no, I haven't had it, I would have noticed
LeeTibbert
@LeeTibbert
@errikos Thank you for the confirmation. Good data points. It has been a while since my last PR (clang-10). I do not
remember the error then, but I tend to go blind to 'known errors' in my pursuit of the main issue I am working on,
tunnel vision. I'll see how Travis likes the formatting of my current PR (whose content passes all the other automated checks). Never a dull moment.
LeeTibbert
@LeeTibbert
Travis CI source-checks run for my current PR is successful now. The state exploded error shows up in the log.
Looks like the issues are either un-correlated or, at most, loosely correlated.
LeeTibbert
@LeeTibbert
@ekrich looks like your pending PR #1714 may fix this.
I have been following your PR but had forgotten the details. Before I refreshed my memory, I had done a quick
Eric K Richardson
@ekrich
@LeeTibbert @errikos Yes, the state exploded error which is really a warning has been there for a long time.
LeeTibbert
@LeeTibbert

'crash & burn' test of the current scalafmt 2.4.2 (the one you now have in your PR). The error disappeared. I also got
no differences from git (puzzling, given what you say in the PR).

So, sounds like I should skip this error until after your PR is merged. Good, I am looking for a reason to be happy!
(and have plenty of other work to do).

@ekrich Thank you for the info. Community memory saves a lot of wasted time.
Eric K Richardson
@ekrich
This is still an issue somewhat but the code may be able to be fixed too - workaround may be possible too or refactoring. scalameta/scalafmt#1527
LeeTibbert
@LeeTibbert
Given the mixture of issue that SN faces, ranging from huge to minuscule, given your information and the fact that this
issue seems to not kill Travis, I would rate this one at the annoying & perfection-marring tiny end. Certainly it is not
important enough for me to get over my fear of even reading, no less touching, nscplugin, coward that I am.
I'm glad that you are tracking this at some level.
James Cosford
@jamescosford
So using scala native can I create a library for use on ios ?
kerr
@hepin1989
@jamescosford It's currently not supported
can not generate a so
kerr
@hepin1989
will scalafmt and scalafix compile with scalanative runtime?
LeeTibbert
@LeeTibbert
@hepin1989 Last I tried it, maybe two months or so back, scalafmt compiled & ran reasonably, but not entirely, correctly. At that time, I think it needed some SN bits pertaining to the build from my private directory. I do not know if scalafmt has changed its build environment to have those. At that time, looked like they had heavily modified to support JVM Graal.

I've never tried scalafix with SN because I never got it to work with JVM. Probably lack of investment of time (or lack of mother wit) on my part.

Please let the community know what you discover. Thanks,

kerr
@hepin1989
@LeeTibbert take easy:) that will takes so many times. thanks for that information
Lorenzo Gabriele
@lolgab
Hi @teodimoff, I wanted to inform you that I have a WIP PR on Scalaui where Hello world and some other examples work :) lolgab/scalaui#3
Hope I can finish the update and merge/release it :)
Teodor Dimov
@teodimoff
@lolgab Great ! thank you for investing the time.
James Cosford
@jamescosford
@hepin1989 thanks for the response :)
sken
@sken77
so i have a c lib i wanted to make bindings for
i was going to do jni, but seems like people frown against it. i have a bit of experience with jni, but i was ocnsidering using scala native
what is the interop between scala native and the jvm?
Lorenzo Gabriele
@lolgab

Question for the SN team: Is it possible/doable to have literals and compile time conversions to unsigned integer types? I gave a look to scala-native/scala-native#519 and I tried modifying the various generator files Tag.scala.gyb but it's very inconvenient to work with unsigned integer at the moment. For example you can't pattern match:

unsigned match {
  case 1.toUInt =>
}

Is it possible to automatically consider integer literals unsigned when the value is positive?

Sébastien Doeraene
@sjrd
No, that's not possible. It would require modifying the typer, which is big no-no.
Lorenzo Gabriele
@lolgab
Thank you for the answer. Is the current way the best we can get in term of unsigned representation?
Sébastien Doeraene
@sjrd
Probably, yes.
Unsigned integers are there for interop. Once you move away from an interop layer, turn them ASAP into something else. Don't try too hard to extensively manipulate uints.
Lorenzo Gabriele
@lolgab
I'm asking this because trying to port CSize to ULong was making changes uglier and uglier. I see where it gets and I share then on scala-native/scala-native#519.
I prefer to use signed directly (even in extern objects) in my personal code for this reason.
LeeTibbert
@LeeTibbert

@lolgab Thank you for taking a run at Issue #519. If a true fix causes so much shrapnel, perhaps an minimal but effective fix is to comment the file with something which says CSize is like ancient C, signed, that unsigned was considered but is infeasible. CSize should only be used for immediate interop layer, then converted to proper Unsigned above that.
Perhaps there is some transformation method we could supply?

Obviously, this will not fix the pothole, but will provide some clue to folks, like me, who fall into it ;-) Perhaps "sorry, you are hosed! but for a good reason".

I continue to be concerned with the signed/unsigned impedence mismatch, but it seems to not be low hanging fruit and
developer time is precious.

Lorenzo Gabriele
@lolgab
@sjrd What about @alwaysinline extractors and applys methods in ULong, UInt? Those would allow pattern matching.
Sébastien Doeraene
@sjrd
Yes, that could work, indeed.
Lorenzo Gabriele
@lolgab
Nice, thank you! Expect a PR, then :)
Lorenzo Gabriele
@lolgab

Hi @LeeTibbert, If we use the notation with apply and unapply, working with unsigned integers maybe is not that bad. I found some interesting gotchas playing with them. For example:

println(-1.toULong) // 4294967295
println(-1L.toULong) // 18446744073709551615

I know why it happens, but, is it what we want?

Eric K Richardson
@ekrich
Those darn negative integers :smile:
Lorenzo Gabriele
@lolgab
Yeah, the thing is that you can't represent ULongs > Long.MaxValue without using negative values :smile:
If we don't use strings instead, at least.
Eric K Richardson
@ekrich
Yeah, this is why these concepts represented as types could be helpful.
Lorenzo Gabriele
@lolgab
My latest PRs are ready for review now.. I just noticed I had not signed the CLA. (Actually I signed it some time ago but maybe something changed or I was using the other email :) )
Anthony Cerruti
@srnb_gitlab
Having Unsigned literals would be nice
LeeTibbert
@LeeTibbert

@lolgab Great work, as is your want/usual. Thank you.

Re: -1.toULong That is certainly two or more orders of magnitude better than what we have now. I concur that it
violates the principle of "least astonishment". I think there is a strong argument that it is arguably correct albeit likely to harm the unwary. For a first round, Iwould certainly live with that gotcha.

Bikeshedding:

I have a dim memory of .toUlong being actual SN scala code, even for int primitives. I think all of us probably would want primitive int and object Integer to act the same way, even if it is 'astonishing'. Is there a way that does not hurt performance to give a warning in the integer negative case? Of course, that leads to requests to suppress/skip the warning.

Or there could be a ULong.toUlong() method for those of us who are willing to use something that 'just works as expected'.

Your thoughts? (Stay safe, stay healthy).

LeeTibbert
@LeeTibbert
@lolgab yeah, short & smaller friends probably have the same issue.
In doing some small C programs to check this out, I discovered that I was dead wrong about "arguably correct" above and humbly retract that.
Lorenzo Gabriele
@lolgab
Created a PR to solve the #1737 I reported some weeks ago :)
It's the first time I touch the internals of Scala Native :)
PR here: scala-native/scala-native#1744
kerr
@hepin1989
:clap:
Eric K Richardson
@ekrich
@lolgab Nice job.
Teodor Dimov
@teodimoff
@lolgab good job!
Lorenzo Gabriele
@lolgab
Thanks everyone :)