asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | 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
havenwood has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
havenwood has quit [Ping timeout: 252 seconds]
havenwood has joined #crystal-lang
deansc has joined #crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
a5i has joined #crystal-lang
deansc has quit [Remote host closed the connection]
<a5i> Guys
<a5i> did any of you people see the pics?
<a5i> for Crystal's logo
<jhass> I think I prefer the stylized, modern arty look of the spinning thing on the homepage
<havenwood> <3 spinny thing
<jhass> should post to /r/ or something and see what happens :D
<a5i> but we can't use that spinny thing for everything yet
<a5i> mainly since it isnt supported everywhere
<havenwood> Hehe, I wonder if folk realize this is emoji?: https://i.imgur.com/o0IcfxN.png
<havenwood> Having your logo be an emoji has certain upsides. :P
sadin has joined #crystal-lang
<jhass> lol
<a5i> does 'exit' exit the program in Crystal?
<jhass> yes
<a5i> mk, thanks
Cassyblanca has joined #crystal-lang
<a5i> tbh i really like this one: http://i.imgur.com/4mRs26N.png
<jhass> tbh I really don't
<a5i> Y
<jhass> the logo is a copy of the ruby logo
<jhass> the first part of the byline is misleading
<a5i> True
<jhass> the second part of the byline is a useless buzzword
<havenwood> Ruby logo is Ruby's logo. It's not "Pure Ruby." Webscale is one uhg.
<a5i> I can pick off a crystal logo from the internet
<a5i> if im allowed too :(
<jhass> we should post to some graphic design request board
<jhass> I just don't know any (sane one)
<jhass> maybe we can throw some money together and try a fiverr or two https://www.fiverr.com/categories/graphics-design/creative-logo-design/#layout=auto&page=1
<a5i> ask*
<jhass> is it a request board?
<jhass> well, rules there say a big fat NO
<a5i> No for free work
<a5i> though we want free
<a5i> so its not a fta No
<a5i> fat*
<jhass> https://www.fiverr.com/logo_d3sign3r/design-a-professional-logo seems to have a fitting general style
<a5i> ooo
<a5i> looks nice
<a5i> >> 1.0e100
<DeBot> a5i: 1e+100
<a5i> >> 0x0539
<DeBot> a5i: 1337
<a5i> >> 2353465624323546 + 3523465754647656
<DeBot> a5i: 5876931378971202
deansc has joined #crystal-lang
<a5i> What's the largest f65 value in Crystal?
<a5i> 64*
<a5i> >> VERSION
<DeBot> a5i: Error in line 3: undefined constant VERSION
<a5i> o
<jhass> so I threw that $5 at that just for fun, let's see what happens :D
<a5i> You sent in a request?
<jhass> yeah
<jhass> I mean it's a beer, what can go wrong ;)
<a5i> nothin
<a5i> I hope he comes up with a kickass Crystal logo
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/veKj3
<crystal-gh> crystal/master e9dd89e Ary Borenszweig: Added `toggle(bool)` method to colorize. Doing `obj.colorize.red.toggle(false)` won't output color codes
<crystal-gh> crystal/master 12df889 Ary Borenszweig: Added --no-color option to disable colored output. Fixes #523
<travis-ci> manastech/crystal#2208 (master - 12df889 : Ary Borenszweig): The build was fixed.
deansc has quit [Remote host closed the connection]
ponga has joined #crystal-lang
djellemah has left #crystal-lang ["Leaving"]
JuryBatenko has joined #crystal-lang
JuryBatenko has quit [Quit: Computer has gone to sleep.]
sadin has quit []
havenwood has quit [Remote host closed the connection]
a5i has quit [Quit: Connection closed for inactivity]
nulpunkt has joined #crystal-lang
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leafybasil has quit [Remote host closed the connection]
JuryBatenko has joined #crystal-lang
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
a5i has joined #crystal-lang
colorisco has joined #crystal-lang
<a5i> Hi
<a5i> can someone assist me porting this ruby to Crystal? https://gist.github.com/Ap0ph1s/97657325d5bc9162694a
canhtak has joined #crystal-lang
<jhass> no
<jhass> there's no solution method or variable
canhtak_ has joined #crystal-lang
canhtak has quit [Client Quit]
canhtak_ is now known as canhtak
<a5i> jhass, there actually is, but its not the part that needs mods
<a5i> Ill add it
<jhass> so, what are you stuck with?
<a5i> Error in ./test.cr:16: undefined method 'sync=' for CFileIO
<jhass> so we don't have that flag
<jhass> you need to find out what syscalls that does and bind them
<a5i> is there an altnernate?
<jhass> the alternative is to implement it
<a5i> well, Idk where to start
<jhass> you would check what IO#sync= actually does
<a5i> It sets the sync mode of the file?
<a5i> doesnt have ot be a file
<jhass> "actually does" = which syscalls with what parameters it executes
<a5i> I can't seem to find out via google
<jhass> yeah, reading source is usually easier
<a5i> ugh
<a5i> jhass, I or someone else has to do this for this addition: https://github.com/japaric/euler_criterion.rs/issues/13
<jhass> I guess you can try leaving that call out
asterite has joined #crystal-lang
<a5i> STDIN does not have a .each method
<a5i> asterite: We are porting this script from Ruby to Crystal: https://gist.github.com/Ap0ph1s/97657325d5bc9162694a
<jhass> each_line
<jhass> isn't IO#each in Ruby deprecated or something?
<asterite> Yes, #each is ambiguous, use each_line
<asterite> (I mean, we didn't include it in crystal)
<asterite> About sync, I don't know what that is. I think Ruby always has an internal buffer for every IO
<asterite> "When sync mode is true, all output is immediately flushed to the underlying operating system and is not buffered by Ruby internally."
<asterite> Well, since we are not Ruby, that doesn't apply :-P
<asterite> (just kidding)
<asterite> Talking seriously, we don't have internal buffers so everything is immediately flushed (except for stdout, I think the OS keeps a buffer)
<asterite> If you want to use a buffer use BufferedIO, I think that's the programmer's responsibility
<a5i> in ./test.cr:19: undefined constant Process::CLOCK_MONOTONIC
<a5i> Damn
<asterite> >> time = Time.now; sleep 0.2; Time.now - time
<asterite> Use Time for now
<DeBot> asterite: Sorry, that took too long.
<jhass> hrm
<jhass> Time is bad for benchmarks :/
<jhass> and using a monotonic clock is a requirement
<jhass> to get it accepted into that repo
<a5i> could we use librt's clock_gettime via FFI ?
<jhass> we could just bind clock_gettime
<jhass> man clock_gettime
<asterite> There's no clock_gettime in mac
<jhass> wat? sigh
<asterite> jhass: "to get it accepted into that repo" -> what repo?
<ytti> https://bugs.ruby-lang.org/issues/10138 - this is cross-platform monotonic clock implementation for rub
<ytti> +y
Ven has joined #crystal-lang
<ytti> i would love to see that as Time.monotonic
<asterite> In the docs for Process#clock_gettime it says that monotonic is only available in SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4
<asterite> It uses gettimeofday for mac, I think... which is what Time.new uses, so...
<asterite> But we can improve things in linux, I guess
<ytti> + abs = mach_absolute_time();
<ytti> + absolutetime_to_nanoseconds(abs, &ts);
<ytti> is what it uses on OSX
<jhass> wonder what benchmark stdlib uses
<asterite> Well, I guess we'll have to port Process#clock_gettime
<a5i> Well if you do and add it to HEAD version, then someone else with the HEAD version needs to tell him what version + the script, since I can't compile HEAD unless the next release of Crystal
<a5i> jhass, any word on the logo :P
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> no
<a5i> mk
<asterite> a5i: it'll take us (or somebody else?) some time to do it anyway
<asterite> I liked the second logo until heavenwood noticed it's an emoji :(
<asterite> "Crystal: simple, even in it's logo"
<a5i> lol
<a5i> asterite: to implement Process MONOTONIC?
<asterite> That, and to make a new release
<asterite> I also don't know if we should copy Ruby's Process#clock_gettime or do something different
<jhass> Process seems like a bad place
<jhass> could add Clock
<jhass> or have Time support monotonic and real times
<jhass> though not sure if that should be mixed with all the timezone/date stuff in the long run
<jhass> mh, TimeSpan perhaps?
<jhass> TimeSpan.measure_monotonic(&block); TimeSpan.measure_realtime(&block)
<asterite> Maybe Clock is good. Time represents a point in time, TimeSpan a duration, and Clock is for measuring small amounts of time, like a stopwatch
<asterite> I think other languages use StopWatch
<jhass> though that still doesn't feel like the right place to retrieve the actual value, only for a span
havenwood has joined #crystal-lang
<asterite> Do we also need to support all those other constants, or monotonic is enough?
<jhass> Clock.monotonic_now : Int64, Clock.realtime_now : Int64, Clock.measure_monotonic(&block) : TimeSpan, Clock.measure_realtime(&block)
<jhass> : TimeSpan
<jhass> and Clock.measure(&block) to choose best available
<jhass> yeah, I think that could work
<asterite> I think in Ruby they return a float
<jhass> details ;)
bcardiff has joined #crystal-lang
<a5i> swag y0
weskinner_work has joined #crystal-lang
<saml> a5i, asl
<a5i> its not asl bruh
<saml> can you write 3d games in crystal?
<asterite> saml: of course!
<asterite> Well, not "can", but "could"
<saml> wow
<asterite> Just a proof of concept, it has a 3d cube using opengl
<saml> that's amazing
<asterite> Seems to be very outdated, though
<asterite> Ah, no, I didn't pull. It works, you can try it :-)
<asterite> You can do anything with crystal. Not sure it's turing complete, but it has C bindings
<asterite> C bindings > turing complete
<weskinner_work> I just started on a 2d platformer for crystal :P
<asterite> :-O
<weskinner_work> with crystal*
<asterite> weskinner_work: 2d platformer games are my favorites
<weskinner_work> starting very small though to get into it. something like: jump up the platforms to get to the flag.
<weskinner_work> asterite: I'm with you. something about the gameplay of super mario world is just unforgettable
<asterite> :)
<asterite> My favorites are Rayman and Yoshi's Island
<asterite> Gunstar Heroes was awesome too, but that has shooting too...
<saml> are we ready to build a full web startup on crystal?
<saml> cms, db, html templating, http client, async http server, logging, image manipulation, video conversion, message passing, web sockets
<asterite> We have web sockets :-)
<asterite> We also have sqlite3 :-P
<asterite> We need to define a common DB API
<asterite> I guess everything will come, slowly but steadily
canhtak has quit [Quit: canhtak]
canhtak has joined #crystal-lang
canhtak has quit [Client Quit]
asterite has quit [Ping timeout: 246 seconds]
Cassyblanca has quit [Quit: Textual IRC Client: www.textualapp.com]
<a5i> Idk what to create in Crystal*
JuryBatenko has quit [Ping timeout: 272 seconds]
<a5i> out of ideas
shama has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
Ven has joined #crystal-lang
<saml> a5i, create video editor
<a5i> that sounds like an insane amount of code
<saml> thanks
<saml> create a cms (wordpress)
<saml> create juce.com binding
jua_ has joined #crystal-lang
<saml> create karaoke software
<a5i> I wish I was skilled enough
<jhass> how about an IRC client
<saml> noooooooooooooooooooooooooooo
<saml> there's already http://rcr.io/rirc.html
<jhass> he could stop using irccloud!
<saml> a5i, think about what you're missing
<saml> a pretty girl in your life?
<saml> create a girl
<a5i> Thats worse...
<saml> create a text editor
<jhass> make a tool that uses markov chains to create project ideas
JuryBatenko has joined #crystal-lang
<a5i> If someone doesnt have a pretty girl its best they don't create one virtually
<saml> create a cure for loneliness and depression
<saml> port ruby on rails to crystal
<a5i> I give up
<jhass> what?
<jhass> those aren't all without exclusion great ideas?
<jhass> :(
<saml> i give up too. i go shopping
shadeslayer has quit [Ping timeout: 246 seconds]
shadeslayer has joined #crystal-lang
asterite has joined #crystal-lang
<asterite> saml: I like your project ideas
<saml> do it by tomorrow
leafybas_ has joined #crystal-lang
leafybas_ has quit [Remote host closed the connection]
<a5i> asterite: How exactl can stacksort be used by Crystal?
<asterite> Well, right now you can't because there are no sort algorithms in crystal in stackoverflow
weskinner_work has quit [Ping timeout: 276 seconds]
<asterite> but at compile-time you would search for algorithms, try to compile them and if they work you would return that
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leafybasil has quit [Ping timeout: 264 seconds]
<a5i> how do we integrate our sort algorithm witht he so one?
<asterite> a5i: do a time machine and bring missing code from the future, so we can finish crystal earlier
<a5i> oh thats e-x
<a5i> e-z*
<a5i> >> return crystal.code.4.years.from_now
<DeBot> a5i: Sorry, that took too long.
<a5i> thats alot of crystal code then
<asterite> That's a good reply message for that code :)
<a5i> yeah lol
<jhass> >> 1+1
<DeBot> jhass: 2
<jhass> mh
<jhass> no idea, something must be wrong with that VPS again
weskinner_work has joined #crystal-lang
havenwood has joined #crystal-lang
ponga has quit [Remote host closed the connection]
Ven has joined #crystal-lang
<weskinner_work> a5i: you could make a tilemap parser for: http://www.mapeditor.org/
<weskinner_work> probably not as fun as making a pretty girl but maybe more useful to others :P
<weskinner_work> or make your own pixelart editor :)
leafybasil has joined #crystal-lang
<asterite> weskinner_work: you'll use that for your game?
<weskinner_work> that's the plan
<asterite> It's XML, so it's actually a good idea to see if the XML support in the std is useful
<weskinner_work> I used the xml lib when I was playing around with some RSS scraping. seemed to work well
<weskinner_work> would like some kind of additional layer to make getting map info and tiles easier
<jhass> asterite: a5i watcha think? any suggestions? http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150408_212938.png
<weskinner_work> jhass: 1 of the bottom 2
<weskinner_work> I like the one of the left b/c of the optical illusion
<jhass> yeah, but could be a bit distracting as a more permanent element
<jhass> I like the bottom right one for the most 3d-ish effect
<weskinner_work> the top right one grows on me the more I look at it
<jhass> yeah me too
<weskinner_work> I like the perspective. It seems high up and commanding
<jhass> maybe I should ask him to play with the angle a bit and putting it next to a simple Crystal text
<jhass> by angle I mean rotation
<asterite> jhass: I like the one on the bottom left
<asterite> like the middle part can be the base of both pyramids
<jhass> any suggestions I should make? Or should I just ask for the source files already and post them to the contest? :)
<weskinner_work> they look good to me. we could always go back and polish later
<jhass> yeah, definitely more than you can ask for five bucks :D
<weskinner_work> getting the wife's opinion. she always makes these decisions :P
<weskinner_work> she votes for top right as well
<jhass> cool, I'll take them unmodified them then
asterite has quit [Quit: Leaving.]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
a5i has quit [Quit: Connection closed for inactivity]
bcardiff has quit [Quit: Leaving.]
nulpunkt has quit [Read error: Connection reset by peer]
nulpunkt has joined #crystal-lang
JuryBatenko has quit [Quit: Computer has gone to sleep.]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
a5i has joined #crystal-lang
<a5i> ?
<a5i> jhass, will it be different colors?
<jhass> not from this contract
<jhass> but I think the variants are easy enough to color
<a5i> True
<jhass> not sure yet whether we should
<jhass> I specifically asked for something monochrome
<a5i> I like all except the top left
<a5i> Think this needs a vote, if this is the final thing he gave us
<jhass> Sure, I never intended it to be the only option
<jhass> rather to have some options/drafts from somebody skilled/professional
<a5i> how much will he give just for $5 ?
<jhass> I should get the source files for the things on the screen
<a5i> jhass, if we were ever to color the popular one? http://prntscr.com/6rd2qx
<jhass> sure, there's lots of room for experimentation
<jhass> I think those provide a nice base though
<a5i> so is the contract with that guy finished? or is he still providing some more
<jhass> and as said, I should get the source files, so swapping out colors should hopefully be easy
<a5i> mk
<jhass> heh, it's just $5, let's not ask too much ;)
<a5i> jw
<a5i> tbh its between the top or bottom right
<a5i> the top one integrates more with the spinny thing
<weskinner_work> alright guys, time to talk about the elephant in the room, when are we writing an OS kernel in crystal?...
<a5i> !
colorisco has quit [Ping timeout: 252 seconds]
<weskinner_work> had this on the shelf for a while: http://www.amazon.com/Operating-Systems-Design-Implementation-Edition/dp/0131429388 . Could be "fun" to rewrite in crystal :)
<jhass> tricky
<jhass> 1) rip out libgc, 2) rip out libevent 3) write code not depending on glibc
<jhass> well, I guess you could actually statically link in glibc
<a5i> They have made kernels in Nim, we can do it in Crystal
k2b6s9j has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
weskinner_work has quit [Quit: weskinner_work]
<k2b6s9j> Could someone give me an example of a good Hash?
<k2b6s9j> I need a good example for the Atom grammar I'm working on.
<k2b6s9j> Okay, so Crystal is supporting both Symbol and String keys?
<jhass> any object can be a key
<jhass> and in theory you can mix them all
<jhass> >> {foo: 1, :bar => 2, "baz" => 3, Object.new => 4}
<DeBot> jhass: Error in line 3: can't instantiate abstract class Class
<jhass> hah, I broke it :P
<jhass> >> {foo: 1, :bar => 2, "baz" => 3, {1.0 => 2} => 4}
<DeBot> jhass: {:foo => 1, :bar => 2, "baz" => 3, {1 => 2} => 4}
<jhass> \o/
<k2b6s9j> Beautiful. Thank makes Hash syntax easy to cover.
<k2b6s9j> Thanks!
<jhass> >> {"foo": "bar"}
<DeBot> jhass: {"foo" => "bar"}
<jhass> that one I forgot ;)
jua_ has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
havenwood has joined #crystal-lang
<a5i> Hmm
<a5i> Okay lets say this is what I get from a json map
<a5i> how do I only access @text ?
k2b6s9j has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<a5i> JSON.parse doesnt seem to work