asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.0 | 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
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Client Quit]
weskinner_mac has joined #crystal-lang
waj has quit [Quit: Leaving.]
weskinner_mac has quit [Quit: weskinner_mac]
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
bcardiff has joined #crystal-lang
r20 has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
r20 has quit [Quit: Leaving]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
shama has joined #crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
havenwood has joined #crystal-lang
weskinner_mac has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #454: Added: ArrayLiteral#shuffle to macros (master...macros-array-literal-shuffle) http://git.io/xs8e
weskinner_mac has quit [Quit: weskinner_mac]
waj has joined #crystal-lang
weskinner_mac has joined #crystal-lang
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 245 seconds]
weskinner_mac has quit [Quit: weskinner_mac]
havenwood has joined #crystal-lang
havenn has quit [Ping timeout: 246 seconds]
weskinner_mac has joined #crystal-lang
waj has quit [Quit: Leaving.]
weskinner_mac has quit [Quit: weskinner_mac]
weskinner_mac has joined #crystal-lang
weskinner_work has joined #crystal-lang
waj has joined #crystal-lang
waj has quit [Quit: Leaving.]
weskinner_work has quit [Ping timeout: 264 seconds]
ponga has joined #crystal-lang
<ponga> hi guys
<ponga> can i ask what file extension is used as convention
<ponga> one that sublime-crystal can detect will be good
<jhass> .cr
<ponga> thanks
<jhass> I just use Ruby syntax highlighting though, works pretty well :P
<ponga> lol
<ponga> omg it does X.times do end too
<jhass> sure
<ponga> um
<ponga> jhass:
<ponga> hey
<ponga> did i do it wrong or is it really what its saying
<jhass> this is always a bug yes, please open an issue with your code. Even if you did it wrong, it should throw a corresponding compiler error instead
<ponga> jhass: so i was OK typing in 'crystal build test.cr' then 'crystal run test' ?
<ponga> i thought i typed wrongly
<ponga> i think i did something just stupid and crystal thinks its a bug when its not
<jhass> well
<jhass> you crystal run compiles and then executes the resulting binary
<ponga> oh fyi i never tried compiling language.. so you know
<jhass> so you tried to let the compiler read a binary as crystal program
<ponga> i might be doing it all wrong
<ponga> so 'crystal run test' is ok?
<jhass> to run your program after crystal build, just run the resulting binary, ./test in your case
<jhass> only if test is a file containing crystal source code, which it isn't in this case
<ponga> its there
<ponga> oh ok
<ponga> jhass: http://pastie.org/9990388 its not a bug
<ponga> the bug was me
<ponga> ...;(
<ponga> run (default) compile and run program file <-
<ponga> ah hah!
<jhass> well, it probably still should say something like "this doesn't look like a crystal program" ;)
<ponga> so i just ./file
<jhass> yeah
<ponga> never knew this style of ./ thingi
<ponga> its like convention?
<jhass> it's the same as doing /usr/bin/ruby
<ponga> jhass: oh ok if it were to say 'this doesn't look like a valid crystal program'
<ponga> i still would open an issue?
<jhass> it's an executable, you could move it to a system that has never seen crystal
<jhass> I'll do it for you :)
<ponga> should i still open an issue in github
<ponga> no , i can do it! (i can try
<ponga> and jhass you would want my code too?
<ponga> its just one line 10.times do puts "greet" end tho
<ponga> lol
<jhass> no, it's rather unrelated to the code, I didn't notice what you did at first :)
<ponga> ah hah
<ponga> yeah i see this now, not many 'skilled' devs would do this stupid mistake and find this bug
<ponga> haha
<ponga> i kinda found this by playing dumb
<jhass> it's fine, those are the things that make a program stable :)
<ponga> ah hah
<ponga> i see
<ponga> i subscribed it ;)
weskinner_mac has quit [Quit: weskinner_mac]
<jhass> ponga: found the samples yet? https://github.com/manastech/crystal/tree/master/samples ;)
<ponga> jhass: what is it, code samples?
<jhass> yeah, example programs
<ponga> jhass: how can i measure benchmark in crystal, what ways
<ponga> in ruby i used require 'benchmark'
<ponga> do i need external thing
<jhass> uh, I never tried
<jhass> there's https://github.com/manastech/crystal/blob/master/src/benchmark.cr I believe its API is similar to Rubys
<jhass> >> Benchmark
<DeBot> jhass: Error in line 3: undefined constant Benchmark
<jhass> >> require "benchmark"; Benchmark
<DeBot> jhass: Benchmark
orliesaurus has quit [Excess Flood]
a- has joined #crystal-lang
<ponga> uh oh
<ponga> jhass: could you please look at it http://pastie.org/9990509
<ponga> http://pastie.org/9990512 this didn't spit out error
<jhass> ponga: mandelbrot takes an argument, you didn't pass it one
<ponga> ah sorry
<ponga> jhass: what do i need to pass ?...
<ponga> sorry
<ponga> what 'would' i pass
<ponga> more like
<ponga> oh ok, numbers
<jhass> complex ones it seems
<ponga> jhass: i just passed int 1
<ponga> mandelbrot(1)
<ponga> and it prints some text image
<jhass> yeah, well it does that unconditionally
<jhass> the mandelbrot function ends on line 6
<jhass> it's just a helper for the code below
<ponga> jhass: Array.new(100, a).inject(a) { |z, c| z*z + c } is '100' the size for benchmark
<jhass> huh? no, it's the same as in Ruby
<jhass> >> Array.new(10, 5)
<DeBot> jhass: [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
<ponga> jhass: no i mean if i changed 100 into like 500 , 5000 would it take longer time to process
<ponga> i guess so cos its larger array?
<ponga> uh..not really?
<ponga> uh yeah it is
<jhass> well, yes, it would take longer
<jhass> whether that's the main/expensive part of the mandelbrot function I don't know because, uh, maths :P
<jhass> looks like it though
<ponga> uhhh mathh
<ponga> what the hell..
<jhass> mh?
<ponga> http://benchmarksgame.alioth.debian.org/u32/performance.php?test=mandelbrot you see this page shows of mandelbrot 16000times performance
<ponga> and as far as i can comprehend it seems they are using size 50
<ponga> http://pastie.org/9990568 so i did this
<ponga> and the result is too fast to believe
<ponga> there must be something wrong with my code
<jhass> yeah, not sure it's the same parameters used really
<ponga> jhass: i doubt it too
<jhass> "Each program should plot the Mandelbrot set [-1.5-i,0.5+i] on an N-by-N bitmap. Write output byte-by-byte in portable bitmap format."
<jhass> so it should generate an image for starters, not just an ASCII representation ;)
<ponga> ah
<jhass> the 16000 is not the amount of iterations, it's the size of the bitmap
<ponga> jhass: are you familiar with binary_trees?
<jhass> not too much
<ponga> there are two methods in the code 'bottom_up_trees' and 'item_check'
<ponga> should i call bottom_up_trees
<jhass> well, those are again merely helper functions for the actual code below
<ponga> yeah i thought that
<ponga> im thinking what should i call for benchmark
<ponga> the whole thing maybe
<ponga> oh
<ponga> jhass: just by putting -s it actually shows the statistics
<ponga> crystal run file -s
<jhass> those are statistics about the compiler performance when compiling the program, not the run time of the program itself
<ponga> oh
<ponga> thanks
ytti has joined #crystal-lang
havenwood has quit [Remote host closed the connection]