Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:03
    wontruefree closed #11681
  • 05:02
    wontruefree closed #11698
  • 05:02
    wontruefree closed #11958
  • 05:02
    wontruefree closed #11956
  • May 26 23:38
    Blacksmoke16 labeled #12071
  • May 26 23:38
    Blacksmoke16 labeled #12071
  • May 26 23:27
    ftarulla opened #12071
  • May 26 18:53
    straight-shoota review_requested #12057
  • May 26 18:52
    straight-shoota ready_for_review #11884
  • May 26 13:06
    Blacksmoke16 labeled #12070
  • May 26 11:00
    yxhuvud edited #12070
  • May 26 11:00
    yxhuvud edited #12070
  • May 26 10:56
    yxhuvud opened #12070
  • May 26 10:56
    yxhuvud labeled #12070
  • May 25 13:43
    straight-shoota review_requested #11646
  • May 25 13:40
    straight-shoota synchronize #11884
  • May 25 13:39
    straight-shoota synchronize #12057
  • May 25 10:39
    straight-shoota closed #12067
  • May 25 10:36
    straight-shoota closed #11984
  • May 25 10:36
    straight-shoota closed #11947
Ali Naqvi
@naqvis
should be same for each invocation
as we are giving the same address
but for easy maintenance, better to have constant defined like MMAP_FAILED
Thore Bödecker
@foxxx0
Hi, I'm trying to spawn a long-running process in the background that occasionally prints something on stdout. i want to have that Fiber blocking until the next line on stdout, which works fine using #gets on the stdout pipe. however, as soon as this fiber is part of my multi-fiber application, the other fibers seem to be blocked too
source code with the problematic fiber highlighted: https://paste.foxxx0.de/ngH/crystal#n101
didactic-drunk
@didactic-drunk
Is it possible to have multiple flags type params filled using symbols? https://carc.in/#/r/bbk7
George Dietrich
@Blacksmoke16
@didactic-drunk https://carc.in/#/r/bbkt
best you can do atm, see crystal-lang/crystal#10680
Jonathan Silverman
@mixflame
my scalablepress/paypal/gbaldraw integration is live
another store
you can order the collab canvas prints on shirts and other products now
https://gbaldraw.fun/ please bear in mind the content on the global/empty string room is user generated by anonymous users, apologies if you see anything triggering, if that's the case, please click the link on the right instead and create your own (infinitely lasting) private room
the global room is popular with free speech exhibitionists, please excuse me for that
running Amber on Crystal 1.0.0
ported from Rails 6/Ruby 3
(code is original and by me)
except in places where it's not
didactic-drunk
@didactic-drunk
@yxhuvud @naqvis @HertzDevil thank you for the pointer help making mmap.cr possible.
From IRC (bridge bot)
@FromIRC
<postmodern> didactic-drunk , cool i didn't know there was a crystal-posix project. I had to create https://github.com/postmodern/ioctl.cr to get access to the Linux kernel's specialized ioctls (v4l2).
didactic-drunk
@didactic-drunk

crystal-posix started when @chris-huxtable and I had design differences with the core team. Sometimes we need native types exposed rather than Int32 everywhere. The largest disagreement was on compile time vs runtime safety. @astterite wants everything to compile cross platform without macros or if respond_to? checks. An acceptable workaround to him is platform_specific_method may raise an error on an unsupported platform (but it still compiles - I haven't figured out why that matters if it doesn't work). We've chosen

{% if supported_platform %}
  def platform_specific_method
{% end %}

Then letting the code break when compiling if you don't check with respond_to. This let's you know something will or won't work when compiling rather than having random breakage you may or may not test for.

The whole argument can probably be summed in 2 + 1 posts.

