Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:10
    LeeTibbert synchronize #1690
  • 07:23
    LeeTibbert opened #1690
  • Aug 21 21:22
    LeeTibbert synchronize #1688
  • Aug 21 20:47
    LeeTibbert commented #1688
  • Aug 21 20:34
    LeeTibbert commented #1688
  • Aug 21 20:16
    LeeTibbert synchronize #1688
  • Aug 21 19:44
    rwhaling commented #1688
  • Aug 21 19:25
    LeeTibbert opened #1689
  • Aug 21 18:30
    LeeTibbert opened #1688
  • Aug 19 17:47
    rwhaling commented #1643
  • Aug 19 13:39
    LeeTibbert commented #1687
  • Aug 19 12:27
    lolgab commented #1683
  • Aug 19 12:08
    muxanick commented #1687
  • Aug 19 12:08
    muxanick commented #1687
  • Aug 19 09:13
    sjrd commented #1683
  • Aug 19 07:51
    LeeTibbert commented #1683
  • Aug 18 22:59
    LeeTibbert commented #1643
  • Aug 18 22:40
    LeeTibbert opened #1687
  • Aug 18 21:20
    LeeTibbert edited #1686
  • Aug 18 21:17
    LeeTibbert opened #1686
Denys Shabalin
@densh
Me and @Duhemm hacked some things up and didn’t have time to have 100% working solution.
It seemed to take a lot more time to finish it than what we’ve had on our hands.
I opened the repo. But the quality is really “proof of concept” level.
Disclaimer: I haven’t touched in a really long time and it might not work at all any more.
Mike Samsonov
@muxanick
@densh thanks, I will have a look
Lorenzo Gabriele
@lolgab
@densh I'm using dlang GC not immix :smile:
Sadly I don't know a thing about garbage collectors and don't have any idea how to make immix work with multiple threads.. I knew D supported multiple threads and that it has nice C interop so I made dlang GC work with Scala Native..
Denys Shabalin
@densh
Our GC is quite fast. What’s the performance of D’s GC ?
That’s my primary concern.
I’d really not want to lose performance, we’ve worked really hard to get to hotspot-grade speed.
But otherwise cool effort.

@densh thanks, I will have a look

Just added a disclaimer that the code is frozen and no future development is planned.

Mike Samsonov
@muxanick
@densh Quick question while you're here, I don't see any changes in Definitions.scala where Object class is defined? Is it in rt.jar ?
Denys Shabalin
@densh
Look at bash script. I think it had some magic around this.
Lorenzo Gabriele
@lolgab

I’d really not want to lose performance, we’ve worked really hard to get to hotspot-grade speed.

I see it like a nice prototype to build Threads on, then when Immix will support threads you only need to change the gc setting..
To support this, could be cool to have a "custom" gc, where you have to manually link a gc and offer the various scalanative_allocfunctions, like I did in d. So you don't need to modify SN to test another GC.
This is the glue code I had to make:

import core.stdc.string : memset;
import core.memory : GC;
import core.thread;
import core.runtime;
import core.stdc.stdio;

extern(C):

Thread thread_attachThis();
Thread thread_detachThis();

void scalanative_init() {
   Runtime.initialize();
}

void to_export_these_functions() {
   thread_attachThis();
   thread_detachThis();
}

void *scalanative_alloc(void *info, size_t size) {
    void **alloc = cast(void **)GC.malloc(size);
    memset(alloc, 0, size);
    *alloc = info;
    return cast(void *)alloc;
}

void *scalanative_alloc_small(void *info, size_t size) {
    void **alloc = cast(void **)GC.malloc(size);
    memset(alloc, 0, size);
    *alloc = info;
    return cast(void *)alloc;
}

void *scalanative_alloc_large(void *info, size_t size) {
    void **alloc = cast(void **)GC.malloc(size);
    memset(alloc, 0, size);
    *alloc = info;
    return cast(void *)alloc;
}

void *scalanative_alloc_atomic(void *info, size_t size) {
    void **alloc = cast(void **)GC.malloc(size);
    memset(alloc, 0, size);
    *alloc = info;
    return cast(void *)alloc;
}

