RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.1 | 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
<FromGitter> <Blacksmoke16> is there no way to reference `Nop`? https://play.crystal-lang.org/#/r/6npx
<FromGitter> <Blacksmoke16> nvm
<FromGitter> <Blacksmoke16> `.is_a? Nop`
_whitelogger has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ Now are grouping commands under the same namespace [https://gitter.im/crystal-lang/crystal?at=5ca6aa03bd70a40d5ff92e75]
<FromGitter> <Blacksmoke16> whoa that code block didnt like that
_whitelogger has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ And ability to get further detail on a specific command [https://gitter.im/crystal-lang/crystal?at=5ca6bab7bd70a40d5ff98aba]
<FromGitter> <Blacksmoke16> need to think of a good way to handle descriptions for the args
<FromGitter> <Blacksmoke16> any ideas?
DTZUZO has joined #crystal-lang
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
_whitelogger has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 2.2]
_whitelogger has joined #crystal-lang
DTZUZU has joined #crystal-lang
SerkanDevel[m]1 has quit [Remote host closed the connection]
trashhalo[m] has quit [Remote host closed the connection]
dom96 has quit [Ping timeout: 246 seconds]
dom96 has joined #crystal-lang
SerkanDevel[m]1 has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
trashhalo[m] has joined #crystal-lang
<FromGitter> <j8r> You don't need to specify the type. If you go standard, options should always be on/off switches, with `off` by default. You can also have `myvar=val` or `--myvar=val`
<FromGitter> <j8r> I created a declarative CLI that is compile-time safe if you want examples https://github.com/j8r/clicr
<FromGitter> <j8r> there is still this annoying `Invalid encoding: GB2312 (ArgumentError)` issue on Alpine 😬
DTZUZO has quit [Ping timeout: 245 seconds]
hightower2 has joined #crystal-lang
ashirase has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
SerkanDevel[m]1 has quit [Write error: Connection reset by peer]
trashhalo[m] has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
SerkanDevel[m]1 has joined #crystal-lang
Jenz has joined #crystal-lang
hightower2 has quit [Ping timeout: 255 seconds]
trashhalo[m] has joined #crystal-lang
<wuehlmaus> is the change from Time.now to Time.local etc brand new? because the main webpage about crystal still has Time.now
<wuehlmaus> puh, it is. i thought the webpage was wrong, that would be a pity, all good.
<FromGitter> <j8r> `Time.now` is deprecated
<wuehlmaus> so perhaps the example on crystal-lang.org should be changed :-)
<wuehlmaus> plus the example on wikipedia
<FromGitter> <j8r> true
<FromGitter> <j8r> it's worth to mention this in https://github.com/crystal-lang/crystal/pull/7586, for crystal-lang at least.
<FromGitter> <malkomalko> Can anybody explain what's going on with https://play.crystal-lang.org/#/r/6nrt ?
<jhass> Hash's default value is returned on missing keys, it's not set to the key as a missing key is accessed
<jhass> https://play.crystal-lang.org/#/r/6ns9 use block form and assign the key
<jhass> also https://play.crystal-lang.org/#/r/6nsc to illustrate the initial issue
<FromGitter> <malkomalko> Ah hah! Makes perfect sense now. Thank you
<FromGitter> <r00ster91> why does ⏎ ⏎ ```b = uninitialized Int32 ⏎ ⏎ asm("mov $$123, $0" :: "=r"(b)) ⏎ ⏎ b # => error``` ⏎ ⏎ fail? What do the different colons mean? [https://gitter.im/crystal-lang/crystal?at=5ca74251bd70a40d5ffce98b]
<FromGitter> <bew> iirc it's `<asm>:<inputs>:<outputs>:<optimization flags>` (or maybe input & output reversed)
<FromGitter> <Blacksmoke16> @j8r My thing will convert the arguments to their expected types, so i figured it would be helpful to list what each argument would get converted into
<FromGitter> <bew> @r00ster91 it was reversed: https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s5
<FromGitter> <r00ster91> but what do the different amount of colons mean?
<FromGitter> <r00ster91> on this document they always use only one colon
<FromGitter> <r00ster91> oh I think I somewhat understand now
<FromGitter> <j8r> @Blacksmoke16 the best would be to use an existing CLI builder here https://github.com/veelenga/awesome-crystal#cli-builders
<FromGitter> <j8r> not sure it's a good idea to add types to CLI variables - ARGV is all about strings.
<FromGitter> <Blacksmoke16> well it still read them as strings, just supplies them to the execute method as their converted value
<FromGitter> <j8r> I think better to have a description, explaining the expected input
<FromGitter> <Blacksmoke16> ideally yea, but have any ideas on where to have that set?
<FromGitter> <Blacksmoke16> since they just get pulled from the methods arguments in a macro...
<FromGitter> <j8r> not simple 😅
<FromGitter> <Blacksmoke16> ikr? :(
<FromGitter> <j8r> have you an example?
flaviodesousa has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ca7471925686a7dc3dcee10]
<FromGitter> <Blacksmoke16> docs just get built from the method args and name/desc class vars
<FromGitter> <Blacksmoke16> isnt any other config to say like `path - The path where to create the file`
<FromGitter> <Blacksmoke16> i suppose i could use the config file, key be name of the command, then each param/descrip
<FromGitter> <Blacksmoke16> like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ca747b1016a930a45697998]
<FromGitter> <Blacksmoke16> not a big fan of that tho :/
return0e has quit [Remote host closed the connection]
<Jenz> Why is `Time.now` deprecated?
<Jenz> Seems very sensible to me
<Jenz> (The method)
<jokke> was there a way to get the value of a type variable for a generic class/module in a method?
<jokke> *in macro context
<FromGitter> <kinxer> @Jenz I believe it's because of the addition of `Time.utc` and `Time.local` (the second of which has the same behavior as `Time.now`). The two newer methods actually specify in their names the location for the time, so it's a better interface.
<Jenz> Ah I see, OK, thanks kinxer
<FromGitter> <kinxer> Np.
<FromGitter> <michalvalasek> hey everyone!
<FromGitter> <michalvalasek> one quick question: is it normal that the instalation via homebrew takes 2 hours (and still going on)?
<FromGitter> <michalvalasek> it seems to be stuck at the `cmake -G Unix Makefiles ..` step
<FromGitter> <michalvalasek> CPU usage at 100% the whole time (clang)
<FromGitter> <Blacksmoke16> 😬
<FromGitter> <Blacksmoke16> prob not normal
<Jenz> Definitely not normal (especially it being clang)
<jokke> Jenz: hm on what would i invoke type_vars?
<jokke> i tried @type
<jokke> but that's already a TypeNode
<jokke> ahh
<jokke> it's a class method
<FromGitter> <michalvalasek> thanks!
<jokke> that doesn't make it easier
<jokke> or rather a module method
<FromGitter> <Blacksmoke16> can you make a playground link?
<FromGitter> <Blacksmoke16> dealing with types in macro land is kinda a pita since they can be a bunch of diff things depending on context
<jokke> tru
<jokke> goal is to try and use a converter of the same name as T
<jokke> for the element
<jokke> s
<FromGitter> <Blacksmoke16> so you want the types of `T` yea?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6ntp is not just not as simple as https://play.crystal-lang.org/#/r/6ntp ?
<FromGitter> <Blacksmoke16> can reference `T` in the macro
<Jenz> Wouldn't even need macros for that apparently: https://play.crystal-lang.org/#/r/6ntt
<FromGitter> <Blacksmoke16> would if you needed to do stuff with it in macro land, i.e. iterate over each type in the union
<jhass> or prefix it with another constant
<FromGitter> <Blacksmoke16> ye
return0e has joined #crystal-lang
lucasb has joined #crystal-lang
<FromGitter> <chussenot> Hi Guys I'm working on a lib to parse the events generated by the GitLab webhooks
<FromGitter> <chussenot> It's not stable
<FromGitter> <chussenot> At final state we can plan to merge it with this shard
<FromGitter> <chussenot> https://github.com/icyleaf/gitlab.cr
<FromGitter> <chussenot> cc @icyleaf
<FromGitter> <chussenot> So please, I'm looking for someone for a first review
<FromGitter> <chussenot> Cheers
<FromGitter> <chussenot> Send me a private message if you are interested to contribute
<Jenz> Nice! Personally I don't use gitlab, but any extension to the crystal ecosystem is most welcome. :D. And it's called "an example, many examples", not "exemples". XD
<FromGitter> <chussenot> thx Jenz
<FromGitter> <chussenot> the typo is fixed
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
<jhass> gotta love how both of these are hosted on github :D
<FromGitter> <Blacksmoke16> :S
<FromGitter> <TheOnlyArtz> https://play.crystal-lang.org/#/r/6nuy
<FromGitter> <TheOnlyArtz> Why doesn't it work
<FromGitter> <TheOnlyArtz> :thinking:
<FromGitter> <j8r> `require "json"`
<FromGitter> <Blacksmoke16> ^
<FromGitter> <TheOnlyArtz> Right
<FromGitter> <TheOnlyArtz> thank you.
<FromGitter> <TheOnlyArtz> I can't manage to send a JSON body ?
<FromGitter> <TheOnlyArtz> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ca77892016a930a456ae3e5]
<FromGitter> <TheOnlyArtz> Am I getting something wrong?
<FromGitter> <Blacksmoke16> try `pp response` and make sure its there
<FromGitter> <TheOnlyArtz> It's there.
<FromGitter> <TheOnlyArtz> I got the response
<FromGitter> <TheOnlyArtz> `{"source_code":["can't be blank"],"language_id":["can't be blank"]}`
<FromGitter> <TheOnlyArtz> But since I get such a message it looks like the body is wrong
<FromGitter> <TheOnlyArtz> or... didn't arrive
<FromGitter> <TheOnlyArtz> Which this is probably the case ^
<FromGitter> <Blacksmoke16> try `response.body.gets_to_end`
<FromGitter> <TheOnlyArtz> `""`
<FromGitter> <TheOnlyArtz> So the body didn't arrive?
<FromGitter> <Blacksmoke16> if it shows up in `pp response` its prob there
<FromGitter> <TheOnlyArtz> What about the body I send
<FromGitter> <TheOnlyArtz> it looks like it's not in the right place?
<FromGitter> <Blacksmoke16> according to the docs thats fine
<FromGitter> <Blacksmoke16> should just have to do `response.body_io.gets`
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/0.27.2/HTTP/Client.html#post%28url%3AString%7CURI%2Cheaders%3AHTTP%3A%3AHeaders%3F%3Dnil%2Cbody%3ABodyType%3Dnil%2Ctls%3Dnil%2C%26block%29-class-method
<FromGitter> <TheOnlyArtz> I'm telling you the request body is not okay/
<FromGitter> <TheOnlyArtz> The request body is correct according to the dummy client of the API
<FromGitter> <TheOnlyArtz> I'm sending `language_id` and `source_code` in the body
<FromGitter> <TheOnlyArtz> And the server says they are both blank
<FromGitter> <TheOnlyArtz> See ?
<FromGitter> <r00ster91> I feel like the base64 implementation is duplicated
<FromGitter> <TheOnlyArtz> I manage to get a request to work using Node.js but not with Crystal
<FromGitter> <TheOnlyArtz> What's going on
Jenz has quit [Ping timeout: 268 seconds]
<FromGitter> <TheOnlyArtz> I've managed to get it working using `Crest`
hightower2 has joined #crystal-lang
<FromGitter> <TheOnlyArtz> Is it possible to compile and run C within Crystal itself?
DTZUZO has quit [Quit: WeeChat 2.0]
<FromGitter> <Blacksmoke16> :shrug;
<FromGitter> <Blacksmoke16> isnt that the point of the bindings? to run the c code in crystal
<z64> no, crystal does not have embedded C code, etc., just C bindings
<FromGitter> <TheOnlyArtz> Alright
<FromGitter> <TheOnlyArtz> Can I force a spec to fail?
<FromGitter> <TheOnlyArtz> I want to output a stdout of my own
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/0.27.2/Spec/Methods.html#fail%28msg%2Cfile%3D__FILE__%2Cline%3D__LINE__%29-instance-method
<FromGitter> <TheOnlyArtz> I'm working on unit testing for C through Crystal as the backend
<FromGitter> <TheOnlyArtz> Finished writing a small demo for the proof of concept
<FromGitter> <TheOnlyArtz> Using the example
<FromGitter> <Blacksmoke16> neat
<FromGitter> <TheOnlyArtz> Expecting the wrong stdout
<FromGitter> <TheOnlyArtz> And it can even display when a compile error occurs and where it occurs
<FromGitter> <Blacksmoke16> i still would like to figure out a way to test compile time errors
<FromGitter> <TheOnlyArtz> Test compile time errors?
DmitryBochkarev has joined #crystal-lang
<FromGitter> <TheOnlyArtz> Something like that?
<FromGitter> <Blacksmoke16> hm
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6nw8
<FromGitter> <Blacksmoke16> to test that that program would fail to compile with error `Bar Must implement #method`
<z64> @Blacksmoke16 you can of course, test it the same way you do manually: https://play.crystal-lang.org/#/r/6nwy
<FromGitter> <Blacksmoke16> hmm, prob possible to make that a reuseable method?
<z64> certainly. ideally, you would have some `spec/compile_errors/` dir that you would put individual examples of code that shouldn't compile
<z64> (i just made a tempfile because, play.crystal-lang.org)
<z64> then you write some spec helper that runs it and returns the whole error string, or maybe you make some `record CompileResult, process_status : Process::Status, error : String`
<z64> or w/e :p
<FromGitter> <Blacksmoke16> neat
<FromGitter> <Blacksmoke16> that'll be super helpful for athena
moei has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6nxn 💯
<z64> yep
<FromGitter> <Blacksmoke16> good stuff
ternarysolo has joined #crystal-lang
hightower2 has quit [Ping timeout: 245 seconds]
<FromGitter> <TheOnlyArtz> can Crystal be used for AI and ML?
<FromGitter> <bew> Sure
<FromGitter> <TheOnlyArtz> Any examples for applications?
<FromGitter> <bew> This https://www.neuralegion.com :p
DmitryBochkarev has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
ternarysolo has quit [Ping timeout: 245 seconds]
beepdog has quit [Quit: lol]
beepdog has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> well there you go
return0e_ has joined #crystal-lang
jokke1 has joined #crystal-lang
moei has quit [Ping timeout: 255 seconds]
jokke has quit [Ping timeout: 255 seconds]
return0e has quit [Ping timeout: 255 seconds]
dom96 has quit [Ping timeout: 246 seconds]
dom96 has joined #crystal-lang
asterite has quit [Read error: Connection reset by peer]
jhass has quit [Read error: Connection reset by peer]
DeBot has joined #crystal-lang
<FromGitter> <jwoertink> Has anyone come across a html beautifier in crystal yet?
asterite has joined #crystal-lang
asterite has quit [Client Quit]
asterite has joined #crystal-lang
jhass has joined #crystal-lang
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<confact> i would take that as no. Because I haven't and anyone else is quiet.
<FromGitter> <Blacksmoke16> prob would have to make your own
_whitelogger has joined #crystal-lang