<pn-max>
oprypin, the reason I used codes instead of keys is because I missed the parse method in the crystal enums /facepalm
<FromGitter>
<girng> wow, so i recently update to the latest april update on windows. crystal compiles now way faster,
<FromGitter>
<girng> such a night n day difference, im loving it
<FromGitter>
<girng> in the WSL issue, someone suggested that i update and i did but the problem is still happening: can see it in action here (https://streamable.com/9mch8). i wonder what's going on
<FromGitter>
<Blacksmoke16> crystal on windows?
<FromGitter>
<Blacksmoke16> thats a thing now?
<FromGitter>
<girng> lol yes
<FromGitter>
<Blacksmoke16> nice
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> (using WSL)
gizmore has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
gizmore|2 has quit [Ping timeout: 256 seconds]
<FromGitter>
<Blacksmoke16> ah
greengriminal has joined #crystal-lang
<FromGitter>
<girng> i cry
<FromGitter>
<girng> this not good :(
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter>
<masukomi> got what feels like a stupid question. Writing something that reads piped data. Hangs waiting for input if nothing piped to it. How do i test if there's anything in ARGF so i don't hang?
greengriminal has quit [Quit: This computer has gone to sleep]
<pn-max>
girng have you tried using the values to display something to check if you get the hiccups this way
<FromGitter>
<girng> @pn-max values from where? srry not sure what u mean
<pn-max>
the side that gets the hiccups when they're displayed in the terminal
<pn-max>
to make sure its not just the terminal display fucking up
<FromGitter>
<girng> oh, yeah it's not the terminal at all. cause i can puts the message in a regular loop outside oft he tcp server and terminal still smooth as butter
<FromGitter>
<girng> that's what i thought at first too
<FromGitter>
<girng> i mean, i tested it on a debian 9 crappy VSP, and the hiccups arn't even there through a remote SSH connection
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> Instead of visual constatation of hiccup in the display (where a lot of things could impact speed), can you time the message receive, and see if there are some 'pic' or anything (times where it takes more time), also check the message sending, maybe it's just a little delayed
<oprypin>
bararchy, it's inconsequential for you. just says some doc comments are outdated
<FromGitter>
<bararchy> k
<FromGitter>
<bararchy> having a problem generating the crsfml bindings on Ubuntu machine, on Arch it was painless, but on Ubuntu which I needed to manually install 2.5.0 It shows linking errors
<FromGitter>
<bararchy> can't find symbols etc.
<oprypin>
bararchy, did you have version 2.4 on that machine before?
<FromGitter>
<bararchy> yeha, but I removed it
<FromGitter>
<bararchy> and cleaned most of what it didn't auto-remove
<oprypin>
you need to clean up voidcsfml .so files
<FromGitter>
<bararchy> I did, purged both `lib/` and `.shards`
<FromGitter>
<bararchy> maybe I missed libsfml artifacts somewhere
<oprypin>
well that sucks
<oprypin>
are you perhaps missing some of my updates
<oprypin>
don't use your fork :p
<oprypin>
hmm seems fine
<FromGitter>
<bararchy> I do lol, but I updated my fork
<FromGitter>
<bararchy> :)
<FromGitter>
<bararchy> my fork is gold
<FromGitter>
<j8r> you can `find / -name "*sfml*"` :-D
<FromGitter>
<bararchy> I'll give you a few more days to apprechiate the buty
<FromGitter>
<bararchy> beuty
<FromGitter>
<bararchy> damn..
<FromGitter>
<bararchy> how the hell do I write this word
<FromGitter>
<bararchy> lol
<oprypin>
so i was getting the linking errors myself and i wasn't sure how i got rid of them
<oprypin>
can you paste the error
<FromGitter>
<j8r> haha, you just know how to write ugly?
<oprypin>
and also what you have in voidcsfml folder
<FromGitter>
<bararchy> why `libsfml-graphics.so.2.5 => not found` ?
<FromGitter>
<bararchy> ok, figured it out, my bad
<FromGitter>
<bararchy> All those `export`s messed the global load path
pierrearseufrasi has joined #crystal-lang
pierrearseufrasi has quit [Quit: Leaving]
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter>
<hmans> What's the canonical way (if there is one) of adding command line argument support to a Crystal CLI app?
<FromGitter>
<hmans> I'm guessing the `OptionParser` module?
<oprypin>
hmans, the canonical way is by using `ARGV` in whatever way you please. one of those ways (you mentioned) happens to be in the standard library
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<FromGitter>
<hmans> :)
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37_ is now known as p0p0pr37
greengriminal has quit [Quit: This computer has gone to sleep]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
andrewzah has left #crystal-lang ["WeeChat 2.1"]
greengriminal has joined #crystal-lang
commavir has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
jeromegn has quit []
jeromegn has joined #crystal-lang
jeromegn has left #crystal-lang [#crystal-lang]
jeromegn has joined #crystal-lang
<Majost>
I have been trying to use docopt myself since I am fond of the concept.... but the crystal version is in need of some love since its not well documented.
<Majost>
I am trying to use a setter, and am getting compile time error of: `no overload matches 'Timberclaw::Config#file=' with type (Array(String) | Bool | Int32 | String | Nil)`
<Majost>
I suspect it may be a docopt issue that is causing this for me
<Majost>
And changing my setter to `setter file : String | Array(String)`results in: `in /usr/local/Cellar/crystal-lang/0.24.2_1/src/file.cr:172: undefined method 'check_no_null_byte' for Array(String) (compile-time type is (Array(String) | String))`
<Majost>
Which I am not sure if it is a crystal bug or something else
<oprypin>
Majost, can you start from the beginning?
<oprypin>
or just show your code
<oprypin>
oh, this is committed code?
<Majost>
yeah
<oprypin>
`def initialize(opts : Array(String))` - you realize that opts is not used?
<Majost>
Right, so docopt is a little wierd -- but opts is a Hash
<Majost>
and "--config" is the key
<Majost>
So I am trying to to a hash lookup and get back the string value
<oprypin>
ok
<oprypin>
the compiler knows that the Hash's value can be any of Array(String) | Bool | Int32 | String | Nil
<Majost>
Oh, so I need to allow that getter to be any of those types?
<Majost>
er setter rather
<oprypin>
I repeat `file = @opts["--config"].as(String)`
<oprypin>
you make a type assertion
<Majost>
So it should be: `setter file : Array(String) | Bool | Int32 | String | Nil`
<oprypin>
you are 100% sure that it will be a string. docopt guarantees that, the compiler just has no way to perceive that "verbal" guarantee
<Majost>
ah
<Majost>
cool
<Majost>
Thanks
<Majost>
=)
<oprypin>
it would be such a "fun" project to implement docopt which actually conveys this guarantee to the compiler
<oprypin>
it's doable because macros are turing-complete
<oprypin>
but it's still implementing docopt in macros xD
<oprypin>
hm actually with `macro run` it would not be so bad
<Majost>
hehe
<oprypin>
i should look into it
<Majost>
I like the whole docopt concept a lot... it forces you to create your code around the experience you want people to have
<oprypin>
its reputation has only been going downhill in recent years
<oprypin>
but hey, i still own one language port of docopt :p
<Majost>
there are some things I wish were a little different like the key names not prefix with `--` and whatnot.
<Majost>
hah
<oprypin>
well the dashes are posix standard so...
<Majost>
oh I get that... I think this is implementation specific (Ruby version as well) that maintains the hyphens in the key names rather than stripping them off... eg: `@opts["--config"]` instead of @opts["config"].
<Majost>
Just a nitpick though.
<oprypin>
ah, that
<oprypin>
i think it's nice
<Majost>
I gotta head out, thanks again!
<FromGitter>
<girng> happy mother's day
<FromGitter>
<girng> ROFL. if i run `strace -ff crystal socket.cr 2> socket.strace` the hiccups don't happen
<FromGitter>
<girng> i wonder what that means, what could `strace` be doing to crystal / or WSL?