ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
duane has quit [Ping timeout: 258 seconds]
alex`` has quit [Ping timeout: 258 seconds]
return0e has quit [Ping timeout: 248 seconds]
return0e has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
duane has joined #crystal-lang
_whitelogger has joined #crystal-lang
duane has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <watzon> How would you split a number into an array of bytes?
<FromGitter> <watzon> Base on the size of literal
<FromGitter> <watzon> So a UInt32 should be divided into 32 bytes
<FromGitter> <watzon> Probably back to ByteFormat huh
absolutejam1 has joined #crystal-lang
<FromGitter> <watzon> Yup that's it, problem solved
return0e has quit [Read error: Connection reset by peer]
return0e_ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
early` has quit [Ping timeout: 248 seconds]
early has joined #crystal-lang
rohitpaulk has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
absolutejam has joined #crystal-lang
<absolutejam> What's the normal process of looking for a crystal library?
<absolutejam> Just GitHub?
<absolutejam> Looking for a library that provides nice abstractions for writing CLI apps in this case
<FromGitter> <watzon> https://crystalshards.org/
<absolutejam> TIL, ty
<FromGitter> <watzon> or https://shards.info
<FromGitter> <watzon> but I use github a lot
rohitpaulk has joined #crystal-lang
<absolutejam> I'm kinda amazed at how good the docs are
absolutejam1 has joined #crystal-lang
tdc has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 258 seconds]
absolutejam1 has joined #crystal-lang
flaviodesousa has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 245 seconds]
absolutejam1 has quit [Ping timeout: 245 seconds]
<FromGitter> <girng> @absolutejam yep, lots of good examples
<FromGitter> <girng> too, i love the docs
<FromGitter> <mwlang> @watzon I didn't know about refinements, either and I'm usually on top of what's going on in Rubyland.
<FromGitter> <mwlang> @rkeene I have not been to Binance's offices. Maybe one day.
absolutejam1 has joined #crystal-lang
sorcus has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
gangstacat has quit [Quit: Ĝis!]
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 258 seconds]
<FromGitter> <dscottboggs_gitlab> Is there any way to have the compiler guarantee a method returns? Like, the opposite of annotating a method with ` : NoReturn`, meaning all exceptions are rescued and no method calls `exit`?
<FromGitter> <dscottboggs_gitlab> (I have to go for now but I will be on for a while later, sorry)
absolutejam1 has joined #crystal-lang
gangstacat has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 268 seconds]
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 244 seconds]
tdc has quit [Ping timeout: 246 seconds]
tdc has joined #crystal-lang
duane has joined #crystal-lang
lucasb has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 248 seconds]
flaviodesousa has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 258 seconds]
<absolutejam> can anyone suggest a good CLI library? Admiral looks like the best so far but it hasn't been updated in => 8months and there's a few outstanding issues
<robacarp> absolutejam: what are you looking for in a CLI lib? options parsing? screen layout?
<absolutejam> just option parsing
<FromGitter> <j8r> absolutejam totaly biased: https://github.com/j8r/clicr
<absolutejam> with a nice DSL
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/OptionParser.html is also this in the stdlib if you just need something simple
<absolutejam> I saw that lib but I didn't really want to write huge data structures. I'll have a look and see how I get on with it
<absolutejam> j8r for my first comment
<absolutejam> Saw that Blacksmoke16 but I was hoping for something to do the heavy lifting of args, flags, subcommands, etc.
<absolutejam> I realise i'm just saying 'give me a tool that will do all the hard work' but I'm just curious if there's something appropriate out there
<FromGitter> <j8r> Clicr is aimed to be declarative and compile time validation. Usefull for bigger projects
<FromGitter> <j8r> For little projects `OptionParser` is perfectly fine
<FromGitter> <Blacksmoke16> way im using it is a class with properites
<FromGitter> <Blacksmoke16> new up a obj, use the parser to set properties on the obj from option parser, then execute some method on the obj to do you want
<FromGitter> <dscottboggs_gitlab> I often just do a `while arg = args.shift?` loop for smaller stuff
<FromGitter> <Blacksmoke16> idk if there are better ways
absolutejam1 has joined #crystal-lang
<FromGitter> <j8r> @dscottboggs_gitlab this involves lot of boilerplating
<robacarp> absolutejam: honestly, I'd say do the absolute simplest thing possible. it's pretty uncommon that I need a full fledged option parsing library... either a bare loop as @dscottboggs mentioned, or using OptionParser from stdlib is what I use. Less external dependencies is better.
<robacarp> I do wish that the stdlib option parsing were better, but I'd rather deal with the inadequacies of it than import a third party library for it.
<absolutejam> hm, looks like crystal itself uses OptionParser so I'll give that a go
<absolutejam> *shrug* don't see harm in a third party lib as long as it's active
<absolutejam> Blacksmoke16: Any chance you have any examples?
<FromGitter> <j8r> anyway I'm not aware of any CLI builder which is compile-time safe (for duplicate commands, options, variables)
<FromGitter> <Blacksmoke16> the `invalid_option` block reasoning is i want to pass args that i dont match, to just be passed to the binary im calling
<FromGitter> <Blacksmoke16> prob dont need that for your thing tho
absolutejam1 has quit [Ping timeout: 268 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1cc92db8926b674fd71abe]
<FromGitter> <Blacksmoke16> this only matches files?
<FromGitter> <Blacksmoke16> or things without `-`
<robacarp> eh, it matches a bunch of stuff. you can't really _know_ that a file doesn't start with `-` without asking the filesystem
<robacarp> it matches anything which wasn't declared as an opt
<FromGitter> <Blacksmoke16> which is diff than the `invalid_option` one?
<FromGitter> <Blacksmoke16> ah
<robacarp> I'm not sure. Older api maybe?
<FromGitter> <Blacksmoke16> that is specific ones but the `unknown_args` returns array of *ALL* them
<FromGitter> <Blacksmoke16> thats prob the diff
<robacarp> oh, you get all of them at once
<FromGitter> <Blacksmoke16> gotcha, might look into that. seems like a better solution for something im doing
<robacarp> I find the notion of "a command line interface" to be way too vague. To me a command line interface is like vim or weechat. But a _lot_ of people seem to think a command line interface is the flags you pass to a command.
<absolutejam> eh, CLI = parsing args, TUI = ncurses like interface
<robacarp> it makes it hard to distinguish what https://github.com/robacarp/keimeno is for
<robacarp> oh interesting, I dont think I'm aware of the term TUI
<absolutejam> ty for the examples
<absolutejam> I'll play with OptionParser a little
<robacarp> I find that very counterintuitive
absolutejam1 has joined #crystal-lang
<robacarp> absolutejam: thanks for defining CLI and TUI for me, I think that clarifies a bunch of misunderstandings I've had
absolutejam1 has quit [Ping timeout: 272 seconds]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
<FromGitter> <mwlang> just spent a couple hours reading through Crystal issues and specifically splitting out stdlib to shards as well as the related Markdown discussion.
<FromGitter> <mwlang> glad to see others see the same issues with markdown and ```crystal docs``` as I do.
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 248 seconds]
<FromGitter> <mwlang> This is starting to get old and it's happening more frequently, to the point, even direct calls to ```crystal spec``` is leading to this error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1ce951be7a46664462b66c]
<FromGitter> <mwlang> any idea how I can even begin to debug this one or set up a test scenario that can be replicated so I can open a proper issue ticket?
<FromGitter> <watzon> Do you know where the error is occurring? Looks like it has something to do with `Process#initialize`
<FromGitter> <watzon> When I get errors like this I always comment things out until the error is gone and then go over the code that's causing the error with a fine tooth comb
rohitpaulk has joined #crystal-lang
<FromGitter> <mwlang> I'm not at all sure where it's occurring.
<FromGitter> <mwlang> but will see if I can flush this puppy out with a bit of commenting.
<FromGitter> <mwlang> I'll also start running the specs with -d and --error-trace to see if more info presents itself.
<FromGitter> <Blacksmoke16> going to say it again, make sure all your paths/requires are correct
<FromGitter> <Blacksmoke16> if possible try this on `0.28.0`
<FromGitter> <Blacksmoke16> was a bug that allows you to reference nonexisting paths, vs now it doesnt compile
<FromGitter> <watzon> I really wish this kind of thing would work correctly
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1cece5b8926b674fd87798]
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> wait
<FromGitter> <watzon> Maybe this will help https://github.com/crystal-lang/crystal/pull/4837
<FromGitter> <Blacksmoke16> nvm, this isnt the issue i thought it was.
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1cedbf6658420b1cebb8e6]
<FromGitter> <Blacksmoke16> thats what i wanted
<FromGitter> <Blacksmoke16> but i suppose you could define some method on the enum to do something similar
<FromGitter> <watzon> That's true
<FromGitter> <mwlang> I'm on 0.29.0 and I think as of couple days ago with fixing the shards.lock issue, my paths should all be correct at this point.
absolutejam1 has joined #crystal-lang
return0e_ has quit [Ping timeout: 258 seconds]
<FromGitter> <watzon> Is it possible to write to an IO at a specific point? I know you can `read_at`, but I don't see a `write_at`
return0e has joined #crystal-lang
<FromGitter> <watzon> I guess I could probably set `pos`?
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 246 seconds]
<FromGitter> <mwlang> d-oh! Finally figured out reason for my tmp file woes. I had guardian running in another terminal window, so two guardians were running at once.
<FromGitter> <Blacksmoke16> :S
<FromGitter> <Blacksmoke16> nice one
<FromGitter> <Blacksmoke16> pebkac
<FromGitter> <girng> what is guardian
<FromGitter> <Blacksmoke16> rebuilds your code on change
<FromGitter> <mwlang> auto runs crystal specs on file saves.
<FromGitter> <girng> wtf i want that
<FromGitter> <mwlang> or really any command you give it.
<FromGitter> <girng> work on WSL?
<FromGitter> <girng> i used to use something like that when i did development in nodejs
<FromGitter> <Blacksmoke16> https://github.com/f/guardian
<FromGitter> <Blacksmoke16> yea, i use `nodemon`, this would prob be easier :S
<FromGitter> <girng> nice!!
<FromGitter> <girng> this will save a lot of up arrow and enter key presses LOLOL
<FromGitter> <mwlang> It's nice not to have to keep toggling back and forth, too.
<FromGitter> <mwlang> can just stay in the editor and keep on hacking away.
<FromGitter> <mwlang> The challenge for me is I got used to Ruby taking it's sweet ole time running specs. I'm not used to this 263.8 milliseconds crap.
<FromGitter> <Blacksmoke16> :P
<FromGitter> <mwlang> I've been heavily refactoring the binance shard I've been working on and happy how it's coming together.
gangstacat has quit [Ping timeout: 252 seconds]
gangstacat has joined #crystal-lang
absolutejam2 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 248 seconds]
tdc_ has joined #crystal-lang
tdc has quit [Ping timeout: 245 seconds]
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 245 seconds]
<FromGitter> <j8r> Unfortunaltly file watchers don't use inotify :(
tdog has joined #crystal-lang
tdc_ has quit [Ping timeout: 245 seconds]
absolutejam3 has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 268 seconds]
<FromGitter> <mwlang> Does inotify port to macos?
<FromGitter> <dscottboggs_gitlab> ☝️ July 3, 2019 4:09 PM (https://gitter.im/crystal-lang/crystal?at=5d1d0b655ce02535b01a1586) in guardian? why not??
<FromGitter> <dscottboggs_gitlab> ☝️ July 3, 2019 5:34 PM (https://gitter.im/crystal-lang/crystal?at=5d1d1f61be7a46664464a0bd) what does this mean?
<FromGitter> <mwlang> just wondering if macos' filesystem has inotify or if that's strictly a Linux thing.
<FromGitter> <Blacksmoke16> oh MacOS
<FromGitter> <dscottboggs_gitlab> oh... MacOS.... I read that as `macros`
<FromGitter> <Blacksmoke16> same :P
<FromGitter> <dscottboggs_gitlab> lol
<FromGitter> <mwlang> LOL
<FromGitter> <dscottboggs_gitlab> no
<FromGitter> <dscottboggs_gitlab> MacOS might have something that's *translatable* to inotify, but inotify is a Linux thing.
<FromGitter> <dscottboggs_gitlab> It wouldn't work on BSDs either, afaik
<FromGitter> <mwlang> MacOS derived from BSD, so makes sense.
<FromGitter> <dscottboggs_gitlab> mmhmm
<FromGitter> <mwlang> Ok, which is considered more idiomatic? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1d20ae84e3391a5acf149d]
<FromGitter> <dscottboggs_gitlab> I think the latter option is compile-time so it would be preferred
<FromGitter> <mwlang> I didn't even think about that aspect of the picture.
<FromGitter> <dscottboggs_gitlab> I would also ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ in case the implementation of `#optional_param` changed. [https://gitter.im/crystal-lang/crystal?at=5d1d23b1b8926b674fda4910]
<FromGitter> <Blacksmoke16> What's that do
<FromGitter> <dscottboggs_gitlab> What do you mean?
<FromGitter> <dscottboggs_gitlab> It calls the other overloads of #optional_param in an inline function
<FromGitter> <mwlang> Nice suggestion, @dscottboggs_gitlab
<FromGitter> <dscottboggs_gitlab> thank you
<FromGitter> <mwlang> and with that, I'm now feature complete on REST endpoint for Binance. TGIF. Next up is Websocket endpoints, but very happy to be done with the REST side of things as that was a beast.
<FromGitter> <dscottboggs_gitlab> What's "Binance"?
<FromGitter> <mwlang> suggestions to improve welcome. I did a fair amount of refactoring today to try to improve areas I have learned in Crystal language along the way.
<FromGitter> <watzon> Crypto exchange
<FromGitter> <mwlang> cryptocurrency exchange
<FromGitter> <dscottboggs_gitlab> oic
<FromGitter> <dscottboggs_gitlab> @watzon crypto != cryptocurrency
<FromGitter> <dscottboggs_gitlab> Oh I remember now, that's super cool
<FromGitter> <watzon> I'm aware, but add "exchange" and it might as well be the same word
<FromGitter> <mwlang> yeah, non-programmers tend to shorten it to "cryptos" but I think the trend is trying to move away from crypto in any of the naming to "digital currencies" to be more "general populace friendly"
<FromGitter> <Blacksmoke16> Still don't really know what that does
<FromGitter> <dscottboggs_gitlab> hmm... what about a [key-signing party]https://en.wikipedia.org/wiki/Key_signing_party? That's a "crypto exchange" 😆
<FromGitter> <watzon> True
<FromGitter> <watzon> Funny thing is if you search Google for Crypto, all of the results are for Cryptocurrency
<FromGitter> <dscottboggs_gitlab> oof :(
sorcus has quit [Ping timeout: 252 seconds]
absolutejam3 has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 272 seconds]
DTZUZO has quit [Ping timeout: 258 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
DTZUZO has joined #crystal-lang