void scalanative_collect() { 
    GC.collect();
}
Mike Samsonov
@muxanick
@densh Thanks!
Scalac fully works now, next step is make it works as Language Server
Lorenzo Gabriele
@lolgab
You can compile scala code? I imagine you didn't try with plugins
Can you post the binary somewhere?
Lorenzo Gabriele
@lolgab
I am so curious to try it :)
LeeTibbert
@LeeTibbert

Is anybody working on or planning to work on the new Issue #1683 "Implement suppression for Throwable"? If not, I could
give it a go before I dive back into Unicode for weeks. The first few steps look easy enough to suck me into the hard parts :grinning:.
I do not want to duplicate work & energy if someone is already working on this or has it scheduled. I have plenty to keep me busy.

Zio looks pretty complicated, but if it is a potential way to gain users for SN, it would be nice to remove the impediments we can.

Thanks
Mike Samsonov
@muxanick
@lolgab I stripped out phases about jvm, it only works as a tool for language server, parsed the source until the point when it could be a some kind of database. I will publish it soon
@LeeTibbert Please, go for it
Richard Whaling
@rwhaling
@LeeTibbert - #1683 is a priority for me too, you should go ahead and knock it out if you have time.
Lorenzo Gabriele
@lolgab
Thank you @LeeTibbert :)
Lorenzo Gabriele
@lolgab
I'm having some problems with the way bindings are defined in the new implementation.. Because now, when you have nested structs, the Ops implicit classes return a CStruct directly instead of a Ptr[CStruct].. This makes hard to access nested fields.. For example, you have all these ugly casts here:
https://github.com/scala-native/scala-native/blob/34453c01ba344b3fe3bf4a79ec4b10bf07638e72/posixlib/src/main/scala/scala/scalanative/runtime/SocketHelpers.scala#L125
The rewrite you made for boxed pointers made this necessary or returning a CStruct instead of Ptr[CStruct] was a choice?
If it is necessary why not make this cast in facades instead of in client code?
I could make a PR if it is something appreciated
@densh
Richard Whaling
@rwhaling
@lolgab - the new pointer interop has a new method that returns the Ptr to a member field instead of a value
if you use struct.at1 instead of struct._1
I use .at1 a lot when I have nested structs - maybe we should revise socketOps and the other posix wrapper classes to use it more idiomatically
Lorenzo Gabriele
@lolgab
Yes it could be cool.. if I get a positive answer I'll start doing it myself
Eric K Richardson
@ekrich
@lolgab I sorry if I asked already but what are the showstopper here for Scala Native support ? https://github.com/olafurpg/metaconfig/pulls
oops, sorry, that was for @gabro
Lorenzo Gabriele
@lolgab
@ekrich you picked the wrong Italian :D
Eric K Richardson
@ekrich
He he
Shadaj Laddad
@shadaj
I just released ScalaPy 0.3.0, which adds support for Scala Native! Docs and more at https://scalapy.dev
Richard Whaling
@rwhaling
:clap: :clap: :clap: @shadaj
Mike Samsonov
@muxanick
@shadaj :clap:
David Bouyssié
@david-bouyssie
@shadaj :clap: :clap: :clap: :heart_eyes:
Lorenzo Gabriele
@lolgab
@shadaj 👏 👏 👏 👏
Lorenzo Gabriele
@lolgab
I read the docs, very nice design, I liked the Union types like in scala js
Eric K Richardson
@ekrich
Very Cool. @shadaj Does this help the lack of Scala graphics in Almond by allowing Python?
Corey O'Connor
@coreyoconnor

I used the Dlang runtime, D GC which works with threads and D threads

I was not going to guess that hahaha

Shadaj Laddad
@shadaj
Thanks everyone! @ekrich as of now, not really since there's a bit more work that needs to be done to pass-through the Jupyter APIs to the Python interpreter. Once that's done though, matplotlib and friends should work perfectly.
Eric K Richardson
@ekrich
@shadaj Thanks, good to know!
Denys Shabalin
@densh

I just released ScalaPy 0.3.0, which adds support for Scala Native! Docs and more at https://scalapy.dev

Cool stuff! 👍