jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals 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
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
djdarkbeat_ has joined #crystal-lang
nakilon has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 264 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
nakilon has quit [Quit: WHY NOT?]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
pawnbox has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 252 seconds]
Oliphaunte has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
mark[oz] has joined #crystal-lang
onethirtyfive has quit [Read error: Connection reset by peer]
onethirtyfive has joined #crystal-lang
dannluciano has joined #crystal-lang
onethirt_ has joined #crystal-lang
onethirtyfive has quit [Read error: Connection reset by peer]
dannluciano has quit [Ping timeout: 240 seconds]
mark[oz] has quit [Remote host closed the connection]
onethirt_ has quit [Read error: Connection reset by peer]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
Philpax has quit [Ping timeout: 250 seconds]
onethirtyfive has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
onethirtyfive has joined #crystal-lang
dannluciano has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
dannluciano has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
mark_66 has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
dannluciano has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
dannluciano has quit [Ping timeout: 276 seconds]
A124 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
rolha has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
efi has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
snsei_ has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei_ has quit [Ping timeout: 265 seconds]
pawnbox has quit [Read error: Connection reset by peer]
dannluciano has joined #crystal-lang
pawnbox has joined #crystal-lang
dannluciano has quit [Ping timeout: 276 seconds]
pawnbox has quit [Quit: gotta go guys.]
snsei has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
efi has quit [Ping timeout: 250 seconds]
<RX14> why does crystal spec never show me the abcktrace properly
<RX14> it's always somewhere in CallStack::unwind
zodiak_ has joined #crystal-lang
dannluciano has joined #crystal-lang
zodiak has quit [Ping timeout: 240 seconds]
dannluciano has quit [Ping timeout: 244 seconds]
trapped has joined #crystal-lang
Philpax has joined #crystal-lang
<RX14> also time doesn't have equals
<RX14> oh wait i'm stupid
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
<BlaXpirit> i want to test how finalizers work but i can't seem to get any object to be collected
Oliphaunte has joined #crystal-lang
<BlaXpirit> namely, can an inherited class disable the finalizer?
<BlaXpirit> https://bpaste.net/show/16afaf8c0360 and nothing is printed
Oliphaunte has quit [Remote host closed the connection]
dannluciano has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
djdarkbeat_ has quit [Quit: djdarkbeat_]
trapped has quit [Read error: Connection reset by peer]
willl has joined #crystal-lang
Oliphaunte has joined #crystal-lang
<BlaXpirit> help
<FromGitter> <sdogruyol> that's some weird stuff
<BlaXpirit> i've tried so many things, it's driving me crazy, at this point i'm doubting the existence of GC
<RX14> BlaXpirit, i don't think GC.collect is guarantted to collect everything
<BlaXpirit> i don't care, just show me any proof of a `finalize` method ever being called
<FromGitter> <sdogruyol> does it have to?
<RX14> try creating an object, setting the reference to nil
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<RX14> then allocating some large things
<BlaXpirit> nothing
Philpax has quit [Ping timeout: 258 seconds]
<RX14> the GC doesn't exist
<RX14> well
<RX14> doesnt work
<BlaXpirit> uhhh cool
<RX14> i made a 4gb array
<RX14> nilled it
<RX14> and did that 5 times
<RX14> and it just doesn't collect the old arrays
<asterite> BlaXpirit: there's a small bug right now, a class without an initialize method never gets its finalize method invoked
<asterite> if you put an empty initialize method it should work
<BlaXpirit> and so it does
paulcsmith_ has joined #crystal-lang
<RX14> repeatedly creating large arrays does make the GC stop working effectively
<RX14> but then again that is what the warnings say
<RX14> repeatedly allocating 100 1 gigabyte chunks should really work
<RX14> if i allocate 512mb chunks it's ok, seems to use about 10x it's largest allocation
<RX14> 11x actually
mark_66 has quit [Remote host closed the connection]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 265 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
dannluciano has joined #crystal-lang
tomchapin has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
dannluciano has quit [Ping timeout: 244 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomchapin has joined #crystal-lang
<FromGitter> <jwoertink> Hey, is there anyone around with a local kemal app that can check something for me real quick?
<FromGitter> <jwoertink> just boot a kemal app locally, and then `ps aux | grep crystal`. I want to see if you get 2 processes
<FromGitter> <jwoertink> one of them should look something like `~/.cache/crystal/crystal-run-app.tmp`
<FromGitter> <jwoertink> The other one will just be your `crystal whatever.cr` process
<BlaXpirit> i don't understand the point of the quiz... and it's about ruby, not crystal?
<BlaXpirit> well it's a bit wonky
<BlaXpirit> scratch that, it's crazy
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<BlaXpirit> hm i've always wanted methods and macros to be interchangable. why can't I call a macro from outside if it's defined in a class?
overnet has joined #crystal-lang
Oliphaunte has joined #crystal-lang
<overnet> where am I ?
matp has quit [Remote host closed the connection]
<overnet> 1995
<FromGitter> <jwoertink> because you're using IRC?
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
overnet has quit [Quit: Page closed]
matp has joined #crystal-lang
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
<FromGitter> <jwoertink> @sdogruyol https://github.com/jwoertink/guard-kemal it's working! Will auto-reload your kemal app when you make changes to the watched files
<FromGitter> <sdogruyol> wow
<FromGitter> <sdogruyol> how did you make it work?
<FromGitter> <jwoertink> guard will run the `start` method, which just does `crystal app.cr`
<FromGitter> <jwoertink> when you make a change to your watched file, guard will run the `stop` method.
<FromGitter> <sdogruyol> oh that line
<FromGitter> <jwoertink> Here's where it gets tricky. Since 2 processes are created, I have to kill the parent process, and to find that, I run this command
<FromGitter> <jwoertink> if you have multiple kemal apps running locally, it kills them all since their parent processes are all named the same
<FromGitter> <sdogruyol> hmm yeah
<FromGitter> <jwoertink> provided that the files used to boot all of them are named the same
<FromGitter> <sdogruyol> maybe you can use foreman for that?
<FromGitter> <jwoertink> Yeah, using foreman for booting multiple apps already
<FromGitter> <sdogruyol> cool
<FromGitter> <jwoertink> if the server files are named different for each app, then it doesn't matter
<FromGitter> <jwoertink> i.e. `app1/server1.cr` `app2/server2.cr`, etc...
<FromGitter> <sdogruyol> it should be
<FromGitter> <jwoertink> doing `app1/server.cr` and `app2/server.cr` is where the issue comes up
<FromGitter> <jwoertink> because both files are called `server.cr`
<FromGitter> <sdogruyol> ugh, yeah that's tough
<FromGitter> <jmoriau> @jwoertink your app runs/stop and rerun the app each time a change is made to the file ?
<FromGitter> <jwoertink> It will reload kemal any time you make a change to the file. So that way you don't have to `ctrl C` and then reboot the app each time
<FromGitter> <jmoriau> ok so why not just store the PID of the newly started process alongside the filename
<FromGitter> <jmoriau> that way when filename change you just kill the PID
<FromGitter> <jmoriau> and you don't need to worry about other app's name
<FromGitter> <jwoertink> however, the `@crystal_pid` in this case is technically a "child" process.
<FromGitter> <jwoertink> I have to kill the parent process for this to work
<FromGitter> <jmoriau> Ah sry I didn't read the code just the chat :p
<FromGitter> <jwoertink> I'd love to know a better way!
<FromGitter> <jwoertink> Another dev told me about this pstree which would work nicley
<FromGitter> <jwoertink> nicely*
<FromGitter> <jwoertink> seems to be available on ubuntu, but would require a `brew install` for OSX
<FromGitter> <jwoertink> might not be a bad solution, just an additional step
plukevdh_ has joined #crystal-lang
paulcsmith_ has quit [Quit: Textual IRC Client: www.textualapp.com]
dannluciano has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
plukevdh_ has quit [Quit: Textual IRC Client: www.textualapp.com]
dannluciano has quit [Ping timeout: 264 seconds]
tomchapin has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <jwaldrip> How do you specify multiple proc argument types?
<FromGitter> <jwaldrip> ```def initialize(&block : Proc(Proc(T), Proc(Exception))```
<FromGitter> <jwaldrip> That doesnt seem to work
<FromGitter> <jwaldrip> the block takes two procs
<FromGitter> <jwaldrip> how does that type definition look
<jwaldrip> asterite: ?
soveran has joined #crystal-lang
<FromGitter> <jwaldrip> ???
<FromGitter> <jwaldrip> Anyone here?
<RX14> BlaXpirit, you know you can call a macro from outside a class as long as it's not private...
<RX14> BlaXpirit, https://carc.in/#/r/150s
<BlaXpirit> RX14, https://carc.in/#/r/150t
<RX14> macros are class methods, there's no way they would make sense as instance methods
<BlaXpirit> uhh ...
<RX14> BlaXpirit, yes?
soveran has quit [Remote host closed the connection]
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
adaoraul has joined #crystal-lang
kulelu88 has joined #crystal-lang
zz_Cidan is now known as Cidan
Oliphaunte has quit []
<FromGitter> <jwaldrip> What does a raise return?
<FromGitter> <jwaldrip> I am getting the following message when I have a raise at the end of the block
<FromGitter> <jwaldrip> can't infer block return type, try to cast the block body with `as`. See: https://github.com/crystal-lang/crystal/wiki/Compiler-error-messages#cant-infer-block-return-type
<BlaXpirit> jwaldrip, it makes the function not return
<BlaXpirit> please give example code, i can explain then
<FromGitter> <jwaldrip> One sec, let me push it up
<BlaXpirit> jwaldrip, well yeah... i guess this block can never return but it needs to have a return type
<BlaXpirit> try adding another line - just `nil` - below
<BlaXpirit> looks unusual
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<FromGitter> <jwaldrip> yea, thats what I did
<FromGitter> <jwaldrip> Void wouldn’t work?
tomchapin has joined #crystal-lang
<BlaXpirit> void is such a fiddly thing, better avoid it. it's mostly for interoperability
<BlaXpirit> besides, returning nil is exactly as performant as void
<BlaXpirit> so I'm trying to structure my project like this https://gist.github.com/1d53f37c6d7b9eef5f640fdf76d2ad73 (previously it was this https://github.com/BlaXpirit/crsfml/tree/master/src )
<BlaXpirit> but I have a problem: I can't require "crsfml/network" - please advise
<BlaXpirit> (it's not /network specifically, but any particular subfolder) crsfml.cr contains require "./crsfml/graphics" and that works fine
<BlaXpirit> added an alternative option to gist, it seems to work
<RX14> BlaXpirit, tree b is the right way to do it
<RX14> because src/ is basically called crsfml and on crystal's path
<BlaXpirit> i seem to remember seeing things like tree-a in multiple projects
<RX14> well
<RX14> require "foo/bar/baz" will require "foo/bar/baz.cr"
<RX14> so crsfml/network will require src/network
<RX14> .cr
<RX14> or
<BlaXpirit> RX14, yeah, i've been relying on that and it's great. but
<RX14> src/network/network.cr
<RX14> yes but none of them allow requiring submodules
<RX14> well
<RX14> none of them ask you to
<RX14> you would have to do "crystal_db/db/mapping"
<RX14> there's an issue about this
<BlaXpirit> thx
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 250 seconds]
<RX14> i'm nearly done with the multipart pull request
<RX14> just got the generator to finish
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adaoraul has quit [Quit: leaving]
tomchapin has joined #crystal-lang
Philpax has joined #crystal-lang