ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
larssg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
larssg has joined #crystal-lang
ur5us has joined #crystal-lang
avane has quit [Ping timeout: 240 seconds]
avane has joined #crystal-lang
m4xm4n has joined #crystal-lang
larssg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has quit [Remote host closed the connection]
postmodern has joined #crystal-lang
<FromGitter> <postmodern:matrix.org> @didactic-drunk: https://github.com/kubo39/syscall.cr another repo to recruit for crystal-posix
ur5us has quit [Ping timeout: 240 seconds]
<FromGitter> <szabgab> See the example in this pull-request https://github.com/kemalcr/kemalcr.com/pull/48
postmodern has quit [Quit: Leaving]
larssg has joined #crystal-lang
<FromGitter> ... practices to emerge over time that may turn in to a semi official guide. :shrug:
<FromGitter> <didactic-drunk> FYI crystal-posix is only a collection of shards where people can look in one place for posix like (or possibly native) functionality. Whatever packages you import I consider them owned by you. If I disagree I'll complain loudly via PR/pull but ultimately the decision is the package owners. The only code guide so far is: Fail on compile on unsupported systems instead of runtime errors. I expect best
maria_elis has quit [Ping timeout: 244 seconds]
maria_elis has joined #crystal-lang
Guest41 has joined #crystal-lang
Guest41 has quit [Client Quit]
<yxhuvud> postmodern: There seems to be native raw syscall support coming in crystal 1.1 though, as part of the uring work.
<FromGitter> <didactic-drunk> Guess I shouldn't have contacted kubo39
ua_ has quit [Ping timeout: 244 seconds]
larssg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <postmodern:matrix.org> @yxhuvud curious what the API will look like?
ur5us has joined #crystal-lang
<FromGitter> <postmodern:matrix.org> ah interesting, you define the syscalls first instead of passing arguments to `syscall(2)`
ur5us has quit [Ping timeout: 244 seconds]
m4xm4n has quit [Quit: Connection closed for inactivity]
deavmi has quit [Ping timeout: 268 seconds]
deavmi has joined #crystal-lang
larssg has joined #crystal-lang
mpp has joined #crystal-lang
billyruffian has joined #crystal-lang
billyruffian has quit [Remote host closed the connection]
<FromGitter> <asterite> Whats the benefit of syscall? Can we avoid using it? It's bad for something I'm working on
<FromGitter> <asterite> Actually, nevermind
<FromGitter> <alex-kampa> I'm trying to figure out the simplest way to listen on 2 separate tcp ports, is this going to work: ⏎ `spawn do ⏎ while client = server1.accept? ⏎ ⏎ ```spawn process2(client)``` ... [https://gitter.im/crystal-lang/crystal?at=60ccc1aec705e53c1c9bff2e]
<FromGitter> <naqvis> Crystal without `preview_mt` is single threaded, so as long as you call `server1.listen` it will block the main thread and code below will never get a chance to execute
<FromGitter> <Blacksmoke16> use nginx to listen and forward to the crystal app :P
<FromGitter> <naqvis> either you go with parallelism (i.e. via `-Dmt_preview`) or better go with two separate process each listening on its own port
<FromGitter> <naqvis> or better as @Blacksmoke16 suggested, better to with some battle tested servers as proxy in-front
hexreel has joined #crystal-lang
frojnd has joined #crystal-lang
<frojnd> Hi there
<frojnd> I just noticeds under project/lib I have files of shards I removed from shard.yml How do I clean not used shard files?
<FromGitter> <Blacksmoke16> `shards prune` would prob d oit
<FromGitter> <Blacksmoke16> do it
<frojnd> Thank you
Guest59 has joined #crystal-lang
<Guest59> Hey all. Is there a way to emulate similar behavior to dynamic function calls on c? (Ex https://stackoverflow.com/a/840504)
<Guest59> I've been trying to use Proc.new(pointer-addr, etc) but I'm getting hung up on the second parameter
<Guest59> I have the functions address stored in a pointer object already, but I can't figure out how to call it
<yxhuvud> You better post a short code example of what you want to acheive.
<Guest59> Hmm I'll have to check back later. I'm mobile at the moment, but I may have figured it out after looking at some more proc examples
<Guest59> But maybe someone could shine some light on this proc methods second parameter
<Guest59> .new(pointer : Pointer(Void), closure_data : Pointer(Void)) : Pointer(Void), closure_data : Pointer(Void))
<Guest59> Well that didn't paste good, but what is clousure_data
hexreel has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest59 has quit [Quit: Client closed]
Guest59 has joined #crystal-lang
Guest59 has quit [Quit: Client closed]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Read error: Connection reset by peer]
elf_fortrez has joined #crystal-lang
edegaru has joined #crystal-lang
<FromGitter> <watzon> Guest59: Hard to know without some context. Where is this method defined?
<elf_fortrez> i guess in the client
elf_fortrez has quit [Quit: Client closed]
elf_fortrez has joined #crystal-lang
<FromGitter> <postmodern:matrix.org> @asterite: raw syscalls are mostly only useful for accessing OS-specific syscalls that libc doesn't support. Use case is mostly for libraries, so raw `sysacall(2)` access could be provided via a shard.
<FromGitter> <HertzDevil> if the proc comes from crystal it contains the closure data
<FromGitter> <HertzDevil> if the proc comes from c just use nil (i think)
<FromGitter> <postmodern:matrix.org> @asterite: but I guess the linux io_uring stuff requires raw `syscall(2)` access for a few IO syscalls from crystal's stdlib.
edegaru has quit [Quit: Leaving]