<FromGitter>
<Daniel-Worrall> I kinda feel like this should have been easier with the stdlib
Liothen has quit [Ping timeout: 250 seconds]
jetpack_joe has quit [Ping timeout: 252 seconds]
melthelesbian has quit [Ping timeout: 252 seconds]
<FromGitter>
<christopherzimmerman> @kinxer awesome! Yea anything you have time to do would be much appreciated. Anything in particular you are interested in implementing?
melthelesbian has joined #crystal-lang
jetpack_joe has joined #crystal-lang
Liothen has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Remote host closed the connection]
Human_G33k has quit [Ping timeout: 245 seconds]
f1refly has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 252 seconds]
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 250 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 250 seconds]
Stephie has quit [Quit: Fuck this shit, I'm out!]
Stephie has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
badeball_ has joined #crystal-lang
ht_ has joined #crystal-lang
yukai has quit [*.net *.split]
return0e has quit [*.net *.split]
woodruffw has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
DTZUZO has quit [*.net *.split]
MasterdonX has quit [*.net *.split]
Flipez has quit [*.net *.split]
coderobe has quit [*.net *.split]
raz has quit [*.net *.split]
olbat has quit [*.net *.split]
ht_ is now known as _ht
davic has quit [Ping timeout: 262 seconds]
_ht is now known as 59NAAZNEM
davic has joined #crystal-lang
return0e has joined #crystal-lang
yukai has joined #crystal-lang
woodruffw has joined #crystal-lang
DTZUZO has joined #crystal-lang
dostoyevsky has joined #crystal-lang
MasterdonX has joined #crystal-lang
coderobe has joined #crystal-lang
raz has joined #crystal-lang
olbat has joined #crystal-lang
Flipez has joined #crystal-lang
dostoyevsky has quit [Max SendQ exceeded]
dostoyevsky has joined #crystal-lang
yukai has quit [*.net *.split]
return0e has quit [*.net *.split]
woodruffw has quit [*.net *.split]
DTZUZO has quit [*.net *.split]
MasterdonX has quit [*.net *.split]
Flipez has quit [*.net *.split]
coderobe has quit [*.net *.split]
raz has quit [*.net *.split]
olbat has quit [*.net *.split]
coderobe has joined #crystal-lang
return0e has joined #crystal-lang
woodruffw has joined #crystal-lang
DTZUZO has joined #crystal-lang
MasterdonX has joined #crystal-lang
Flipez has joined #crystal-lang
raz has joined #crystal-lang
olbat has joined #crystal-lang
yukai has joined #crystal-lang
return0e has quit [Ping timeout: 268 seconds]
hemite has left #crystal-lang [#crystal-lang]
59NAAZNEM has quit [Quit: 59NAAZNEM]
return0e has joined #crystal-lang
Vexatos has joined #crystal-lang
yukai has quit [Ping timeout: 268 seconds]
<repo>
i wrote a tiny rust lib that basically just exposes a few functions globally. I then wrote bindings for this in crystal. When i try linking a project that uses the shard get the following error: https://p.jokke.space/HHQm2/
<repo>
i should also say that i'm statically linking the rust lib, everything else is dynamically linked
<FromGitter>
<mavu> just stumbled on this: https://github.com/omarroth/invidious ⏎ Written in Crystal - alternate frontend for youtube. looks awesome.
<repo>
it seems like i should pass the static rust lib as the last argument
<repo>
is there a way to influence the order of linker flags in crystal?
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
alex```77 has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 245 seconds]
manveru has joined #crystal-lang
<FromGitter>
<straight-shoota> repo, I'm not sure
<FromGitter>
<straight-shoota> But you can just pass `--cross-compile` and the compiler will print the linker command instead of executing it. Then you can modify it to your needs.
<FromGitter>
<straight-shoota> It's not nice, but maybe a useful workaround
<repo>
straight-shoota: i found a way around this. I used objcopy to strip the conflicting symbol from the rust lib
<FromGitter>
<yxhuvud> I mean, if you get a link error (which needs to be improved BTW) you get the command printed anyhow
<repo>
yeah
<FromGitter>
<yxhuvud> I'll file an issue about linker error messages when I get around to it.
<repo>
is it possible to read from an io with a timeout?
return0e_ has quit [Read error: Connection reset by peer]
return0e_ has joined #crystal-lang
<repo>
to be more precise: i have a fifo i read from. i want to block for a maximum amount of N seconds before timeouting on a gets
<repo>
oh ok
<repo>
seems that there's IO::Evented
<repo>
not sure how to use that with IO::Filedescriptor though
livcd has joined #crystal-lang
<repo>
hmm
<repo>
i could use a unix socket as well but i'd need to be able to timeout on accept
<FromGitter>
<straight-shoota> `IO::FileDescriptor` includes `IO::Evented`. It's just not obvious because it goes through `Crystal::System::FileDescriptor` which is nodoc
return0__ has quit [Read error: Connection reset by peer]
return0e_ has joined #crystal-lang
duane has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
ternarysolo has joined #crystal-lang
olbat[m] has joined #crystal-lang
beepdog has joined #crystal-lang
erdnaxeli has joined #crystal-lang
<FromGitter>
<kinxer> @christopherzimmerman Actually, I'm most interested in improving and refining the API documentation, naming, and code structure. I think the work you've done on actual implementation is really fantastic, but those other factors will heavily affect actual shard usage. Also, I'm not a data scientist, and I don't really work with machine learning, so I'm not confident about my ability to implement actual features.
<FromGitter>
... I do really care about API usability and software maintainability, though, hence my stated intention.
<FromGitter>
<christopherzimmerman> That would be great. Yea I pretty much have been focused on getting the core functionality implemented more than anything. Docs are a huge weakness right now. I wish Crystal let you modify the documentation templates, the alternative is docs by hand
<FromGitter>
<Daniel-Worrall> docelic: Looking at your `crystallabs/event_handler`, is there a reason handler procs need to return a Bool instead of Nil? Is there any distinction made between true or false?
<FromGitter>
<tenebrousedge> that's a bit of a weird sieve
<FromGitter>
<Souravgoswami> Better if I can get a stackoverflow answer (and not downvotes please 😆), that's the first google result of searching killing threads in crystal lang
<FromGitter>
<Souravgoswami> @tenebrousedge, yeah but it's just sieve... Benchmarked with Eratosthenes in Ruby, works fast enough ... :D
<FromGitter>
<Souravgoswami> Benchmarked with Benchmark in Ruby, and compared with Eratosthenes btw...
<FromGitter>
<Souravgoswami> I am really missing the `.methods` method in crystal to learn more about classes! Is there any performance issue with .methods method?
<FromGitter>
<tenebrousedge> no, but it's a macro method
<FromGitter>
<Souravgoswami> @tenebrousedge that's great... Shorter code! But I wanted to add animation like in the question! So I need a thread to run the loop to print, I am also printing % done
<FromGitter>
<Souravgoswami> @tenebrousedge , then it's really gets messed up... I can't use `spawn do ... end` because the print in loop stays paused!!?
<FromGitter>
<Souravgoswami> Which doesn't print anything
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter>
<Souravgoswami> Oh sorry for my terrible mistake, I wrote the channel.send() in the loop as well, I have removed that, and the loop do end is working fine, but it stuck in an infinite loop
<FromGitter>
<asterite> I think we allow `include T(Object)` for reasons I can't remember, but that should be a compile-error at some point (until we allow `Object` there)
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter>
<jwoertink> A compile error would be good. I'm now thinking I can just get rid of including enumerable in my code
<FromGitter>
<jwoertink> Thanks for the help all!
<FromGitter>
<asterite> @Souravgoswami use `spawn` and try compiling with `-Dpreview_mt`
alex``` has quit [Client Quit]
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter>
<asterite> @Souravgoswami also `Thread` is not public API
<FromGitter>
<Souravgoswami> Same question, how can I stop execution of the loop? ⏎ Surely I can set a boolean value to true and false, and get my job done...
<FromGitter>
<asterite> you can use `select` then `ch.receive` and `else`. The `else` will be exeuted if the channel doesn't have anything in it
<FromGitter>
<asterite> (compile with `-Dpreview_mt`)
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<FromGitter>
<Souravgoswami> It just prints the number and it just avoids the loop!
<FromGitter>
<Souravgoswami> -Dpreview_mt works!
Raimondii has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondii is now known as Raimondi
<FromGitter>
<asterite> yes, I think without `-Dpreview_mt` it doesn't work because the main loop won't switch to another fiber (there's no sleep nor IO) so the `spawn` never gets to run
<FromGitter>
<asterite> with `-Dpreview_mt` it works fine because `spawn` likely runs in a separate thread
<hightower4>
Hm I declared @x : Hash(String,Int) and this worked. Then when I actually did @x = Hash(String,Int16).new, it told me that type must be Hash(String,Int), not Hash(String,Int16). Is this known/expected behavior, or?
<FromGitter>
<kinxer> I think a variable restricted to `Klass(T)` doesn't allow an instance of `Klass(U)` where `U` is a subclass of `T`.
<FromGitter>
<kinxer> If you're using just `Int16`, you should restrict the `Hash` to `Int16`. If you're planning on using different subtypes of `Int`, I think the way to go is to make your class generic.
<hightower4>
yeah switched to Int16
<FromGitter>
<Souravgoswami> @kinxer That's good, but doesn't that uses more processing... I mean...
<FromGitter>
<Souravgoswami> Well btw... Same thing! :D
duane has quit [Ping timeout: 265 seconds]
ht_ has quit [Quit: ht_]
<FromGitter>
<Meloncon> Hi! I have a `process = Process.run(cmd, args, output: Process::Redirect::Pipe)` which returns a Process::Status object. I can check the status, etc. But how do I get the output of the cmd that was ran?
<FromGitter>
<tenebrousedge> use backticks
<FromGitter>
<tenebrousedge> would be the easy answer
<FromGitter>
<Meloncon> Hi @tenebrousedge : I tried that, but I think I'm running into a buffer problem. I only get partial output returned from the backticks and then it throws an unhelpful error.
<FromGitter>
<tenebrousedge> I would assume you're escaping `)` @Souravgoswami
<FromGitter>
<Souravgoswami> I didn't get it :(
<FromGitter>
<Souravgoswami> Oh I need one space! Don't mind but that's weird! I even get the space included!
<FromGitter>
<tenebrousedge> uh, I mean check the Crystal issues list to see if there are any open or closed issues related to this
<FromGitter>
<tenebrousedge> we only rarely fix Ruby bugs here
<FromGitter>
<Souravgoswami> Sorry, from later on, I will post the https://play.crystal-lang.org/ links ... I didn't know that I could share crystal codes like that, so instead posted screenshots btw...
<FromGitter>
<tenebrousedge> you can also use github-style markdown code blocks
<FromGitter>
<Souravgoswami> Sure... But I don't think this should happen... Because %w() should create an array of the elements, except, you can't put the \ as the last element, that looks a bit odd...
<FromGitter>
<tenebrousedge> it is odd. Check to see if someone has reported it to the Crystal devs as a bug already
<FromGitter>
<Souravgoswami> I don't think so! Another question, I had a pretty bad time compiling crystal for ArchLinux ARM for the raspberry pi 3 model B. Is there any ways to get that running? Currently I don't maintain apps for ARM, and compiling is a bit problematic for myself ...
<FromGitter>
<tenebrousedge> I think people have done this but I don't know anything about it
<FromGitter>
<tenebrousedge> safe navigator is `try`
<FromGitter>
<Souravgoswami> Thanks!
<FromGitter>
<tenebrousedge> and I'm not sure what you're asking, precisely. You can iterate over an infinite range, but you can't count to infinity
<FromGitter>
<Souravgoswami> I mean, I need to clamp a number from 1000 to infinity. For example, if you enter 999 the number will be 1000, and the highest value can be any number or a bigint...
<FromGitter>
<Souravgoswami> I can use if else, but clamp is another way..
<FromGitter>
<Blacksmoke16> is `HTTP::Client` not MT safe?
<FromGitter>
<Blacksmoke16> works fine without the MT
<FromGitter>
<straight-shoota> @Blacksmoke16 Almost nothing in stdlib is threadsafe. Except for some explicitly thread-related types like `Mutex`.
<FromGitter>
<tenebrousedge> that suggests that either it's not thread safe or SSL is vicious and spiteful and has a personal grudge against you
<FromGitter>
<Blacksmoke16> ah fair enough
<FromGitter>
<Blacksmoke16> so doing HTTP requests in MT mode == bad idea atm?
<FromGitter>
<straight-shoota> Currently, we only have the basic implementation for MT, and even that's still got some rough edges. It's going to be along way for the entirety of Crystal being ready for MT.
<FromGitter>
<Blacksmoke16> 👍 fair enough
<FromGitter>
<straight-shoota> No, you should be able to do requests. But maybe not on the same client instance.
<FromGitter>
<Blacksmoke16> ah let me try that
<FromGitter>
<straight-shoota> Btw. that's even problematic with single threaded concurrency IIRC
<FromGitter>
<Blacksmoke16> seemed to work fine w/o MT
<FromGitter>
<Daniel-Worrall> Yeah I have problems using the same client for multiple requests
<FromGitter>
<Daniel-Worrall> In concurrency
<FromGitter>
<straight-shoota> > seemed to work fine w/o MT ⏎ ⏎ That's surprising