jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.12.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
trapped has quit [Read error: Connection reset by peer]
Dreamer3 has joined #crystal-lang
sparrow_ has joined #crystal-lang
Dreamer3 has quit [Quit: Leaving...]
sparrow_ has quit [Read error: Connection reset by peer]
miketheman has quit [Ping timeout: 240 seconds]
miketheman has joined #crystal-lang
Dreamer3 has joined #crystal-lang
marcosdsanchez has quit [Read error: Connection reset by peer]
marcosdsanchez has joined #crystal-lang
greengriminal has joined #crystal-lang
pleiosaur has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pleiosaur has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
marcosdsanchez has quit [Read error: Connection reset by peer]
marcosdsanchez has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
greengriminal has quit [Quit: Leaving]
marcosdsanchez has quit [Read error: Connection reset by peer]
marcosdsanchez has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
Philpax has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
alsm has joined #crystal-lang
r00takaspin has joined #crystal-lang
dzv has quit [Ping timeout: 240 seconds]
dzv has joined #crystal-lang
r00takaspin has quit [Client Quit]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
arian0n has joined #crystal-lang
r00takaspin has joined #crystal-lang
jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.12.0 | 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
marcosdsanchez has quit [Read error: Connection reset by peer]
marcosdsanchez has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 2 new commits to master: https://git.io/v24CA
<crystal-gh> crystal/master 923bc30 Anton Davydov: Fix typo in documentation [skip ci]
<crystal-gh> crystal/master 72f11f6 Jonne Haß: Merge pull request #2225 from davydovanton/fix-typo...
<jokke> hi, does anyone know about datanoise on github?
<jokke> is he still active in the community
<jokke> i forked his mongo.cr repo a few months back and made a pull request about something very trivial (adding a shard.yml) but i've heard nothing back. Now my fork is quite a bit ahead due to several changes and improvements. i wonder if i should even bother making pull requests..
pawnbox has quit [Remote host closed the connection]
<jokke> since it seems like it's been abandoned by him/her
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#72f11f6 (master - Merge pull request #2225 from davydovanton/fix-typo): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/111715232
Gasher has joined #crystal-lang
<Gasher> hi everyone
<Gasher> I love Crystal and I'd like to thank everyone who contributed :)
<Gasher> I have a question, how can I check the type of a variable? I don't see it anywhere
<BlaXpirit> Gasher, typeof(a); a.class
<Gasher> thx
<Gasher> how is Crystal performing in a comparison with C or Go?
<jhass> ?benchmark
<DeBot> jhass: Nothing known about benchmark.
<jhass> ?benchmarks
<DeBot> jhass: Nothing known about benchmarks.
<jhass> mmh
<jhass> https://github.com/kostya/benchmarks some, judge on the quality yourself, but it should give a ballpark
<Gasher> alright, thanks
<Gasher> why aren't 0s and empty strings considered falsey? (yes, I'm from JS background)
r00takaspin has quit [Remote host closed the connection]
r00takaspin has joined #crystal-lang
<jhass> who besides PHP and JS does that?
<BlaXpirit> Gasher, because ruby has different idioms regarding falsiness
<BlaXpirit> jhass, python
<jhass> really? sigh
<BlaXpirit> jhass, in Python False == 0 even
<yxhuvud> 0 being false is pretty common
<BlaXpirit> (but they're not the same thing, just equal)
<BlaXpirit> Gasher, only nil and false are falsey
<yxhuvud> iirc, in python even time can be false, if the internal representation happen to be zero.
<BlaXpirit> that's crazy
<Gasher> BlaXpirit; I know, and it kinda sucks imho
<BlaXpirit> Gasher, understanding comes with time. difficult to explain (probably just because i cant come up with examples)
<Gasher> but it's easily fixable with one line of code, so not a biggie
<BlaXpirit> Gasher, what is fixable?
<Gasher> making something falsey
<BlaXpirit> Gasher, I don't think so
<Gasher> why not?
<BlaXpirit> Gasher, in Crystal you can't change the boolean value of an object, it's always true
<Gasher> test == false if myint == 0
<Gasher> if (test)
<Gasher> ...
<BlaXpirit> ok
<Gasher> pfut
<Gasher> "test = false"
<Gasher> or just "test = myvar == 0 ? false : true"
<BlaXpirit> Gasher, or just "test = myvar == 0
<Gasher> oh yes, but != instead of ===
<Gasher> * ==
ton31337 has joined #crystal-lang
<ton31337> does crystal support threads?
<BlaXpirit> ton31337, not really
<ton31337> what's the best way to achieve paralelism
<ton31337> ?
<Gasher> doesn't crystal support for loops?
<ton31337> but it does paralelism?
<Gasher> no idea
<ton31337> i want non blocking actions
<ton31337> The higher level concurrency/parallelism abstraction using channels is currently in development.
<Gasher> I know it's like that in Ruby, but I think it'd be better to change the "initialize" method's name to just "init" - it's simpler and locale-neutral
<Gasher> it really bothers me as I use UK English
trapped has joined #crystal-lang
ton31337 has left #crystal-lang [#crystal-lang]
<BlaXpirit> lol
<BlaXpirit> true, true
<BlaXpirit> what's worse, a typo in the method name may not be obviously detectable
<Gasher> yeah
<Gasher> I think everyone would gain if it was changed to "init"
<BlaXpirit> too late
<Gasher> BlaXpirit; why too late?
<Gasher> the language is still in alpha, it also should be fairly easy to add backwards compatibility for initialize
Philpax has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<asterite> Gasher: why 0 and empty strings are considered falsey in other languages?
<Gasher> asterite; because it's very useful
<Gasher> for example you can do something like "if err then throw err"
<asterite> You can also do `if err != 0 then throw err"
<asterite> I think in Crystal it would be confusing
<asterite> For example you can have a union of Int32 | NIl
<asterite> then you do `if value; ...; end`
<asterite> because you want to do something if you have a value (it's not nil), but then it won't work if it's zero...
<asterite> I actually find 0 and empty strings to be falsey to be rather counterintuitive, and it has led to bugs many times, if I remember correctly
<alsm> I don't like non boolean values having an inherent boolean quality, you should test for the condition you're actually looking for
<asterite> But I asked you because the rules for falsey seem arbitrary in every language :-)
<Gasher> where can I make the initalize to init suggestion?
krtv` has quit [Ping timeout: 240 seconds]
<asterite> In GitHub, though I don't think it will be changed. It also matches "finalize". And it's just used for the constructor: often, but classes usually have one constructor and many methods. For instance, in the whole standard library, just 524 occurrences of `def initialize`
<Gasher> finalize could be changed too. there could be backwards compatibility - the compiler could look for "initialize" secondarily if it hadn't found "init"
<Gasher> initialize is just too long to write and a typo magnet for non-Americans
<Gasher> Python uses __init__ for example
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v2BvZ
<crystal-gh> crystal/master c70d63b Ary Borenszweig: Refactor: Sort types inside a union type for its `to_s` (name), so names are predictable. Removed hardcoded TYPE_ID in String. Renamed `Type#type_id` to `Type#opaque_id` and rely on object_id for it, so Program doesn't need a type id counter.
A124 has quit [Ping timeout: 250 seconds]
marcosdsanchez has quit [Read error: Connection reset by peer]
emancu has joined #crystal-lang
emancu has quit [Remote host closed the connection]
marcosdsanchez has joined #crystal-lang
<asterite> Another idea is `self`. `def self(...)`. I think D uses `this()`. But, as said, I don't think we'll change it
<Gasher> it sounds good to, but like I said, I think "initialize" is really bad
<Gasher> I think anything would be better
<travis-ci> crystal-lang/crystal#c70d63b (master - Refactor: Sort types inside a union type for its `to_s` (name), so names are predictable. Removed hardcoded TYPE_ID in String. Renamed `Type#type_id` to `Type#opaque_id` and rely on object_id for it, so Program doesn't need a type id counter.): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/111763503
pawnbox_ has joined #crystal-lang
bam0 has joined #crystal-lang
alsm has quit [Ping timeout: 240 seconds]
pawnbox has quit [Ping timeout: 240 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
Renich has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/v2Brk
<crystal-gh> crystal/master 1369041 Ary Borenszweig: Semantic: make sure to sort union types by name on creation
<crystal-gh> crystal/master bc14456 Ary Borenszweig: Allow redefining primitives methods like `Int32#+(other : Int32)`
adam_ is now known as adam12
r00takaspin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#bc14456 (master - Allow redefining primitives methods like `Int32#+(other : Int32)`): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/111791532
plukevdh has joined #crystal-lang
<plukevdh> is there a reason why `YAML::Type` doesn't include `Bool`?
<plukevdh> also, is it worthwhile to anyone else to have the File#read method have an override that takes zero params and functions similarly to File.read?
<plukevdh> I guess that might actually be in IO
bam0 has quit [Ping timeout: 240 seconds]
<plukevdh> or does `gets_to_end` cover that?
<plukevdh> looks like `gets_to_end` on a file works
<plukevdh> next question, any desire for a `map` method for YAML/JSON::Any?
plukevdh has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
r00takaspin has joined #crystal-lang
<asterite> plukevdh: I think we can make JSON::Any and YAML::Any include Enumerable
<asterite> for Bool in YAML we should probably implement the "default" schema, if there's any.
pawnbox_ has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
<asterite> I guess it's this: http://www.yaml.org/spec/1.2/spec.html#id2804923 , but I don't know much about yaml
plukevdh has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/v2ReL
<crystal-gh> crystal/master a51c88c Ary Borenszweig: Union to_s: always show Nil as the last element, and use "T?" if it's a nilable type with just two elements
<crystal-gh> crystal/master 8ef7d29 Ary Borenszweig: Fixed #2226: Compiler is optimising out expressions when asking its class
tomchapin has joined #crystal-lang
tomchapin has quit [Client Quit]
mgarciaisaia1 has joined #crystal-lang
Renich has quit [Quit: leaving]
Renich has joined #crystal-lang
Ven has joined #crystal-lang
r00takaspin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
r00takaspin has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
plukevdh has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
mgarciaisaia has joined #crystal-lang
marcosdsanchez has quit [Remote host closed the connection]
marcosdsanchez has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
sp4rrow has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
mgarciaisaia has left #crystal-lang [#crystal-lang]
sp4rrow has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marcosdsanchez has quit [Read error: Connection reset by peer]
marcosdsanchez has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dreamer3_ has joined #crystal-lang
sp4rrow has joined #crystal-lang
Excureo has quit [Remote host closed the connection]
Excureo has joined #crystal-lang
dome22xl has joined #crystal-lang
pawnbox has joined #crystal-lang
Gasher has quit [Quit: Leaving]
Philpax has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
r00takaspin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
knoopx has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
dome22xl has quit [Ping timeout: 248 seconds]
_kfpratt has quit [Remote host closed the connection]
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
thor77 has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Renich has quit [Quit: leaving]
kfpratt has joined #crystal-lang
sp4rrow has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
sp4rrow has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
knoopx has quit [Remote host closed the connection]
trapped has quit [Read error: Connection reset by peer]