jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.5 | 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
<travis-ci> manastech/crystal#c99bf25 (master - Merge pull request #1137 from PragTob/improve-docs-contribution-docs): The build passed. https://travis-ci.org/manastech/crystal/builds/74845366
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
nahtnam has quit [Quit: Connection closed for inactivity]
havenwood has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/v3tMw
<crystal-gh> crystal/master 5f825a4 Ary Borenszweig: Simplified types_to_s spec by using `with ... yield`
<crystal-gh> crystal/master 1852bc4 Ary Borenszweig: Fixed #1128: improve error message for non-existant postfix increment/decrement
<travis-ci> manastech/crystal#5f825a4 (master - Simplified types_to_s spec by using `with ... yield`): The build passed. https://travis-ci.org/manastech/crystal/builds/74848084
kyrylo has quit [Quit: Konversation terminated!]
kyrylo has joined #crystal-lang
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ssvb has quit [Quit: Leaving]
havenwood has quit [Ping timeout: 265 seconds]
kyrylo has quit [Ping timeout: 240 seconds]
kyrylo has joined #crystal-lang
kyrylo has quit [Ping timeout: 255 seconds]
sailorswift has joined #crystal-lang
blue_deref has quit [Quit: bbn]
havenwood has joined #crystal-lang
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
sailorswift has joined #crystal-lang
havenwood has quit [Ping timeout: 240 seconds]
BlaXpirit has joined #crystal-lang
dbackeus has joined #crystal-lang
<crystal-gh> [crystal] PragTob closed pull request #1136: Improve documentation of struct in regards when to use it (gh-pages...when-to-use-struct) http://git.io/v3Icd
<jhass> meh, could've just rebased
elia has joined #crystal-lang
<BlaXpirit> git pull --rebase is so ez
<BlaXpirit> but you cant deny that it's a problematic pull request if it just overwrites the date in so many files
<BlaXpirit> + i dont like the tiny change itself
<jhass> could also have just removed the local commit, forwarded the branch, make a new one and force push that
jhass has left #crystal-lang ["WeeChat 1.2"]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sailorswift has joined #crystal-lang
sailorswift has quit [Client Quit]
sailorswift has joined #crystal-lang
mcgain_ has joined #crystal-lang
mcgain has quit [Ping timeout: 260 seconds]
mcgain_ is now known as mcgain
zamith has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
<dbackeus> are there any differences in using classes vs modules for namespacing?
<dbackeus> (assuming not, just want to make sure there are no caveats)
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zamith has quit [Ping timeout: 246 seconds]
zamith has joined #crystal-lang
zamith has quit [Client Quit]
mcgain_ has joined #crystal-lang
mcgain has quit [Ping timeout: 252 seconds]
mcgain_ is now known as mcgain
zamith_ has joined #crystal-lang
mcgain has quit [Client Quit]
kyrylo has joined #crystal-lang
mcgain has joined #crystal-lang
leafybasil has joined #crystal-lang
zamith__ has joined #crystal-lang
zamith_ has quit [Ping timeout: 244 seconds]
zamith___ has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
elia has quit [Read error: Connection reset by peer]
zamith__ has quit [Ping timeout: 244 seconds]
elia has joined #crystal-lang
naps62 has joined #crystal-lang
BlaXpirit_ has quit [Quit: Konversation]
<BlaXpirit> dbackeus, i didnt think nested classes were possible
<dbackeus> yeah, it's been possible in Ruby all along
<dbackeus> but most people don't know because only modules are ever documented as useful for namespacing
<BlaXpirit> dbackeus, i think the rule of thumb is use a module unless u also need to instantiate the thing
<dbackeus> yeah, agreed
<BlaXpirit> dbackeus, and another thing to note. class String::Builder is valid, which surprised me
<BlaXpirit> i'm getting expecting token 'EOF', not 'end'
<BlaXpirit> i checked and rechecked that ends match
<BlaXpirit> i dont know what to do
<BlaXpirit> welp
<BlaXpirit> it was .each |item| do
<BlaXpirit> i want to talk about utilizing assert and debug_assert in the language.
<BlaXpirit> first of all, introspecting the passed expression could be used instead of hard to remember DSLs for spec
<BlaXpirit> i'd love to see more debug-mode-only checks. first thing that comes to mind is a, b = arr - here i want debug_assert arr.length == 2
<BlaXpirit> AssertionFailed would be moved from spec to main library
<BlaXpirit> and when you write assert inside spec, you get all these different replacements
<BlaXpirit> of course, an option would be getting rid of the DSL altogether, but perhaps building on top of it would be better
<BlaXpirit> assert a == b would be turned into a.should eq
<BlaXpirit> assert 0 <= value < 1 -> 0 <= value < 1 .should be_true
<BlaXpirit> assert 5.is_a? Int32 -> 5.should be_a(Int32)
<BlaXpirit> this is all doable with macros as demonstrated at link
<BlaXpirit> but besides all this, such "assert" would be extremely useful during development. it automatically prints out all you need in case of assertion error, no thinking required
<BlaXpirit> (and like 10 times less typing)
mcgain has quit [Quit: mcgain]
mcgain has joined #crystal-lang
strcmp1 has quit [Quit: Leaving]
<BlaXpirit> I have `as` fail at compile time. how can I force it to fail at runtime?
<BlaXpirit> i want code like this to compile https://bpaste.net/show/a70efc40fbc8
<asterite> BlaXpirit: do you know this? https://github.com/rosylilly/power_assert.cr
<BlaXpirit> obviously not :p
<asterite> I like that idea too, I think Elixir does that too to provide nice error messages without having to write things like "should". But I think because it's a macro, compile times will be slow. I'll try it. If it's not slow maybe it would be good to have that built-in
<BlaXpirit> asterite, i mean, that one is indeed overkill for typical usage
<BlaXpirit> but in unittesting performance matters much less
<dbackeus> shouldn't a small number be castable to an Int32? http://play.crystal-lang.org/#/r/aq0
<BlaXpirit> dbackeus, as is not really a cast
<BlaXpirit> you just use it to make the type more precise
<BlaXpirit> dbackeus, in this case use .to_u64
havenwood has joined #crystal-lang
jhass has joined #crystal-lang
<jhass> https://github.com/Homebrew/homebrew/issues/14374#issuecomment-129439354 shall we ask for crystal to be renamed to crystal_generator? :P
<BlaXpirit> i dont get it
zamith___ is now known as zamith
havenwood has quit [Ping timeout: 246 seconds]
trapped_ has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/v3OgP
<crystal-gh> crystal/master 5a1629c Ary Borenszweig: Fixed a small parser bug where `if 1 a` would parse correctly
<asterite> jhass: yes, please :)
<asterite> although the ones from crystal would probably not like it
<jhass> yeah, wrote a comment, let's see what happens :P
<jhass> asterite: btw if you'd submit crystal-lang that'll certainly help argue the case
<asterite> submit how? there's already crystal-lang as a formula
<jhass> in the core/main thingy/tap whatever? I thought you still have your custom tap
<travis-ci> manastech/crystal#5a1629c (master - Fixed a small parser bug where `if 1 a` would parse correctly): The build passed. https://travis-ci.org/manastech/crystal/builds/74918916
<crystal-gh> [crystal] asterite closed pull request #1138: Use an up to date ruby version for gh-pages (gh-pages...update-ruby-version) http://git.io/v3IRd
<jhass> did I miss the bug report for this one? http://carc.in/#/r/aio
<BlaXpirit> wow, what an error message
<BlaXpirit> this is not supposed to work anyway cuz it uses ->(Int)
<BlaXpirit> but oh my
<jhass> you've never crashed the compiler yet?
<BlaXpirit> i dont remember getting a message this big
<BlaXpirit> [:49:48] <BlaXpirit> I have `as` fail at compile time. how can I force it to fail at runtime? [:52:06] <BlaXpirit> i want code like this to compile https://bpaste.net/show/a70efc40fbc8
<BlaXpirit> any comments?
<BlaXpirit> i had to replace this with assert arg.is_a? UInt8 etc
<jhass> BlaXpirit: tried type restricting arg to the full union?
<BlaXpirit> jhass, oh it actually was restricted
<BlaXpirit> and i had to remove the union at one point anyway because the program didnt work with it
<BlaXpirit> the Type union contained Array(Type)
<BlaXpirit> and then i had an argument Array(Type), to which i couldn't pass Array(Array(Type))
<BlaXpirit> actualyl i should try to reproduce and report this
<jhass> >> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123]]
<DeBot> jhass: Error in line 4: no overload matches 'Array(Type)#<<' with types Array((Int32 | Array(Int32))) - http://carc.in/#/r/aqd
<jhass> mmh
<BlaXpirit> jhass, you got it
<jhass> I thought that works
<jhass> >> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123]] as Type
<DeBot> jhass: Error in line 4: can't cast Array((Int32 | Array(Int32))) to Type - http://carc.in/#/r/aqe
<BlaXpirit> the way i had it is http://carc.in/#/r/aqg
<BlaXpirit> jhass, anyway, the problem with the previously pasted code wasn't that it's not restricted enough. in fact, it was too restricted. the type was known at compile time, so casting `as` anything else gave compiletime error
<asterite> ->test(Int) shouldn't compile, so yes, it's a bug
<BlaXpirit> but the code that gave compiletime error would not be executed, so if `as` only errored at runtime, that code would work just fine
<BlaXpirit> wat
<BlaXpirit> oh.
<asterite> >> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123]] of Type
<DeBot> asterite: Error in line 4: no overload matches 'Pointer((Int32 | Array(Type)))#[]=' with types Int32, Array(Int32) - http://carc.in/#/r/aqk
<asterite> >> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123] of Type] of Type
<DeBot> asterite: # => [[123, [123]]] - http://carc.in/#/r/aql
<BlaXpirit> wait wait wait, what was the pointer doing there?
<jhass> array internal
<asterite> BlaXpirit: about the "as" program, does your program invoke that method will all those possible types? Or... what error are you getting?
<jhass> automatic upcasting there would be soo awesome
<BlaXpirit> asterite, see for yourself http://carc.in/#/r/aqn
<asterite> Use .to_i32, to_i8, etc.
<BlaXpirit> woops, there is one extra single_val = but it changes nothing
<BlaXpirit> asterite, but i dont want to convert uint8 to int32
<BlaXpirit> and anyway, what if it is a string or an array
<BlaXpirit> i cut out too much from there
<asterite> but in your case "arg" is an Int32, and that can't be cast to UInt8
<asterite> Mmm... but I think I see the problem
<asterite> But... got to go now
<BlaXpirit> no prob. see you later
<nopc0de> Is it possible to get a more detailed "crystal spec" output?
<nopc0de> as in, see which spec it is running when it is running it, rather than dots?
<jhass> -f doc or something, let me look it up
<jhass> ah, no that's still rspec only :P
tonyfabeen has joined #crystal-lang
tonyfabeen has quit [Client Quit]
tonyfabeen has joined #crystal-lang
<nopc0de> hmm
<nopc0de> ah it works when you supply filename, thanks
zamith has quit [Ping timeout: 244 seconds]
<nopc0de> spec's expect_raises crashes the spec runner for me. The spec stops running and I can't even ctrl-c the crystal process.
<nopc0de> occurs when trying to run the crystal-redis spec
zamith has joined #crystal-lang
<jhass> works fine here
kleech has joined #crystal-lang
<nopc0de> Any idea how to work with these kinds of errors? https://gist.github.com/Vanhecke/b6af3f575a80bd38de52
<nopc0de> trying to compile the amatista example from their readme
<jhass> oO, how do you do that...
shama has joined #crystal-lang
dbackeus has quit [Remote host closed the connection]
dbackeus has joined #crystal-lang
havenwood has joined #crystal-lang
dbackeus has quit [Remote host closed the connection]
BlaXpirit has quit [Quit: Konversation]
BlaXpirit has joined #crystal-lang
<crystal-gh> [crystal] PragTob closed pull request #1132: Remove Iterator#rewind duplication through common module (master...iterator-less-rewind-duplication) http://git.io/v3f1b
dbackeus has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
dbackeus has quit [Ping timeout: 260 seconds]
nopc0de has quit [Ping timeout: 246 seconds]
nopc0de has joined #crystal-lang
kleech has quit [Remote host closed the connection]
nopc0de has quit [Excess Flood]
nopc0de has joined #crystal-lang
naps62 has quit [Remote host closed the connection]
zamith has quit [Quit: Be back later ...]
dbackeus has joined #crystal-lang
mcgain has quit [Quit: mcgain]
<crystal-gh> [crystal] PragTob opened pull request #1142: Improve documentation of struct in regards when to use it (gh-pages...clarify-struct-vs-class) http://git.io/v3sgD
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 244 seconds]
kyrylo has quit [Ping timeout: 264 seconds]
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
leafybasil has joined #crystal-lang
DeBot has quit [Client Quit]
DeBot has joined #crystal-lang
elbow has quit [Remote host closed the connection]
nahtnam has joined #crystal-lang
<nahtnam> Is there a selenium driver for crystal?
<jhass> I highly doubt so
<nahtnam> :(
<jhass> but I mean the thing that's slow there is selenium, doubt it would be faster over using the ruby one
<nahtnam> Oh ok
<nahtnam> Im using the ruby one currently
<jhass> if you're seeking to get something faster, switching to phantomjs is probably more worth the effort
<nahtnam> Can
<nahtnam> t
<nahtnam> Some of the sites we are scraping block it
<jhass> oO
<jhass> you tried mechanize too?
<nahtnam> Yeah :/ Otherwise life would be easy
<jhass> wth do they do
<nahtnam> jhass: No, ill ask my coworker
<nahtnam> We handle giftcard
<nahtnam> *giftcards
<nahtnam> and part of it is getting the balance
<nahtnam> jhass: Do you know how mechanize works? Does it simulate the browser?
<nahtnam> IE Can the site detect that its a bot?
<nahtnam> *Should move this to #ruby
<jhass> that's really not generally answerable
<jhass> it won't run any JS
<jhass> beyond that HTTP is HTTP, you can always craft a request that looks identical to coming from a popular browser
<nahtnam> I doesnt run JS? Some of the sites have ajax forms and what not
<jhass> so what, these also just end up doing http requests
luislavena has joined #crystal-lang
<sardaukar> BlaXpirit: kudos on releasing the dbus project
<sardaukar> you've also worked on nim! do you collect underground lang projects? :D
<BlaXpirit> sardaukar, i just want to find the ultimate language
<BlaXpirit> nim is not it
<sardaukar> what didn't you like about it?
<sardaukar> and is Crystal closer? :D
<BlaXpirit> nim has a lot of random stupid stuff "just because"
<BlaXpirit> as well as limitations "just because"
<sardaukar> I see
<BlaXpirit> doesn't have finalizers
<BlaXpirit> to get your code into standard library, it doesnt need to be well designed, it just needs to be first
<BlaXpirit> stdlib is unbearable
<sardaukar> so... does Crystal feel closer to the ideal? :D
<BlaXpirit> yes
kyrylo has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
<nopc0de> ruby but faster would be perfect imo
<jhass> jruby? :P
<BlaXpirit> no, python but faster would be perfec
<jhass> pypy? :P
<BlaXpirit> it's slow
<nopc0de> jruby requires java which I don't like
<nopc0de> and its still nowhere close
<jhass> jruby 9000 has some quite impressive numbers
<nopc0de> crystal webserver logs in microseconds
<nopc0de> but...java
<jhass> well, JVM to be specific
<nopc0de> jhass does that say 20x faster?
<jhass> yeah
<jhass> after warmup of course
<kyrylo> Looks like 1.8.7 is faster than 2.2.2 ?
<nopc0de> yeah
<nopc0de> Bunch of speedup happened in 2.2 iirc
<jhass> huh, no, 1.8 isn't faster
<jhass> switch the baseline to 1.8 below and it'll become more obvious
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/v3G9Z
<crystal-gh> crystal/master c787f0a Ary Borenszweig: Fixed wrong `to_s` for Class class
<crystal-gh> crystal/master d32470c Ary Borenszweig: Fixed #1119: crash when invoking `class` method from instance method
mcgain has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/v3GFc
<crystal-gh> crystal/master 8a36ec7 Ary Borenszweig: Renamed `--no-build` to `--no-codegen`, and rename "build" method to "codegen" in the code
<travis-ci> manastech/crystal#d32470c (master - Fixed #1119: crash when invoking `class` method from instance method): The build passed. https://travis-ci.org/manastech/crystal/builds/74981072
<crystal-gh> [crystal] PragTob opened pull request #1145: Implement Iterator#compact_map (master...iterator-compact-map) http://git.io/v3GbQ
kleech has joined #crystal-lang
<kleech> Did there used to be a gitter room for Crystal?
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/v3Gjm
<crystal-gh> crystal/master 7f2401e Ary Borenszweig: Fixed #1057: wrong error message when invoking new on abstract type and arguments don't match
<travis-ci> manastech/crystal#8a36ec7 (master - Renamed `--no-build` to `--no-codegen`, and rename "build" method to "codegen" in the code): The build was broken. https://travis-ci.org/manastech/crystal/builds/74983040
<kleech> I created an issue with a proposal for some improvements for the init command: https://github.com/manastech/crystal/issues/1147
mcgain has quit [Quit: mcgain]
<crystal-gh> [crystal] PragTob opened pull request #1149: Fix travis build by using the new names instead of old (master...fix-build-with-build--codegen) http://git.io/v3ZJi
mcgain has joined #crystal-lang
<travis-ci> manastech/crystal#7f2401e (master - Fixed #1057: wrong error message when invoking new on abstract type and arguments don't match): The build was broken. https://travis-ci.org/manastech/crystal/builds/74985665
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/v3ZkS
<crystal-gh> crystal/master 4efb5ad Ary Borenszweig: Use `--no-codegen` instead of `--no-build` in travis script. Fixes #1149
BlaXpirit has quit [Quit: Konversation]
strcmp1 has joined #crystal-lang
luislavena has quit []
<travis-ci> manastech/crystal#4efb5ad (master - Use `--no-codegen` instead of `--no-build` in travis script. Fixes #1149): The build was fixed. https://travis-ci.org/manastech/crystal/builds/74988205
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
elia has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/v3ZWO
<crystal-gh> crystal/master f8cad9f Ary Borenszweig: Removed unused rng file
kleech has quit []
<travis-ci> manastech/crystal#f8cad9f (master - Removed unused rng file): The build passed. https://travis-ci.org/manastech/crystal/builds/74993518
nahtnam has quit [Quit: Connection closed for inactivity]
elia has quit [Quit: Computer has gone to sleep.]
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
dbackeus has quit [Remote host closed the connection]
trapped_ has quit [Ping timeout: 252 seconds]
sardaukar has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
sardaukar has joined #crystal-lang