ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.5 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
soveran has joined #crystal-lang
<TheGillies> does the scheduler just rotate through fibers on a timer or do fibers send a signal to the scheduler when they have something they need done?
soveran has quit [Ping timeout: 240 seconds]
akwiatkowski has quit [Ping timeout: 260 seconds]
Kug3lis has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 245 seconds]
<FromGitter> <lucas-aragno> hey everyone! I have 2 questions that I don't seem to find an answer yet, there is something like a global instalation for shards? bc i want to set up a CLI I've checked some other examples on github but e.g. https://github.com/rhysd/crdoc I'd like to avoid making clients to clone into their `bin`
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
Renich has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
matp has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 258 seconds]
matp has joined #crystal-lang
<bmcginty> Sija: Thanks! I'm fighting something related to the typing problems currently, and that may have helped muchly.
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<FromGitter> <mosop> @lucas-aragno postinstall in shard.yml may help you. see https://github.com/crystal-lang/shards/blob/master/SPEC.md. AFAIK there is currently no way to globally manage shard libraries like "npm i -g your-cli".
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
soveran has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
<FromGitter> <andyfleming> Just launched my first crystal into production :tada:
<FromGitter> <martinium> cool
<FromGitter> <martinium> is it public?
<FromGitter> <andyfleming> Yeah, but not really anything viewable
<FromGitter> <martinium> gotcha
<FromGitter> <andyfleming> With Kemal I have multiple routes that are blocks like `get "/" do |env|…`
pawnbox has quit [Ping timeout: 264 seconds]
<FromGitter> <andyfleming> I couldn’t follow what the syntax would be to have two of those blocks be shared code
<FromGitter> <andyfleming> Is that something I can use a proc to accomplish?
<FromGitter> <ezrast> @andyfleming Like this? https://play.crystal-lang.org/#/r/1lmw
<FromGitter> <andyfleming> @ezrast Yup!
<FromGitter> <andyfleming> So would I do something like `redirect_handler = ->(env : HTTP::Server::Context) {}` for it to work for a Kemal handler?
<FromGitter> <ezrast> I don't know Kemal, but seems right.
<FromGitter> <andyfleming> I don’t think my syntax `get "/*" &redirect_handler` is correct
<FromGitter> <andyfleming> I get `undefined method '&' for String`
<FromGitter> <ezrast> `get "/*", &redirect_handler`I think
<FromGitter> <ezrast> the proc is just an argument
<FromGitter> <ezrast> syntactically anyway
<FromGitter> <andyfleming> Gotcha, that’s what I thought. I think I went down this path earlier
<FromGitter> <andyfleming> Compiler explodes and says `Module validation failed: !dbg attachment points at wrong subprogram for function`
<FromGitter> <ezrast> No idea on that one
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
mark_66 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
DeBot has quit [Read error: Connection reset by peer]
DeBot has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
akwiatkowski has joined #crystal-lang
pawnbox has joined #crystal-lang
sz0 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
gloscombe has joined #crystal-lang
<FromGitter> <benoist> hi guys
<FromGitter> <benoist> got a question about the heap
<FromGitter> <benoist> consider this code
<FromGitter> <benoist> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=589455531e4d4bd962cc4f13]
Raimondii has joined #crystal-lang
<FromGitter> <benoist> the GC stats will print GC::Stats(@heap_size=3233890304, @free_bytes=2433826816, @unmapped_bytes=0, @bytes_since_gc=0, @total_bytes=8000020608)
<FromGitter> <benoist> basically the heap size remains in size and never shrinks again
<FromGitter> <crisward> @andyfleming What about... ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ not as neat as the array proc thing but you can at least put routes before method which seems more natural. [https://gitter.im/crystal-lang/crystal?at=58945588fba5bfea06c35936]
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
<jokke> @andyfleming: maybe try crouter? :)
gloscombe has quit [Quit: Lost terminal]
<jokke> @andyfleming: it has support for stuff like get "/foo", "FooController#foo_action"
bjz has joined #crystal-lang
triangles has joined #crystal-lang
soveran has quit [Remote host closed the connection]
akwiatkowski has quit [Ping timeout: 255 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
akwiatkowski has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
akwiatkowski has quit [Ping timeout: 264 seconds]
soveran has quit [Ping timeout: 245 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 256 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
akwiatkowski has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
akwiatkowski has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
bjz_ has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
bungoman has joined #crystal-lang
bungoman_ has quit [Ping timeout: 256 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox has joined #crystal-lang
akwiatkowski has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter> <choallin> I have a question about Procs in Crystal. ⏎ How similiar are Crystal Procs to Ruby Procs? Can they be curried as well? ⏎ Also, how much of a performance decrease to I have to expect when I use a Proc?
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter> <mverzilli> sth like that?
<FromGitter> <Sija> @bmcginty I’m glad it works for you :)
<FromGitter> <choallin> @mverzilli Yes, thanks a lot. :smile: ⏎ You know how much Procs affects performance?
<FromGitter> <Sija> @bmcginty there’s some moar macro magic I’ve came up with to have more Ruby-like feel here & there - see https://gist.github.com/Sija/d0559921a7763b6f4407b441f04dabe0 & https://carc.in/#/r/1lro
bjz has quit [Quit: Textual IRC Client: www.textualapp.com]
mgarciaisaia has joined #crystal-lang
<FromGitter> <mverzilli> @choallin Honestly I'm not familiar enough with the internals of the compiler to answer that question properly, but Procs are quite heavily used throughout the std and knowing Ary I'd doubt he would use them if they caused performance issues
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgarciaisaia has quit [Quit: Leaving.]
pawnbox has quit [Remote host closed the connection]
akwiatkowski has quit [Quit: Konversation terminated!]
pawnbox has joined #crystal-lang
danielpclark has quit [Remote host closed the connection]
DeBot has quit [Read error: Connection reset by peer]
DeBot has joined #crystal-lang
<FromGitter> <lucas-aragno> thanks @mosop
mark_66 has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Kug3lis_off is now known as Kug3lis
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Dreamer3 has quit [Ping timeout: 255 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
twisterghost has quit [*.net *.split]
badeball has quit [*.net *.split]
leex has quit [*.net *.split]
leex has joined #crystal-lang
badeball has joined #crystal-lang
leafybasi has quit [*.net *.split]
endou has quit [*.net *.split]
adam12 has quit [*.net *.split]
wmoxam has quit [*.net *.split]
wmoxam has joined #crystal-lang
adam has joined #crystal-lang
endou has joined #crystal-lang
leafybasi has joined #crystal-lang
mjblack has quit [*.net *.split]
vifino has quit [*.net *.split]
justinmcp has quit [*.net *.split]
twisterghost has joined #crystal-lang
vifino has joined #crystal-lang
adam is now known as Guest95086
mjblack has joined #crystal-lang
justinmcp has joined #crystal-lang
Ven has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Raimondi has quit [*.net *.split]
mgarciaisaia has joined #crystal-lang
Raimondi has joined #crystal-lang
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 258 seconds]
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Ping timeout: 245 seconds]
mgarciaisaia1 has quit [Ping timeout: 264 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mgarciaisaia has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Dreamer3 has joined #crystal-lang
PocketKnife has joined #crystal-lang
<PocketKnife> is this a Crystal Reports channel, by chance?
soveran has quit [Remote host closed the connection]
<RX14> no
Renich has quit [Quit: leaving]
Guest95086 is now known as adam12
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 255 seconds]
mgarciaisaia1 has quit [Quit: Leaving.]
olbat has quit [Ping timeout: 256 seconds]
olbat has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pduncan has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
<adam12> Heh. Are people still working with Crystal Reports? I saw one app I use still includes it, but I think it's a VB6 app.
<RX14> you can bet that if it still exists people are using it
pawnbox_ has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has quit [Ping timeout: 245 seconds]
<maxpowa> tbh we have integration with it where i work
<maxpowa> lots of enterprises still use it
<RX14> maxpowa, yeah i'm not surprised
<RX14> how bad is it?
<maxpowa> well we interface with it in C# and it's listed on nuget so its pretty simple
bjz has joined #crystal-lang
<RX14> O
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz_ has joined #crystal-lang
abbygaly has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
<abbygaly> hi, i hope i am not interrupting anything, but I am having a simple problem which i cannot find a solution for: https://play.crystal-lang.org/#/r/1lt7
<abbygaly> specifically trying to fetch the parameter "username" from a json.mapping, when theres a chance it could be nil (possibly due to the way i load the config?)
<RX14> there's a chance config could be nil because you could call profile.config before you call lkoad_profile
<RX14> so you can't call profile.config.username because profile.config could be nil
<abbygaly> I don't see where i call profile.config first, in the snippet load_profile is called before profile.config
<RX14> you don't call profile.config first
<RX14> but you could
<abbygaly> oh i see
<RX14> asserting types based on control flow in the whole program would be super expensive
<abbygaly> so what would be a way to correct this. is there a way to garentee that the variable is of type User::Config?
<RX14> the best thing to do would be to raise if it's nil
<RX14> for example `def config; @config.not_nil!; end`
<RX14> luckilly there's a macro which does that for you
<RX14> it's getter!
<Yxhuvud> you could also provide a default value in case it happens to be nil, and use the union between the actual value and the default.
<abbygaly> getter! seemed to have corrected the issue, ill have to read up on that some more.
<abbygaly> Yxhuvud: where would i apply a default value? I attempted to try to set default values for the json.mapping, but that wasnt the correct solution.
<RX14> you could provide a default value in the constructor
<abbygaly> i assume you mean inside the load_profile? as in if the load returns a nil, then load a default json string?
<RX14> but I wouldn't recommend that here
<abbygaly> ah okay
<RX14> because it would be hard to provide a good default
<RX14> for some applications 0 or "" works until real data is loaded
<RX14> but i'm still a bit cautious of that
<abbygaly> yea it would potentially break some contents of the application since some values in the config can be 0 or blank
<RX14> abbygaly, another thing you could do is load the config in the constructor but that might be impossible or just bad design based on your program
<abbygaly> in the profile constructor? yea thats possible as well i suppose.
<abbygaly> actually i may do that
<abbygaly> that works good now, thanks RX14 and Yxhuvud. Have a good day/night
abbygaly has quit [Quit: leaving]
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 264 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]