jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.8.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Philpax_ has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 240 seconds]
Philpax__ is now known as Philpax
<Philpax> is there a way to print out a message at compile-time? (i.e. printing the size of a class/struct)
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
<willl> Philpax: {{ puts "this is compiletime" }
<willl> }
<Philpax> cheers
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
ssvb has quit [Ping timeout: 264 seconds]
rmosolgo has quit [Remote host closed the connection]
toydestroyer has quit [Ping timeout: 252 seconds]
ssvb has joined #crystal-lang
toydestroyer has joined #crystal-lang
jokke has quit [Ping timeout: 240 seconds]
rmosolgo has joined #crystal-lang
shadeslayer has quit [Ping timeout: 244 seconds]
bmcginty has quit [Ping timeout: 260 seconds]
jokke1 has joined #crystal-lang
bmcginty has joined #crystal-lang
shadeslayer has joined #crystal-lang
nakilon has quit [Ping timeout: 260 seconds]
leafybasil has joined #crystal-lang
leafybasil has quit [Client Quit]
buggs has quit [Quit: WeeChat 0.4.2]
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
<crystal-gh> [crystal] adlerhsieh opened pull request #1684: Fix typo in JSON::Mapping (master...fix-doc) http://git.io/vciYN
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
nakilon has joined #crystal-lang
rmosolgo has joined #crystal-lang
nakilon has quit [Ping timeout: 255 seconds]
rmosolgo has quit [Remote host closed the connection]
lokulin has quit [Ping timeout: 240 seconds]
lokulin has joined #crystal-lang
caryanne has quit [Ping timeout: 240 seconds]
rmosolgo has joined #crystal-lang
<crystal-gh> [crystal] technorama opened pull request #1686: Add GC.stats (master...f/basic_gc_stats) http://git.io/vci4a
<crystal-gh> [crystal] technorama closed pull request #1494: Add test vectors for Crypto::Bcrypt. (master...f/bcrypt_tests) http://git.io/vZAUj
BlaXpirit has joined #crystal-lang
NeverDie has quit [Quit: http://radiux.io/]
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
NikN9ne has joined #crystal-lang
rmosolgo has quit [Ping timeout: 246 seconds]
NeverDie has joined #crystal-lang
unshadow has joined #crystal-lang
gamemanj has joined #crystal-lang
<crystal-gh> [crystal] jhass reopened pull request #1494: Add test vectors for Crypto::Bcrypt. (master...f/bcrypt_tests) http://git.io/vZAUj
<crystal-gh> [crystal] jhass closed pull request #1684: Fix typo in JSON::Mapping (master...fix-doc) http://git.io/vciYN
buggs has joined #crystal-lang
<travis-ci> manastech/crystal#cf176e9 (master - Merge pull request #1684 from adlerhsieh/fix-doc): The build passed. https://travis-ci.org/manastech/crystal/builds/83529042
<DeBot> https://github.com/manastech/crystal/pull/1684 (Fix typo in JSON::Mapping)
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vcioa
<crystal-gh> crystal/master bc71a97 Technorama Ltd: Add GC.stats
<crystal-gh> crystal/master 415b968 Jonne Haß: Merge pull request #1686 from technorama/f/basic_gc_stats...
<ddfreyne_> Ooh, GC.stats. That’s what i was looking for yesterday :)
<jhass> wouldn't be surprised that's why dzv did it just now ;)
<travis-ci> manastech/crystal#415b968 (master - Merge pull request #1686 from technorama/f/basic_gc_stats): The build passed. https://travis-ci.org/manastech/crystal/builds/83529890
<ddfreyne_> jhass: Of course, now I need to work on exporting GC metrics :)
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 268 seconds]
<ddfreyne_> GC.stats.collections visualised!
<ddfreyne_> And now I can correlate that to frame rate, and see that frame rate drops when GC happens.
<ddfreyne_> Hm, the correlation is pretty vague. Oh well.
<ddfreyne_> Hm, the correlation is pretty vague. Oh well.
<ddfreyne_> Oops.
NeverDie has quit [Quit: http://radiux.io/]
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 240 seconds]
Philpax_ has joined #crystal-lang
Philpax__ has quit [Ping timeout: 240 seconds]
Philpax_ has quit [Ping timeout: 256 seconds]
unshadow has quit [Quit: leaving]
<ddfreyne_> Is it expected that a not fully initialised class cannot be inspected without segfaulting?
<ddfreyne_> I guess it makes sense, but still not ideal.
<jhass> ddfreyne_: should raise or compile time error IMO
<ddfreyne_> I’ll report it.
<jhass> ddfreyne_: careful with instance variables outside `` ;)
<ddfreyne_> Poor Colin O'Brien :)
<ddfreyne_> jhass: I’ve received comments in the past about this (“Stop talkig about me!!!”) and I apparently still do it.
trapped has joined #crystal-lang
apt-get has joined #crystal-lang
apt-get has quit [Ping timeout: 265 seconds]
apt-get has joined #crystal-lang
apt-get_ has joined #crystal-lang
apt-get has quit [Ping timeout: 244 seconds]
<jokke1> jhass: i'm trying to use my shard ncurses
<jokke1> and i require it (require "ncurses")
<jokke1> but when trying to run NCurses.init i get undefined method 'init' for NCurses:Module
<jhass> well, then you didn't define that method or didn't require the file that does
<jokke1> sure i did
<jokke1> both
<jhass> nope, sorry
<jhass> you didn't
<jhass> I only see an instance method init there
<jokke1> extend self
<jhass> mmh
<jokke1> bug?
<jhass> seems to work here
<jokke1> wtf
<jokke1> uh
<jokke1> no
<jhass> you know that I can't run it with that, right?
<jokke1> yeah
<jhass> your module is called Ncurses, not NCurses
<jokke1> m(
<jhass> no idea why it doesn't give undefined constant
<jokke1> probably version
<jokke1> yeah there's sr/ncurses/window
<jokke1> which is defining NCurses
<jokke1> god damn
<jhass> asterite: mind a pm?
havenwood has joined #crystal-lang
mhib has joined #crystal-lang
Sadin has joined #crystal-lang
havenwood has quit [Ping timeout: 265 seconds]
<dzv> is there a way to check if a library has a function available? GC_set_on_collection_event is needed to collect persistent stats between collections but it's not always available
Sadin has quit [Remote host closed the connection]
<BlaXpirit> dzv, what about #responds_to?
<dzv> i don't think that's involved with the linker
<BlaXpirit> then maybe u can't, i don't know
ssvb has quit [Ping timeout: 246 seconds]
vikaton has joined #crystal-lang
<vikaton> Is anyone here willing to take over and continue the Crystal Shards twitter account?
<vikaton> been busy and keep forgetting to run the bot
jokke1 is now known as jokke
<jhass> why don't you automate running it?
<vikaton> I've tried
<jhass> so?
<vikaton> but the cronjob acted in a weird way
<vikaton> I can explain in pm if you want to help so this stays on topic
<vikaton> nevermind I found the log that I couldn't find before
<jhass> there's nothing else going on, I don't mind a bit OT here
<vikaton> ok
<vikaton> my cronjob is 0 12 * * * /home/vikaton/Crystal/twit/exec >> /home/vikaton/Crystal/twit.log 2>&1
ssvb has joined #crystal-lang
<vikaton> but in the logs the error is ruby: No such file or directory -- twit.rb (LoadError)
<jhass> exec is the compiled binary?
<vikaton> yes
<jhass> mmh, I suppose no systemd or daemontools installed? :P
<vikaton> don't think so
<vikaton> some of the created files like list.json and such are created in the /home/ dir
<vikaton> so that's why it cant find twit.rb since its not in home but I'm not sure why its looking there
<jhass> try a wrapper such as http://hastebin.com/yudihejego.bash
<dzv> PATH is always /bin:/usr/bin in a cron job
<jhass> it's rather about pwd than PATH here though
<dzv> oops
<dzv> cd does work. cd Crystal/twit ; ./exec >> ...
rmosolgo has joined #crystal-lang
<jokke> is there a possibility to make a record immutable?
<jokke> or anything, as a matter of fact
<vikaton> okay, lets see at 12:00 if it works :P
<jokke> i'm a bit tired of assigning attributes of objects to variables only that type checks i do reduce the type
<jhass> jokke: no .freeze
<jokke> jhass: maybe there should be?
<jhass> maybe you shouldn't assign potential nil's to your stuff?
<jhass> >> record Foo, bar; typeof(Foo.new("foo").bar)
<DeBot> jhass: # => String - http://carc.in/#/r/hyi
<jokke> i'm dealing with user input
<jhass> >> record Foo, bar; typeof(Foo.new(["foo", nil].first.not_nil!).bar)
<DeBot> jhass: # => String - http://carc.in/#/r/hyj
<jokke> yeah sure
<jhass> >> class Foo; getter! bar; def initialize(@bar); end; end; typeof(Foo.new(["foo", nil].first).bar)
<DeBot> jhass: # => String - http://carc.in/#/r/hyk
<jokke> i'm presenting a list of objects for the user to choose from, the user can just not select anything. i need to deal with that
<jokke> not liking the idea to raise in that situation
<jhass> I don't follow how immutability would help anything
<jokke> well i can do sth like if foo.bar ... foo.bar.bla
<jokke> and don't need to bar = foo.bar if bar .. bar.bla
<jhass> sounds like it would slow down the compiler a ton
<jhass> >> class Foo; getter! bar; def initialize(@bar); end; end; typeof(Foo.new(["foo", nil].first).bar?)
<DeBot> jhass: # => String? - http://carc.in/#/r/hyl
<jhass> so with getter! you can foo.bar if foo.bar?
apt-get_ has quit [Remote host closed the connection]
<jokke> what's getter!
<jhass> getter + !
<jhass> :P
<jokke> ..
<jokke> oh ok
<jhass> you just give up that crystal forces you at compile time to handle it
<jokke> :/
greengriminal has joined #crystal-lang
havenwood has joined #crystal-lang
<RX14> what's the best way to profile crystal code?
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
<jhass> s/crystal/C/ so far I'd say
<jhass> that is ask the question for C and try applying the solution
<RX14> any way to get a nice decompile?
<jhass> what for?
<RX14> i just wat to look around what the optimiser's doing
<jhass> I think --emit ll is past the optimizer?
<RX14> invalid emit value ll?
<gamemanj> llvm-ir
<gamemanj> that is, --emit llvm-ir
<gamemanj> At least, if I'm reading the --help right :)
<jhass> right, it used to be --dump-ll :P
<jhass> willl: did you look into bytea support for crystal-pg yet? I had a stab but I'm lost as to why it returns an empty slice (PQgetlength returns 0 that is) here https://github.com/jhass/crystal-pg/blob/bytea_support/spec/pg/connection_spec.cr#L62
<RX14> it's still hard to find where your damn function is
<jhass> RX14: --prelude empty can help but of course not much compiles with that
<RX14> yeah, it doesn't
<willl> jhass: haven't tried to put bytea in yet, but should. thanks for giving it a try, i'll see what's up
<jhass> I have some debug prints in place, so crystal spec on that branch should get you to the right point
havenwood has joined #crystal-lang
<jhass> wait, is it that it stops on 0 bytes?
<jhass> willl: yep that's it, I kinda expected giving a length would turn that off
<jhass> willl: so I guess we have to encode to hex or escape format, http://www.postgresql.org/docs/9.1/static/datatype-binary.html meh
<willl> ah yeah that makes sense. while i switched the /result/ format to binary, the query format is still text right now
<jhass> mmh
<jhass> looking at param_formats, looks like we could just flip the corresponding items to 1?
<jhass> I'm not really up to having the entire encoder infra for just this, how does having simple_encode return a simple struct sound?
<willl> yeah it does look like you can turn on binary on a per param basis, which is nice http://www.postgresql.org/docs/9.1/static/libpq-exec.html#LIBPQ-PQEXECPARAMS
<willl> and agreed, text is fine for everything but bytea it seems, so a struct of the value and format switch would be good I think
rmosolgo has quit [Remote host closed the connection]
<jhass> cool, I'll give it a shot
<willl> awesome, thank you
<jhass> yap, that did it
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
NeverDie has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
NikN9ne has quit [Ping timeout: 260 seconds]
sdogruyol has joined #crystal-lang
<sdogruyol> hey
mhib has quit [Ping timeout: 244 seconds]
BlaXpirit has quit [Quit: Konversation]
Sadin has joined #crystal-lang
Sadin has quit [Remote host closed the connection]
Sadin has joined #crystal-lang
sdogruyol has quit [Remote host closed the connection]
Sadin has quit [Remote host closed the connection]
greengriminal has quit [Quit: Leaving]
dom96_ has joined #crystal-lang
dom96 has quit [Ping timeout: 260 seconds]
Mo0O has quit [Ping timeout: 260 seconds]
dom96_ is now known as dom96
Mo0O_ has joined #crystal-lang
Netfeed has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] waj pushed 1 new commit to master: http://git.io/vcXjJ
<crystal-gh> crystal/master 29dc55f Juan Wajnerman: Moved Scheduler#yield and Scheduler#sleep to Fiber. Fiber#yield now behaves just like sleep(0) to ensure the event loop has the chance to attend pending IO (fixes #1683)
Netfeed has joined #crystal-lang
<travis-ci> manastech/crystal#29dc55f (master - Moved Scheduler#yield and Scheduler#sleep to Fiber. Fiber#yield now behaves just like sleep(0) to ensure the event loop has the chance to attend pending IO (fixes #1683)): The build passed. https://travis-ci.org/manastech/crystal/builds/83591307
<DeBot> https://github.com/manastech/crystal/issues/1683 (Scheduler.yield does not yield to other Fiber)
nkts has joined #crystal-lang
elia has joined #crystal-lang
justinmcp has quit [Ping timeout: 256 seconds]
justinmcp has joined #crystal-lang
gamemanj has quit [Ping timeout: 240 seconds]
trapped has quit [Read error: Connection reset by peer]
apt-get has quit [Remote host closed the connection]
Sadin has joined #crystal-lang
nkts has quit [Quit: x]
rmosolgo has joined #crystal-lang
datanoise has joined #crystal-lang
datanoise has left #crystal-lang [#crystal-lang]
rmosolgo has quit [Remote host closed the connection]
Netfeed has joined #crystal-lang
Netfeed has quit [Changing host]
elia has quit [Quit: Computer has gone to sleep.]
leafybasil has joined #crystal-lang
C453 has joined #crystal-lang
<C453> how do you clear the console line? STDOUT.flush does nothing...
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
Sadin has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
<crystal-gh> [crystal] hamin opened pull request #1691: Adding CSV header support to standard library. All changes are non-br… (master...csv_header_support) http://git.io/vc19T
harisamin has joined #crystal-lang
<harisamin> hey guys and gals
<harisamin> i've been meaning to play with crystal for a while
<harisamin> got excited last night and was checking out some issues on GH. Saw some low hanging fruit with a request for adding header support to the CSV standard library, so I went ahead and made a pull request. Specs and docs and all :)
rmosolgo has quit [Remote host closed the connection]