<FromGitter>
<vprelovac> Hey folks, I came here looking for a Crystal developer. The kind seems to be very hard to find. Any tips?
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
_ht has joined #crystal-lang
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
nowhereFast has joined #crystal-lang
<nowhereFast>
I'm getting `Missing "v1.0.0:shard.yml" for "redis"` when running shards on 0.34, is there something I should be doing differently to get this working?
tuurev has joined #crystal-lang
<FromGitter>
<naqvis> what action are you performing when receiving this?
<FromGitter>
<naqvis> upgrade shouldn't be causing this pb
<FromGitter>
<stergiom> itβs a new `shards.yml` file, the action is a typical `shards install` on an Ubuntu 18.04 box.
nowhereFast has left #crystal-lang [#crystal-lang]
<FromGitter>
<naqvis> can you share yaml file contents?
zorp_ has joined #crystal-lang
zorp has quit [Ping timeout: 265 seconds]
zorp_ has quit [Ping timeout: 265 seconds]
Flipez has quit [Read error: Connection reset by peer]
Flipez has joined #crystal-lang
ur5us has joined #crystal-lang
<Andriamanitra>
is there a neat way to keep track of what got required when using wild card?
<Andriamanitra>
let's say i have a folder called extensions that has bunch of files with one module in each of them and i'd like to know which extensions got loaded
<FromGitter>
<naqvis> wildcard will load all. But for your use-case, you can think of implementing a kind of `register_extension` function, and have that method called from each extension
<FromGitter>
<naqvis> assuming extensions are valid crystal files
<Andriamanitra>
yeah i was thinking of a way to call register_extension in a loop or something so i don't need to add that to each file separately
<Stephie>
because @lock is a noop unless -Dpreview_mt
<Stephie>
basically that code working is a series of happy accidents and happening to not meet the race condition yet
<oprypin>
Stephie: ok so you say getting input from any IO is simply not possible?
<Stephie>
no
<Stephie>
i'm saying it's always blocking
<Stephie>
file io is already always blocking on linux, and sockets arent implemented on windows yet
<Stephie>
so nobody notices
<Stephie>
the hard part of windows is yet to come
<oprypin>
Stephie: well if io is blocking and wait is blocking then this is kinda useless
<Stephie>
no, it's not
<Stephie>
if you wait *after* doing all your IO it's fine
<Stephie>
of course, it's rather broken in a lot of usecases
<Stephie>
but it's usable for some
<oprypin>
ugh
<Stephie>
yes
<oprypin>
but would you agree that in the end this will require a thread?
<oprypin>
for #wait
<Stephie>
well, it'll require waiting on the handle
<Stephie>
that could easily be combined into a single thread per application
<Stephie>
but yes, it'll require threads
<oprypin>
yea makes sense
<Stephie>
but it can't be done now
<Stephie>
getting process working isnt 0 to 100%
<Stephie>
i mean, people think that getting libevent working on windows will save them
<Stephie>
i doubt it
<Stephie>
it might be a nice stopgap
<Stephie>
we're gonna have to write a completely custom event loop
<Stephie>
(which isnt actually hard because windows actually happens to have designed IOCP well)
<oprypin>
I'd also say for the record that explicitly spawning a thread with WaitForSingleObject would be the same useless outcome but will require a thread per wait
<Stephie>
yes
<oprypin>
hmm also if one got threads working on Windows before having proper event loops, this implementation could get Process working earlier
<Stephie>
oprypin, but obviously that's not what we'd do
<Stephie>
we's spawn a proper crystal thread with all the required runtime state
<Stephie>
and create something that uses WaitForMyultipleObjects
<Stephie>
oprypin, just dont make extra work for yourself
<Stephie>
getting process working with this limitation is enough to compile the compiler
<Stephie>
i know - i've done it
<Stephie>
then that makes working on sockets/eventloop/etc easier
<Stephie>
since you're not in cross-compile hell
<oprypin>
I'll agree with you of course, don't worry. and not just because i don't have a choice π
<Stephie>
i know it's frustrating that Process has this major limitation
<Stephie>
it does make it a pain to use on windows
<Stephie>
but then we dont have asyncio on pipes either
<Stephie>
so you literally cant read to and write from a process at the same time even if this was solved
<oprypin>
Stephie, yea ok, io seems to still work with blocking `wait`. seems like it will always work for the typical scenario where one uses `Process.run` without a block
<oprypin>
i was under the impression that it didnt work, from my prior development. but apparently i was doing something else wrong
<Stephie>
yeah
<Stephie>
it does work
<Stephie>
in like, most cases?
<Stephie>
oprypin, if you get crystal compiler working and merged i'll do all the event loop stuff
<Stephie>
do we want to make the ggamble that all PIDs in all future platforms are 32bit though
<Stephie>
i'd like to make it UInt64
<Stephie>
at least, put it in the PR
<Stephie>
and hope nobody notices
<oprypin>
Stephie, do we want to make a gamble e that all PIDs in all future platforms are positive though?
<Stephie>
yes
<Stephie>
fuck any platform which has negative PIDs
<oprypin>
??? i want int64, i dont see why it should be uint64
<Stephie>
i mean
<oprypin>
oh.. no, i see
<Stephie>
a platform using u64 seems a lot more likely than i64
<Stephie>
idk
<oprypin>
> do we want to make a gamble that all PIDs in all future platforms are less than UINT64_MAX
<oprypin>
> do we want to make a gamble that all PIDs in all future platforms are less than INT64_MAX
<oprypin>
damn it
<Stephie>
go find out wtf fuscia's doing
<Stephie>
or however you spell it
<FromGitter>
<bararchy> Was anything change so that in preview_mt instance vars can't be shared between Fibers? (it seems they see a copy, not the original)
<FromGitter>
<bararchy> as in, one object being changed outside of Fiber (yes useing a mutex) is invisible to the object in the other Fiber
sorcus has joined #crystal-lang
<yxhuvud>
Can platforms return negative PID as error code on fork (or whatever) failure?
<yxhuvud>
I guess that could be handled before the number is considered a pid though
<yxhuvud>
stephie: Have you looked at all on the interfaces io_uring brings to linux? It seems *seriously* great for building event loops.
<FromGitter>
<naqvis> golang treat pid as `int` of which size is system dependent, i.e either 32 or 64
<Stephie>
yxhuvud, i dont want to mess with the event loop on linux for now
<Stephie>
i've not looked into uring much
<Stephie>
though i am aware
<Stephie>
im not sure of it's scope
<Stephie>
@bararchy no
<yxhuvud>
Supported operations is growing every kernel release. As far as I can see, scope seems to be "almost everything that is actually done very often during runtime". Though they are not there yet.
<yxhuvud>
ie you have support for stuff like async accept, fopen, fclose, fsync, poll, read, etc.
<Stephie>
sounds like it'll be useful in 10 years once all the features we need are supported by every kernel we need to support
<Stephie>
:)
<Andriamanitra>
is there no built-in way to get a set of random numbers from a range?
<Andriamanitra>
i see there's Array#sample but that seems wasteful if the range is big
<FromGitter>
<bararchy> Stephie: then I'm baffled, one fiber shows the object holding one object (its a hash), the other shows its empty. There seems to be a difference in spawn called in Initialize vs after initialization
<FromGitter>
<neutrinog> @vprelovac what sort of project is it?
<oprypin>
Andriamanitra, it's valid to keep generating numbers in range, skipping duplicates, until you have enough.
<gangstacat>
hello, what would be the correct way for a package manager to package the new shards as I get "Error: can't find file 'molinillo'", then I'm asked to run shards install...
<gangstacat>
by "package manager" I mean a package builder with recipes on a distro
blassin has quit [Remote host closed the connection]
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
rocx has joined #crystal-lang
<rocx>
Blacksmoke16: yeah no dice with twiddling pkgconf.
_ht has quit [Quit: _ht]
<FromGitter>
<Blacksmoke16> darn
<rocx>
all i know is that it's not picking up on libssl/libcrypto or something. even ln-ing some of the libraries to *.so.1.1 doesn't do the trick.
<rocx>
ah. oh well. guess i could build crystal from scratch.
<rocx>
i basically need to download one of the release binaries in order to bootstrap/compile the compiler, right?
<FromGitter>
<Blacksmoke16> could also try installing via snap or something
<rocx>
oh. there's an rpm package on the releases.
Human_G33k has quit [Remote host closed the connection]
<rocx>
eyep. rpm. should've done it that way.
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
postmodern has joined #crystal-lang
rocx has quit [Read error: Connection reset by peer]
<FromGitter>
<bew> RX14 are you around? I was wondering about #6956: where does `IO#gets_peek assumes incorrectly that IO#peek returning nil is the same as returning an empty slice` ?