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
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
zsx has joined #crystal-lang
<zsx> ok, it seems crystal is a single threaded, how do i tell it to run fibers in multiple cores
<kodo[m]> you don't yet
<kodo[m]> it's coming soon
<zsx> kodo, ty for answering. i assume soon is next release ?
<kodo[m]> hopefulyl before then
<kodo[m]> but definitely by then
<kodo[m]> next release is 1.0
<kodo[m]> maybe not
<kodo[m]> they want 1.0 by end of year
<kodo[m]> or something like that
zsx has quit [Ping timeout: 260 seconds]
endou has joined #crystal-lang
endou_ has quit [Read error: Connection reset by peer]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
asux has joined #crystal-lang
asux has quit [Client Quit]
zsx has joined #crystal-lang
<kodo[m]> Crystal y u take so long to compile :(
<kodo[m]> Wonder if it will compile faster once it's parallel
zsx has quit [Ping timeout: 264 seconds]
zsx has joined #crystal-lang
<kodo[m]> Is there a crystal version manager? Right now I'm just compiling from crystal-git but kinda takes awhile
<kodo[m]> Just found crenv
zsx has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
dhk has joined #crystal-lang
echosystm has joined #crystal-lang
<echosystm> is the garbage collector in crystal multithreaded?
<havenwood> echosystm: https://github.com/ivmai/bdwgc/
<echosystm> cool thanks
<echosystm> also last time i looked crystal doesn't have any threading stuff
<echosystm> still true?
<FromGitter> <fridgerator> by threads do you mean concurrency or parralelism?
<echosystm> parallelism
<FromGitter> <fridgerator> there is concurrency, parralelism is being worked on
<echosystm> the ability to use multiple cores without multi-processing
<FromGitter> <fridgerator> they hope to have that and full windows support for version 1.0, this year
<FromGitter> <fridgerator> there was a blogpost about it a few weeks ago : https://crystal-lang.org/2017/02/24/state-of-crystal-at-0.21.html
dhk has quit [Quit: Leaving]
<echosystm> cool
<echosystm> its crazy how fast this language is progressing
<FromGitter> <fridgerator> yeah, especially considering they dont have the backing of a large company
<echosystm> as a go user, i really like the approach they're going to take to threads
<FromGitter> <fridgerator> from what i've read they took a lot of inspiration from Go
<echosystm> yeah
<echosystm> if crystal becomes go with ruby syntax, i will be in love
<echosystm> i still really struggle with go syntax etc.
<echosystm> i can't just sit down and do stuff. i feel like the language is a barrier.
<FromGitter> <fridgerator> how long have you been working with go?
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <fridgerator> i've only worked with it a very small amount
<kodo[m]> go kinda annoys me because there is this paradigm of getting the value and potential error for every assignment
<kodo[m]> foo, err := bar
<kodo[m]> baz, err := blah
<FromGitter> <fridgerator> yeah
<kodo[m]> after awhile your code just looks like foo, _ := whatever heh
<FromGitter> <fridgerator> lol
<kodo[m]> i like how erlang handles that sort of thing the entire process [erlang speak for lightweight thread] crashes and the supervisor just restarts it, there isn't error handling at that level heh
<kodo[m]> then you can say if this process dies like 3 times we might have a problem and do something about it, otherwise just keep going
bjz has joined #crystal-lang
echosystm has left #crystal-lang [#crystal-lang]
<kodo[m]> What is null byte in crystal?
<kodo[m]> `0_u8`?
snsei has joined #crystal-lang
domgetter has joined #crystal-lang
<domgetter> What would be the idiomatic way of iterating over a range of numbers in reverse?
<domgetter> Is #downto the way to go?
blort has joined #crystal-lang
blufor has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei_ has quit [Ping timeout: 264 seconds]
domgetter has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ssvb has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
snsei_ has quit [Remote host closed the connection]
<BlaXpirit> kodo[m], yes
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<Yxhuvud> often the idiomatic way is to find something else to iterate over, though.
<crystal-gh> [crystal] MakeNowJust opened pull request #4193: Flate: try to inflate even if @stream.avail_in is 0 (master...fix/flate/reader-believe-stream-end) https://git.io/vSky1
<FromGitter> <Zhomart> Hi, is there equivalent to ruby's `Object#send`?
<Yxhuvud> No.
<Yxhuvud> some use cases can be simulated by macros, but far from all
_whitelogger has joined #crystal-lang
blufor has joined #crystal-lang
domgetter has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
domgetter has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
<FromGitter> <alexanderadam> Hi :)
<FromGitter> <alexanderadam> Is there any easy possibility to get all mapped attributes or properties of an object instance?
<FromGitter> <fridgerator> not that I know of
<FromGitter> <alexanderadam> what a pity. thank you for your response :)
<FromGitter> <fridgerator> You might want to ask again though when more people are on
<FromGitter> <fridgerator> im not an expert
<FromGitter> <fridgerator> ;)
A124 has quit [Ping timeout: 256 seconds]
<FromGitter> <alexanderadam> btw thank you for crecto. I didn't use it yet but it looks promising :+1:
<FromGitter> <fridgerator> thanks!
<FromGitter> <fridgerator> what you're asking for might be possible with a macro, i'm just not sure exactly how
<FromGitter> <fridgerator> I usually end up doing something like : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58d68fd208c00c092a14a207]
<FromGitter> <alexanderadam> But this is pretty static, isn't it?
<FromGitter> <fridgerator> yes you would have to know the fields ahead of time
<FromGitter> <alexanderadam> Best solution I see so far is changing the property macro so that the properties can be remembered later
<FromGitter> <fridgerator> There is some crazy stuff going on in Object#dup (https://github.com/crystal-lang/crystal/blob/3c6c75e68f326bb91be35f71ae30672fd454776e/src/object.cr#L179)
<FromGitter> <alexanderadam> Ah that's an awesome hint!
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<kodo[m]> I'm getting String#match' is not expected to be invoked with a block
<kodo[m]> Does match not take a block?
<kodo[m]> oh old api version
<kodo[m]> damn u google
<FromGitter> <alexanderadam> shouldn't the type check be enough to avoid this error?
<RX14> @alexanderadam you need to assign options[:colour] to a tempoary variable
<RX14> because the value of options[:colour] could change between array accesses
sz0 has joined #crystal-lang
<FromGitter> <alexanderadam> @RX14 thank you but it doesn't work either
<RX14> code?
<FromGitter> <alexanderadam> ```color = options[:color].is_a?(Symbol) ? options[:color] : :light_blue```
<RX14> no, you have to assign options[:colour] to a tempoary variable before the type
<RX14> check
<RX14> the compiler doesn't know that options[:colour] will return the same thing when called twice
<FromGitter> <KCreate> @kodo[m] that version in the url get's me everytime 😩
<RX14> so you have to only call it once, assign to variable and do type check
<FromGitter> <alexanderadam> ah! makes sense :)
<RX14> you can probably get away with `options[:color].as?(Symbol) || :light_blue`
<FromGitter> <alexanderadam> woah - that's a nice solution
<RX14> i always forget about as?
<FromGitter> <alexanderadam> seems to work :+1:
<FromGitter> <alexanderadam> yes it works! I guess this one is somehow similar? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58d6ad987ea420cc42048fbb]
<FromGitter> <alexanderadam> Hm, this happened in the getter. I set the type setter now explicitly and the same code works.
snsei has joined #crystal-lang
kragniz has joined #crystal-lang
A124 has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
danielpclark has joined #crystal-lang
<FromGitter> <Zhomart> Hi, I have a class that has `JSON.mapping` and `DB.mapping` (DB from crystal-lang/crystal-db). ⏎ How to bulk update all properties in this model. ⏎ ⏎ ```class User ⏎ JSON.mapping({name: String, age: Int32}) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=58d6ca038e4b63533d621b5b]
<FromGitter> <Zhomart> Had anybody have experience with it?
<kodo[m]> TIl as?
<kodo[m]> all those `?` methods always get me because I'm not used to them in ruby
A124 has quit [Ping timeout: 246 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
zsx has joined #crystal-lang
zsx has quit [Ping timeout: 258 seconds]
<FromGitter> <crisward> `HTTP::Client.post_form` with multipart forms - any ideas anyone?
<RX14> doesn't work
<RX14> follow the examples on the multipart docs
sardaukar has joined #crystal-lang
<FromGitter> <Zhomart> Hi, what do you think about allowing `JSON.mapping` to generate `def attributes : Hash` and `def attributes(attrs : Hash)`? `Hash` will have type by given parameters to `JSON.mapping`.
sardaukar has quit [Quit: Leaving]
<kodo[m]> Anyone know if theres a way to refresh kemal views without stopping server?
<FromGitter> <crisward> <kodo[m]> All views are compiled, so not really, sentry is fairly quick though...
greengriminal has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
BlaXpirit has quit [Quit: Bye]
FromGitter has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<kodo[m]> thnx
greengriminal has quit [Quit: This computer has gone to sleep]
carbonage has joined #crystal-lang
<kodo[m]> Is there anything like pipe operator in crystal
<kodo[m]> from elixir
<FromGitter> <bew> see #1388
<kodo[m]> ah
<kodo[m]> just read thread
<kodo[m]> heh TL;DR No
<FromGitter> <Zhomart> Is there a tool to generate crystal binary with some data included, like images, html files?
<RX14> not currently
<RX14> it's been floated, and is possible
<RX14> but currently not implemented
<FromGitter> <Zhomart> I remeber reading something like that, but I'm looking at repos on github, but cannot find it..
<FromGitter> <Zhomart> ok.
<kodo[m]> woah crystal got new homepage
<kodo[m]> conference prices always assume you have corporate sponsorship heh