ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's 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
<FromGitter> <drosehn> @elorest : I think the libevent error has something to do with the way `brew` does things. One user suggested that this command would fix that problem: `brew switch libevent 2.1.8`.
<FromGitter> <drosehn> In my case, I fixed it the stupid way, by creating a symlink for the version it *wanted* which points to the version of libevent that `brew` actually built.
<FromGitter> <samueleaton> I enjoy doing more functional-style programming and have so `Proc`s in crystal seem natural to me, but I don't tend to see them a lot in other people's code. Is it weird to expose APIs in my shards that take procs and whatnot. What is the general opinion of Procs?
<FromGitter> <faustinoaq> @samueleaton I use proc when I want a function as argument because I can do `call` but I don't see many Procs in crystal shards.
<kodo[m]> What's a better way to do:
<kodo[m]> content = node.xpath_node("atom:content", {"atom" => "http://www.w3.org/2005/Atom"}).as(XML::Node)
<kodo[m]> content = content && content.content
Raimondi has quit [Ping timeout: 268 seconds]
endou has quit [Read error: Connection reset by peer]
endou has joined #crystal-lang
tzekid has joined #crystal-lang
tzekid has quit [Quit: Leaving]
snsei has joined #crystal-lang
<FromGitter> <elorest> @drosehn Thanks. I'll try that.
<FromGitter> <elorest> Is anyone going to be presenting on crystal at railsconf?
<FromGitter> <elorest> C bindings or something would probably be appropriate. I sure saw enough about runs at railsconf 2015.
Raimondi has joined #crystal-lang
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
sz0 has joined #crystal-lang
<vegai_> does a musl-compiled crystal binary exist anywhere?
<crystal-gh> [crystal] Sija opened pull request #4216: Separation of constructor methods in docs (master...pr-4071) https://git.io/vScRs
<vegai_> I guess a statically compiled glibc-based one would work fine too
<vegai_> just need something to get off the ground :P
bungoman has quit [Ping timeout: 246 seconds]
bungoman has joined #crystal-lang
olek_poz has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
snsei has quit [Remote host closed the connection]
gloscombe has joined #crystal-lang
<crystal-gh> [crystal] icyleaf opened pull request #4217: add YAML::Any method to_json (master...support-yaml-any-to-json) https://git.io/vScKf
olek_poz has quit [Ping timeout: 260 seconds]
sz0 has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
Raimondi has joined #crystal-lang
olek_poz has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
gloscombe has quit [Ping timeout: 240 seconds]
gloscombe has joined #crystal-lang
bjz has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 258 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 246 seconds]
tzekid has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
vifino- is now known as vifino
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Ven has joined #crystal-lang
Ven is now known as Guest87256
Guest87256 has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
Ven_ has quit [Client Quit]
<FromGitter> <luislavena> @vegai_ you cannot statically compile glibc, it will still load at runtime. While musl support exist and there is an Alpine repo, there is no static build with musl since it will also require building everything statically.
<FromGitter> <luislavena> (zib, openssl, etc)
snsei has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tzekid has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <ysbaddaden> my problem was LLVM, but AlpineLinux now distributes static packages for it, so I guess we could distribute a fully static crystal compiler (compiling zlib or gc or pcre isn't as scary as compiling LLVM)
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
elia has joined #crystal-lang
<kodo[m]> 🔮🔮🔮🔮🔮🔮🔮🔮🔮
<FromGitter> <sdogruyol> what's that
<FromGitter> <alex-lairan> Hi :) What the most mature shards for games? :)
<FromGitter> <mjago> SDL
<FromGitter> <alex-lairan> This one https://github.com/weskinner/crystal-sdl2 ? :)
<FromGitter> <mjago> or this one https://github.com/ysbaddaden/sdl.cr
<FromGitter> <mjago> sdl2_mixer has just been added but not merged yet here https://github.com/jwoertink/sdl.cr/commits/audio
<FromGitter> <alex-lairan> Ok thanks, I try both
<BlaXpirit> seriously?
<BlaXpirit> alex-lairan, I would argue for this one https://github.com/oprypin/crsfml but what do i know
<FromGitter> <luislavena> @ysbaddaden was my understanding that Alpine didn't provide static version of their packages, so you couldn't use `-static` and generate standalone exectuables
<FromGitter> <ysbaddaden> not always, it would seem
<FromGitter> <ysbaddaden> they only provide a single llvm version... that breaks compatibility quickly
<FromGitter> <ysbaddaden> so maybe they started distributing static packages, so binaries compiled against llvm won't break on a llvm libs upgrade
<FromGitter> <ysbaddaden> this is only a guess
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<crystal-gh> [crystal] jhass closed pull request #4215: Fix: compilation against OpenSSL 1.1.0 (master...std-fix-openssl-110) https://git.io/vSZv1
<travis-ci> crystal-lang/crystal#a36e2b4 (master - Merge pull request #4215 from ysbaddaden/std-fix-openssl-110): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/217225558
<DeBot> https://github.com/crystal-lang/crystal/pull/4215 (Fix: compilation against OpenSSL 1.1.0)
A124 has joined #crystal-lang
A124 has quit [Quit: '']
Raimondi has joined #crystal-lang
A124 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<crystal-gh> [crystal] vegai opened pull request #4219: WIP/POC: Remove exclusive range syntax (master...remove_exclusive_range_syntax) https://git.io/vSCia
Raimondi has quit [Ping timeout: 268 seconds]
olek_poz has quit [Ping timeout: 260 seconds]
Raimondi has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
A124 has quit [Quit: '']
Raimondi has quit [Ping timeout: 268 seconds]
A124 has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <elorest> Closest thing I can find to a real life crystal logo to sit next to my ruby. https://www.alibaba.com/product-detail/2015-New-Product-Natural-Obsidian-Crystal_60197578611.html
olek_poz has joined #crystal-lang
<FromGitter> <fridgerator> haha thats cool
<FromGitter> <fridgerator> where did you get the 3d ruby?
<FromGitter> <fridgerator> As far as I know it doesn't, but I thought about implementing this in crystal before : https://github.com/grosser/parallel/blob/master/lib/parallel/processor_count.rb
<FromGitter> <fridgerator> excluding the windows ole stuff
<FromGitter> <f-a-a> Hi all, I just started toying around with Crystal and Kemal, but I'm starting to feel running `crystal build --release src/your-app.cr && ./your-app` every code change is tedious. So how do you guys do it?
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <fridgerator> you don't have to build for release every time, you can just do `crystal src/your-app.cr`
<FromGitter> <fridgerator> also there are a couple of tools available that watch for when files change and reload your app for you
<FromGitter> <fridgerator> guardian (https://github.com/f/guardian) and sentry (https://github.com/samueleaton/sentry)
leonardschuetz has joined #crystal-lang
<FromGitter> <domgetter> Is there anything like hiccup for crystal? https://github.com/weavejester/hiccup
leonardschuetz has left #crystal-lang [#crystal-lang]
<FromGitter> <domgetter> If not, it looks like I know what my first Crystal project will be :)
<FromGitter> <samueleaton> @f-a-a I wrote sentry to solve that problem. Just run the install and do `./sentry` and it will do everything for you.
<FromGitter> <samueleaton> Guardian is good for a wider variety of tasks but takes a little more setup for something like monitoring/restarting your app process whereas Sentry was made with that specific use case in mind and doesn't do much else.
<FromGitter> <tzekid> @domgetter ECR templates seem to be the closes thing you'll get to hiccup, afai. found
Raimondi has joined #crystal-lang
<FromGitter> <elorest> @fridgerator I just googled glass ruby paperweight.
<FromGitter> <fridgerator> nice :thumbsup:
gloscombe has quit [Ping timeout: 268 seconds]
<FromGitter> <elorest> Is anyone here going to railsconf?
<FromGitter> <fridgerator> I am not
<FromGitter> <elorest> Ok. We
<FromGitter> <fridgerator> haha, do it
<FromGitter> <fridgerator> "would you like to hear about my lord and savriour crystal?"
<FromGitter> <chuckremes> Anyone have any information on crystal’s roadmap regarding threads? The wiki says it’s on a branch for now. Last commit was a month ago. Just curious if that’s a hot topic.
<BlaXpirit> chuckremes, it's a hot topic in that people anticipate it
<FromGitter> <chuckremes> Also, I may have some interest in creating a celluloid-like library for Crystal. I can do that now with just Fibers but it sure would be nice to be able to scale to multiple threads. :)
<BlaXpirit> but it's very hard. almost all work was done within Manas and they don't publicise much about it, until it's done, I guess
<FromGitter> <chuckremes> I see. Just did a quick search and see that Manas is the company behind crystal.
<FromGitter> <chuckremes> I’ve worked on Rubinius for a while and have some inkling of the difficulties. I imagine they are wrestling with how to allow Fibers to migrate across Threads (way easier to disallow it).
<BlaXpirit> meanwhile, yet another effort to support Windows seems to have died
<FromGitter> <chuckremes> I’m less interested in that. I do use Windows & Ruby for work but JRuby has been very solid for me there. I imagine TruffleRuby will be good as well when I need more performance.
<BlaXpirit> chuckremes, don't operating systems sometimes migrate threads across CPUs? are you sure this is useful?
<BlaXpirit> oh right if it's a thread pool who cares if the thread migrates if it still has, for example, 50 fibers on it
<FromGitter> <chuckremes> Yes, OS’s do migrate threads across cpus. That’s a world of difference from migrating fibers between threads.
<FromGitter> <chuckremes> yep
<FromGitter> <chuckremes> crystal made a good choice in creating channels as first-class objects
<FromGitter> <chuckremes> if all fiber-to-fiber communication is managed via channels then the complexity is hidden from the end-user programmer. It’s hard on the compiler writer though. :)
pduncan has quit [Ping timeout: 246 seconds]
<FromGitter> <fkchang> @elorest good luck, I've had a number of conferene proposals on crystal rejected, I did get a question on one I submitted to RubyConf last year before it was rejected
bjz has joined #crystal-lang
elia has joined #crystal-lang
elia has quit [Client Quit]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <elorest> I'll just give a 15 minute lighting talk.
<FromGitter> <elorest> I've given those in the past for https://github.com/elorest/petergate and they went well.
<FromGitter> <elorest> lame that rust and elixir get air time at Railsconf but crystal can't
<FromGitter> <elorest> Is there an opposite of includes? excludes? doesn't exist apparently.
<FromGitter> <fridgerator> just `!includes?` ?
olek_poz has quit [Ping timeout: 260 seconds]
<FromGitter> <redcodefinal> Hi guys, wanted to make sure I understand this correctly. https://play.crystal-lang.org/#/r/1slk. ⏎ ⏎ The test method here can only accept a class that has inherited from A correct?
<Papierkorb> redcodefinal, that code is broken. Line 24 should be `def test(a : A)`
<Papierkorb> Oh, that you mean
<Papierkorb> redcodefinal, Line 24 .. try `def test(a : A.class)`
<FromGitter> <redcodefinal> But I don't want to accept an instance of A, I want to accept the class A or it's inherited children
<FromGitter> <redcodefinal> https://play.crystal-lang.org/#/r/1sll
KCreate has joined #crystal-lang
<KCreate> Hey, does crystal have a factorial function somewhere?
bjz has joined #crystal-lang
<FromGitter> <redcodefinal> I believe Math.gamma is what you are looking for. It's the same as fact(n-1)
<KCreate> I'm getting: "undefined fun 'tgamma' for LibM"
<KCreate> Do I need to install that somehow? I'm on macOS 10.12.3
<FromGitter> <gettalong> Hey everybody! A quick question: If I use `when '\n'.ord` instead of `when 10`, does this incur a performance penalty or is this optimized by the compiler? How could I find such things out for myself?
<Papierkorb> gettalong, the compiler should optimize that (or rather, LLVM)
<Papierkorb> gettalong, you can read the disassembly (of the binary, or LLVM IR code), or you can write a lil' benchmark
<Papierkorb> to see for yourself
<FromGitter> <gettalong> Papierkorb: Thanks, good to know! Yeah, I thought about the benchmark but this would get old for every small change :wink:
<Papierkorb> gettalong, write code fast first, then write fast code if needed
<FromGitter> <gettalong> Just found the `crystal build --emit llvm-ir`, interesting but hard to decipher on first try :)
<Papierkorb> Not trying to say you shouldn't think about your code, data structures etc., but `case 'f'.ord` is worth it if alone for being readable
<FromGitter> <gettalong> Papierkorb: Yes, I should probably do that but my interests in how Crystal works behind the scenes sometimes gets the better of me. For what's worth, the last few days were quite enlightening
<Papierkorb> I was (and sometimes still am) really impressed of what crazy optimizations LLVM does
<Papierkorb> I wrote a `memcpy()` in Crystal. The generated disassembled function of that was shorter line-wise than what I wrote in Crystal. Kinda insane.
<FromGitter> <gettalong> :smile:
<FromGitter> <elorest> Is there a way to use an array of values in a case statement instead of `when 1, 2, 3` ⏎ https://play.crystal-lang.org/#/r/1sm2
<FromGitter> <gettalong> Papierkorb: Thanks for your input! I will go to bed now and continue my quest tomorrow.
<Papierkorb> good night!
KCreate has quit [Quit: leaving]