ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
Creatornator has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
heaven31415 has quit [Ping timeout: 265 seconds]
snsei has joined #crystal-lang
txdv has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
txdv has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
Creatornator has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <faustinoaq> Hey remembering these comments (https://gitter.im/crystal-lang/crystal?at=5ab01c665f188ccc15d3df76), do Haskell works in a similar way, I mean, Haskell can create an standalone executable, but also can be compiled and executed in Haskell runtime πŸ˜…
<FromGitter> <aisrael> Yes but you need a PhD in CS before you can understand monads.
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <faustinoaq> Nah πŸ˜„
<FromGitter> <faustinoaq> Haskell is pure functional but is not that hard to understand πŸ˜‰
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
snsei_ has quit [Remote host closed the connection]
ryan_ford has joined #crystal-lang
<FromGitter> <bew> @mlobl you don't need to take a tuple as arguments, you can directly pass the arguments: `def walk(d = @root, &block : String, Array(String), Array(String) ->)` and simply call it as: `block.call d.path, dirs, files`
Yxhvd has joined #crystal-lang
Yxhuvud has quit [*.net *.split]
Groogy has quit [*.net *.split]
bazaar_ has quit [*.net *.split]
bazaar has joined #crystal-lang
Groogy has joined #crystal-lang
alex`` has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
<FromGitter> <ryankshah> @yxhuvud Sorry for the late reply to what you said about `<<<` and `>>>`. You said you are missing these, is there going to be an implementation for them in the near future?
<FromGitter> <ryankshah> Or is there a way I can achieve the same effect at this moment?
<Groogy> Morning!
<Groogy> <<< and >>> are unsigned bitshift operators right? (never seen before)
That_Guy_Anon has joined #crystal-lang
<FromGitter> <yxhuvud> No, arithmetic vs logical shift. One of them doesn't exist as it is the same as the other variant in the same direction
hightower has joined #crystal-lang
<Groogy> ah
remix2000 has quit [Quit: The Lounge - https://thelounge.github.io]
remix2000 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> So, it seems there is something which "should never be nil" but apperently can be in the `HTTP::Client` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ab377f1e4ff28713a5f34f4]
<FromGitter> <aisrael> @ryankshah Shouldn't it be rather easy to define, e.g., arithmetic left shift in terms of `<<` and masking using `&` and `|`?
<FromGitter> <ryankshah> @yxhuvud example?
<FromGitter> <ryankshah> @aisrael Yeah it should be easy enough, but it just makes the code a bit more untidy compared to having the operator
rohitpaulk has quit [Ping timeout: 276 seconds]
heaven31415 has joined #crystal-lang
<FromGitter> <petoem> i looked at the crystal source and llvm doc, there is ashr and lshr ⏎ based on the method `unsafe_shr`, I found this weird line: https://github.com/crystal-lang/crystal/blob/84288b7af588c7e00dc004ad21f5c9ec5be50f83/src/compiler/crystal/codegen/primitives.cr#L130 ⏎ if it is a signed number it does arithmetic shift right and if not it does logical shift?
Papierkorb has joined #crystal-lang
heaven31415 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<FromGitter> <ryankshah> Oh right so it takes into account the operations of both arithmetic and logical shift based on that precondition?
<FromGitter> <codenoid> morning
<FromGitter> <petoem> @ryankshah as far as i can tell, `>>` does arithmetic shift for signed numbers ⏎ for unsigned numbers `>>` does logical ⏎ `<<` does a normal left shift
<FromGitter> <aisrael> ☝️ I did a quick test and, yes, it does look like `>>` preserves the sign bit / performs an arithmetic shift right.
<FromGitter> <Jens0512> How can I use unix pipes like ``` ⏎ ls | my_crystal_prog ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5ab38eebe4ff28713a5fafad]
<FromGitter> <Jens0512> (I mean, how do I implement it in crystal)
<FromGitter> <Jens0512> Wait, is that was `ARGF` is?
<FromGitter> <Jens0512> Never understood what `ARGF` is..
<FromGitter> <Jens0512> Oh it is, haha, sorry for the intruition, now im out, see ya
duane has quit [Ping timeout: 276 seconds]
<FromGitter> <ryankshah> @petoem @aisrael that's good then. To be fair I've not seen many things that use a logical left shift (`<<<`) anyways
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
duane has joined #crystal-lang
rohitpaulk has joined #crystal-lang
shalmezad has joined #crystal-lang
<FromGitter> <yxhuvud> https://github.com/yxhuvud/hdrhistogram/blob/master/src/hdr_histogram/codec.cr#L20 is the only place I've ever needed it.
<FromGitter> <yxhuvud> (or if it were somewere else in that file. hrrm)
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 256 seconds]
<FromGitter> <sclee15> does Crystal has async await like C#
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <j8r> @sclee15 no, and this is good. There are channels via fibers: https://crystal-lang.org/docs/guides/concurrency.html
<FromGitter> <j8r> hum fibers that communicate via channels I want to say
That_Guy_Anon has quit [Remote host closed the connection]
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 276 seconds]
<FromGitter> <mlobl> @bew didn't know, thank you!
z64 has joined #crystal-lang
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
shalmezad has quit [Quit: This computer has gone to sleep]
shalmezad has joined #crystal-lang
<hmans> I can't find an acme client (Let's Encrypt) for Crystal... or am I being blind and stupid?
<hmans> (for automatic application-bound provisioning of LE certificates)
<FromGitter> <straight-shoota> never heard of there being one
<FromGitter> <straight-shoota> but it should be very difficult to write one
<FromGitter> <straight-shoota> for example porting https://github.com/diafygi/acme-tiny/blob/master/acme_tiny.py to Crystal
<FromGitter> <mlobl> I created this (https://stackoverflow.com/questions/49433138/recursive-block-expansion-error-when-recursively-yielding/49433539#49433539) stack overflow question + answer based on help from this channel yesterday to pass on learnings. If I misunderstood something, please let me know and I'll gladly correct it
rohitpaulk has quit [Ping timeout: 240 seconds]
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Remote host closed the connection]
<FromGitter> <j8r> and if someone plans do to one, please a ACMEv2!
Papierkorb has joined #crystal-lang
<FromGitter> <bew> @mlobl you still have the tuple in argiment in the answer on SO, otherwise it's ok ;)
<FromGitter> <aisrael> I was almost tempted to work on an ACME v2 clientβ€”but so many other things to do!
<FromGitter> <j8r> @aisrael agreed! Also, we can keep this for a newcomer that wants a simple project to learn Crystal :)
Papierkorb has left #crystal-lang ["Konversation terminated!"]
ryan_ford has quit [Ping timeout: 240 seconds]
Groogy2 has joined #crystal-lang
<oprypin> i dont get the point of writing letsencrypt clients in all languages. just use an existing one
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
Groogy_ has joined #crystal-lang
<FromGitter> <Blacksmoke16> How would you guys handle scheduled jobs. build a crystal file for each job and have a run run that every x y?
azur_kind has joined #crystal-lang
<FromGitter> <fridgerator> there is this : https://github.com/robacarp/mosquito
<FromGitter> <fridgerator> i've never used it though
<FromGitter> <mlobl> @bew thanks for looking it over! Just updated the old copy paste :)
<FromGitter> <Blacksmoke16> thanks @fridgerator ill have to look into it, the periodic jobs feature seems what i am looking to do
<Groogy> how do I create a directory in crystal?
<Groogy> nvm
learod has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
learod has quit [Remote host closed the connection]
azur_kind has quit [Remote host closed the connection]
gewo has quit [Quit: WeeChat 1.6]
<FromGitter> <straight-shoota> @oprypin I don't think it's worth it just to have another CLI but a native implementation can be useful for integrating custom (sub)domains in a webapp.
learod has joined #crystal-lang
<robacarp> @blacksmoke16 if you have any feedback on mosquito, please let me know. I'd like to hear your thoughts.
<oprypin> straight-shoota, how about using an existing CLI for integrating custom (sub)domains in a webapp
<FromGitter> <straight-shoota> sure, that's probably easier
return0e has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
return0e has joined #crystal-lang
shalmezad has quit [Quit: Leaving]
<Groogy> I have a method defined like this, https://gist.github.com/Groogy/ce91f75cddb49aed1cfce630fd9a106b
<Groogy> the klass is a klass provided of what I want to construct. But I want to do a specialized one for Arrays... how would I do that?
<FromGitter> <straight-shoota> you should be able to add an overload with type restricted to `Array.class`
<Groogy> Ah of course
<Groogy> yepp that compiles thanks
rohitpaulk has quit [Ping timeout: 265 seconds]
duane has quit [Ping timeout: 240 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
duane has joined #crystal-lang
<Groogy> In a macro, is there a way for me to access the current methods AST object inside of {{}}?
<Groogy> without it being a method_added macro
<Groogy> sort of like @type
<Groogy> an argument is a Tuple(*U) and want to generate the code needed to iterate over with the correct types
<oprypin> Groogy, sort of like @type ? that would be @def iirc
<Groogy> hmm though I could access the argument just through {{ U }}
<Groogy> apparently, which I didn't know
learod has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> sometimes it's easier than you think ;)
learod has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
<Groogy> how do I add a Char to a string without it becomming like \0\0\u5574\0\0\0, etc :/
<Groogy> want it to be the binary representation of the char in the string
<Groogy> tryingto encode data but might be going about it wrong
<oprypin> Groogy, what..
<Groogy> yeah trying to make the file size smaller
<oprypin> what..
<Groogy> yeah and I am trying to do sort of a binary blob string
That_Guy_Anon has quit [Ping timeout: 240 seconds]
<FromGitter> <straight-shoota> \0\0\u5574\0\0\0 is just the inspection format
<FromGitter> <straight-shoota> Not sure what you want to do but maybe it helps
learod_ has joined #crystal-lang