Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:37
    HertzDevil edited #12366
  • 08:32
    orangeSi synchronize #12356
  • 08:10
    orangeSi synchronize #12356
  • Aug 07 22:57
    HertzDevil edited #12368
  • Aug 07 22:57
    HertzDevil labeled #12368
  • Aug 07 22:57
    HertzDevil labeled #12368
  • Aug 07 22:57
    HertzDevil opened #12368
  • Aug 07 22:54
    HertzDevil labeled #12367
  • Aug 07 22:54
    HertzDevil labeled #12367
  • Aug 07 22:32
    HertzDevil synchronize #12366
  • Aug 07 19:55
    refi64 synchronize #12367
  • Aug 07 19:54
    refi64 opened #12367
  • Aug 07 19:15
    straight-shoota closed #7164
  • Aug 07 19:15
    straight-shoota closed #11790
  • Aug 07 02:08
    Blacksmoke16 labeled #12365
  • Aug 07 01:06
    HertzDevil edited #12366
  • Aug 07 01:03
    HertzDevil edited #11973
  • Aug 07 01:03
    HertzDevil edited #11973
  • Aug 07 01:02
    HertzDevil synchronize #11973
  • Aug 07 00:54
    oprypin review_requested #12293
dumbmahreeo
@dumbmahreeo:matrix.org
[m]
Here the problem came up because I wanted to concurrently handle input and output trough NCurses
George Dietrich
@Blacksmoke16
yea dunno, having it be based on partial C could prob doesn't make it easier either
dumbmahreeo
@dumbmahreeo:matrix.org
[m]
This is a big problem that should absolutely not be ignored further in a language that calls itself production ready
Imo calling Crystal production ready with this single problem (which is not the only one) is really v-lang level talk
George Dietrich
@Blacksmoke16
:shrug: make a forum thread about this info and see if there's any quick wins
dumbmahreeo
@dumbmahreeo:matrix.org
[m]
I forgot that Crystal had a forum. Yeah, I think that I'll start a thread
George Dietrich
@Blacksmoke16
some would argue the biggest problem is windows support, or MT not being 100% yet, etc. Doesn't mean it's not production ready
dumbmahreeo
@dumbmahreeo:matrix.org
[m]
In fact I'm not saying that's it's the biggest problem. I'm saying that it's an incredibly huge problem, yet not the biggest one
George Dietrich
@Blacksmoke16
maybe less so in some areas, but in the end is just another problem that needs solving
ddd
@Dan-Do
I am dealing with that using timeout channel atm
Kirk Haines
@wyhaines
I don't think it's really even a problem that needs to be solved. The fact that fibers do not have a pre-emptive scheduler means that one must understand that fact when writing concurrent code, but it's hardly a flaw. Insert a Fiber.yield into the loop, and it is no longer blocking.
Quinton Miller
@HertzDevil
Screenshot_20210622_142745.png
Screenshot_20210622_143005.png
soon...?
the asm output is not very useful if i include the prelude
Quinton Miller
@HertzDevil
in fact compiling anything with the prelude and --release causes a timeout
Alex Kampa
@alex-kampa

can manually do sleep 0 to somewhat get around this tho

Hi @Blacksmoke16 will "sleep 0 "have the same effect as Fiber.yield ?

@wyhaines you suggested Fiber.yield, what do you think about "sleep 0", what's the difference?
From IRC (bridge bot)
@FromIRC
<straight-shoota> It's literally the same: Fiber.yield is implemented as sleep(0)
Alex Kampa
@alex-kampa

Ok, so just to be 100% sure, the place to insert this would be as follows:

spawn do
  loop do
    server.accept do |client|
      message = client.gets
      client << process(message)
    end
    Fiber.yield # same as sleep(0)
  end
end

Is that correct?

From IRC (bridge bot)
@FromIRC
<straight-shoota> Technically, yes. But it's really not necessary at this location.
<straight-shoota> Yielding a fiber is a tool you would use in a tight loop to give the scheduler an opportunity to change to some other task.
<straight-shoota> But your loop contains I/O operations which already expose such opportunities due to their async implementation
Alex Kampa
@alex-kampa
Thanks for the clarification. Yes I noticed that it all works well without putting in the Fiber.yield.
Rishav Sharan
@rishavs
Hey @straight-shoota how goes the Windows signals work? eagerly awaiting it. :smiley_cat:
From IRC (bridge bot)
@FromIRC
<yxhuvud> straight-shoota: I wouldn't mind moving Scheduler#yield to a event loop dependent place though. I don't know about how it would work on windows but at least for uring it makes no sense to set up a timer instead of using a NOP op.
<yxhuvud> assuming there is even need to emit an op in the first place, which is questionable.
<straight-shoota> @rishavs, Windows is not exactly made for signals. We'll probably be able to imitate a few of them, but you shouldn't expect that to work as on posix systems
<straight-shoota> More info on crystal-lang/crystal#7339
<straight-shoota> yxhuvud, yeah, that's probably a good idea. Fiber.yield == sleep 0 is an implementation detail of the event loop
Rishav Sharan
@rishavs
:heart:

I just want crystal on windows so I can do some gamejams using crsfml ^_^. I am not interested in the networking bits, just hate the effort it requires to set up crystal on windows currently.
I would be happy if I can just do scoop install crystal and the compiler after installation throws a big honking text Networking is currently not supported on windows platform.

Anyway, wanted to thank you and the rest of the team on picking more big rocks on the windows side of things.

Quinton Miller
@HertzDevil
does crystal have the capability to distinguish between prelude code and user code in build artifacts
mainly asm and llvm-ir
From IRC (bridge bot)
@FromIRC
<yxhuvud> what functions would be part of the prelude?
Rishav Sharan
@rishavs
Any sneak peak on the 1.10 changelog?
Rishav Sharan
@rishavs
Thanks @jhass:m.aeshna.de !
manveru
@manveru:matrix.org
[m]
hi folks, i'm trying to parse a stream of rather large json objects without any delimiters between them from an IO... is there some sane way to do that
the only way i've found so far would be to use the JSON::PullParser and manually try to parse everything... or maybe going through the stream and counting braces, but that's also error-prone because of escaping
George Dietrich
@Blacksmoke16
can you alter the source to make them at least on unique lines?
manveru
@manveru:matrix.org
[m]
unfortunately not, i'm consuming a 3rd party api for streaming events
hmm, lemme double-check that though
ok, i must've made some mistake, it seems a simple gets on the io with a huge buffer works :)
manveru
@manveru:matrix.org
[m]
and each_line is even more elegant
George Dietrich
@Blacksmoke16
so they are delimited then?
manveru
@manveru:matrix.org
[m]
i tried IO::Delimited first, but that was probably wrong
sure looks like there are proper newlines in there, yeah
sorry for the disturbance ^^;