From IRC (bridge bot)
@FromIRC
<postmodern> @didactic-drunk, couldn't you do the standard {% if supported %} .. {% else %} {% error(...) %} pattern that C/C++ uses for compile time compatibility checks
didactic-drunk
@didactic-drunk
My message describes one example. I think we tried 3 or more different solutions but crystal would only accept "compiles everywhere, runs uncertainly". An example would be the windows sid. Process.sid should work on windows only. With the official crystal way it's a runtime error when called. With our if you call it on a non windows system the program won't compile. I think that fits better with the crystal philosophy of "Crystal is statically type checked, so any type errors will be caught early by the compiler rather than fail on runtime." (taken from crystals web page).
Also, how do you know what a supported platform is and should you need to know for every API. Feature checking with respond_to allows for future proofing. Example: Linux supports open45, later FreeBSD adds support, and finally Mac/OS 15 years later. The shard wrapping open45 can add os support incrementally while every crystal program using the shard can keep the same feature check without changing their code, just update to a new shard for new os support.
From IRC (bridge bot)
@FromIRC
<postmodern> hmm yeah, handling platform-specific code vs. platform agnostic code will eventually become a problem
<postmodern> i guess shards may need to add a feature to specify that a shard only works on a certain platform
didactic-drunk
@didactic-drunk
The mutual conclusion is platform specific code will go in shards. They won't take platform specific code and we can't make certain types of programs without them. Like ioctl
From IRC (bridge bot)
@FromIRC
<postmodern> once windows support get's finalized, i wouldn't be surprised if we see a cyrstal-windows github org, for crystal shards that access private Windows APIs and libraries.
oprypin
@oprypin:matrix.org
[m]
@mattrberry: could you point out to me that project that I wanted to add Windows support to? and is it in a good working shape as is?
Matthew Berry
@mattrb:matrix.org
[m]
Thank you again for taking a look!! This is the project https://github.com/mattrberry/crab
It’s currently in working condition on Linux, but breaking on Mac because I didn’t link opengl properly in the imgui backends package https://github.com/mattrberry/crystal-imgui-backends
Matthew Berry
@mattrb:matrix.org
[m]
It currently builds on Linux with just a shards build because I set the rpath in the link flags in the backends library :p
didactic-drunk
@didactic-drunk
@oprypin:matrix.org Are you testing windows gh actions integration?
oprypin
@oprypin:matrix.org
[m]
@didactic-drunk: well not really testing, i know it works
didactic-drunk
@didactic-drunk
@oprypin:matrix.org I'd like to get sodium on windows, but it uses shell scripts to download & build libsodium. If you have recommendations I'll take them
From IRC (bridge bot)
@FromIRC
didactic-drunk
@didactic-drunk
Downloading on windows? How to handle multiple platforms in shard.yaml - postinstall?
Kaia Leahy
@tenebrousedge
sup y'all
oprypin
@oprypin:matrix.org
[m]

It currently builds on Linux with just a shards build because I set the rpath in the link flags in the backends library :p

ow.. that's what i said shouldn't be done. it's really hostile.

anyway.. I'll get around to this tomorrow. today i kinda disappeared
Matthew Berry
@mattrberry
What makes that really hostile? Isn't that just adding an extra path for it to check at link time? If it doesn't find it in that path, then you can always just pass the link flags directly to shards build still, right?
Maybe I'm missing something, but I don't see a harm in setting it?
Unrelated: Am I missing something silly here? This isn't matching my expectation https://play.crystal-lang.org/#/r/bbpq
I would have expected the self.new in SDLOpenGLImGuiFrontend to be called
I can totally just do it a different way, I just expected different behavior
Matthew Berry
@mattrberry
Ah I'm guessing that's because the self.new and self.initialize have the same args
Kaia Leahy
@tenebrousedge
the second one overwrites the first
Matthew Berry
@mattrberry
Yeah that makes sense, that was my suspicion. I don't know how I'd actually expect it to work if not like this tbh haha
oprypin
@oprypin:matrix.org
[m]

What makes that really hostile? Isn't that just adding an extra path for it to check at link time? If it doesn't find it in that path, then you can always just pass the link flags directly to shards build still, right?

Matthew Berry how can you say that that flag is supposed to check something at link time, if exactly that is already the job of the -L flag?
writing -rpath . has a very simple effect: append the value . to the "rpath" field of the final ELF executable (empty by default). so you're saying: "if you use my library, you must accept a custom and rare value of rpath for your executable." then, what is done at run time with that field is to check those paths for libraries that were linked against and use them. I'd (strongly) say that it should be up to the developer of the executable to decide that allowing overrides of any referenced lib from current directory is ok. it works only for particular models of deployment and is a question of security as well.

Oleh Prypin
@oprypin
agh tagging you didn't work properly. trying again. @mattrberry
oprypin
@oprypin:matrix.org
[m]
if you still want to hardcode this addition in source code, that's ok, but it should be done in the main executable's source code. can be done as such, I'm pretty sure:
@[Link(ldflags: "-Wl,-rpath .")]
lib DoesntMatterWhatNameIsHere
end