RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.0 | Fund Crystals 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
<travis-ci> crystal-lang/crystal#28a6f06 (master - Docs: show `T | Nil` as `T?`): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/178128948
kulelu88 has quit [Quit: Leaving]
shawn42 has quit [Quit: Connection closed for inactivity]
woodruffw has joined #crystal-lang
woodruffw has quit [Changing host]
woodruffw has joined #crystal-lang
echosystm has left #crystal-lang [#crystal-lang]
ssvb has quit [Quit: Leaving]
woodruffw has quit [Ping timeout: 260 seconds]
woodruffw has joined #crystal-lang
DeBot has quit [Ping timeout: 260 seconds]
CompanionCube has quit [Ping timeout: 250 seconds]
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CompanionCube has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
woodruffw has quit [Remote host closed the connection]
<FromGitter> <maiha_twitter> I'm trying 0.20.0 to my existing lib. It works when both `libs` and `lib` exist after `shards update`. But it fails after removing old `libs`. We need more info about using shards-0.7.0, I think. ⏎ `while requiring "toml": can't find file 'toml' relative to ...`
<FromGitter> <jwoertink> I got that same error with pool after upgrading to 0.20
<FromGitter> <jwoertink> I just removed both dirs, and the shards.lock, and then ran `shards install` and it all worked again
<FromGitter> <maiha_twitter> Oh, nice! I'll try i! :)
<FromGitter> <jwoertink> good luck
<FromGitter> <maiha_twitter> Hmm, I got same errors. But it succeeded in travis. So it would be a problem of my env such as using crenv. ⏎ https://travis-ci.org/maiha/toml-config.cr/builds/178189686
<FromGitter> <jwoertink> oh weird
mgarciaisaia has joined #crystal-lang
LogenKain has joined #crystal-lang
<FromGitter> <maiha_twitter> @jwoertink I'll try trial and error. Thanks anyway! :)
<FromGitter> <jwoertink> If you figure it out, maybe post in here in case anyone else runs in to it?
<FromGitter> <maiha_twitter> Yep, sure!
LogenKain has left #crystal-lang [#crystal-lang]
mgarciaisaia has quit [Ping timeout: 240 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 245 seconds]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
akwiatkowski has joined #crystal-lang
DeBot has joined #crystal-lang
bjz has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
mark_66 has joined #crystal-lang
Fichtenstein has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
Ven_ has joined #crystal-lang
<FromGitter> <maiha_twitter> Found that it seems a problem of crenv where new library path is not passed to `CRYSTAL_PATH` yet. ⏎ Created PR. https://github.com/pine/crystal-build/pull/59/files
<FromGitter> <splattael> Crystal 0.20 \o/ Well done! Thank you :green_heart:
<FromGitter> <splattael> Any idea how to handle the switch from `libs` to `lib` on CI (with cached `libs`) other than `rm -fr libs`?
<FromGitter> <splattael> Otherwise, shard uses `libs` if it exists (where an older version of `minitest.cr` 0.3.4 installed).
Ven_ has quit [Read error: No route to host]
Ven_ has joined #crystal-lang
gloscombe has joined #crystal-lang
Ven_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven_ has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ysbaddaden> you must upgrade shards to v0.7 too (or use the bundled one)
<FromGitter> <ysbaddaden> sadly, there is easy way to transform libs to lib, because it's not just a rename, we now extract the whole shard, no just the contents of the src folder.
<FromGitter> <splattael> @ysbaddaden Reverting `libs:lib` (prefering `lib` over `libs`) in `CRYSTAL_PATH` would work for me
<FromGitter> <splattael> I'm trying to push a repro
<FromGitter> <splattael> Should read:
<FromGitter> <splattael> ```export CRYSTAL_PATH=$CRYSTAL_ROOT/src:libs:lib```
<FromGitter> <splattael> (edited)
<FromGitter> <splattael> @ysbaddaden Damn, I cannot reproduce it on a fresh lib :/
<FromGitter> <splattael> @ysbaddaden it's "broken" on an existing lib where `minitest.cr 0.3.4` was installed with 0.19.4. I've upgraded to `minitest.cr 0.3.5` with 0.20.0 so both `libs` and `lib` exist. Running specs gives an error: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Setting `CRYSTAL_PATH` like `export CRYSTAL_PATH=$CRYSTAL_ROOT/src:lib:libs` (`libs`<-> `lib`) helps. [https://gitter.im/crystal-lang/crystal?at=58357277b07a1fd3482fc5c3]
<FromGitter> <ysbaddaden> please upgrade to minitest v0.3.5 and *drop* `libs`
<FromGitter> <splattael> So crystal prefers `lib` instead of `libs`. No need to remove `libs`.
<FromGitter> <ysbaddaden> it's not supposed to be working anymore
<FromGitter> <ysbaddaden> it may work by change, but will most likely break in unexpected ways
<FromGitter> <splattael> @ysbaddaden yes, dropping `libs` is seems strange on CI... but ok I'll do it. Thanks!
optikfluffel has joined #crystal-lang
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <splattael> @ysbaddaden Should be `libs` then removed from `CRYSTAL_PATH`?
<FromGitter> <ysbaddaden> yes, it was removed in 0.20
<FromGitter> <ysbaddaden> official builds don't have `libs` anymore in `CRYSTAL_PATH`
optikfluffel has joined #crystal-lang
<FromGitter> <splattael> It's still there
Fichtenstein has quit [Ping timeout: 256 seconds]
optikfluffel has quit [Client Quit]
<FromGitter> <splattael> Also, on my Debian installation in `/usr/bin/crystal`
<FromGitter> <ysbaddaden> damn, it shouldn't be
<FromGitter> <splattael> https://github.com/crystal-lang/crystal/commit/fece2f795fb5baeb24ae410be2a99ca277be862f just adds `lib` everywhere but does not drop `libs`
optikfluffel has joined #crystal-lang
<FromGitter> <splattael> *THAT* was my point. If only adding `lib` was intended then reversing the both would be upgrading.
<FromGitter> <splattael> *help
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
<FromGitter> <ysbaddaden> I guess I understand the issue now
<FromGitter> <splattael> :D text is hard, sorry :/
<FromGitter> <ysbaddaden> `libs` is taking precedence over `lib`, but upgrading dependencies will install them into `lib` but an older version is being picked.
<FromGitter> <splattael> :+1:
<FromGitter> <splattael> So either remove `libs` from path (and .gitignore.ecr too!) and swap `lib` <-> `libs` in path.
<FromGitter> <ysbaddaden> workaround: get rid of the `libs` folder altogether; solution: get rid of `libs` from the CRYSTAL_PATH definition, or at least have `lib` take precedence in 0.20.x
<FromGitter> <splattael> yes, removing seems the cleaner solution won't break in unexpected ways as you mentioned.
soveran has quit [Remote host closed the connection]
Ven_ has joined #crystal-lang
akwiatkowski has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
optikfluffel has joined #crystal-lang
Fichtenstein has joined #crystal-lang
optikfluffel has quit [Quit: Textual IRC Client: www.textualapp.com]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
Philpax has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
<FromGitter> <yxhuvud> Are there any examples of using zlib around? From reading the code, it seems I have to wrap my Slice(uint8) in an IO object of some kind. That seems like more ceremony than I expected.
Philpax has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/v1e4M
<crystal-gh> crystal/master e0ac47c Ary Borenszweig: Fixed #3567: crystal init generates old version in shard.yml
<crystal-gh> crystal/master 69c8ee4 Ary Borenszweig: Fixed #3570: formatter bug related to binary op inside block inside assign
<crystal-gh> crystal/master b8602fb Ary Borenszweig: Fixed #3568: incorrect links for `::T` paths in comments
Fichtenstein has quit [Read error: Connection reset by peer]
<FromGitter> <asterite> @yxhuvud what do you need to do?
<FromGitter> <yxhuvud> Basically I'm parsing the format specified at https://github.com/HdrHistogram/HdrHistogram.NET/wiki/Encoded-Histogram-format
optikfluffel has joined #crystal-lang
<FromGitter> <yxhuvud> But I've managed to inflate it, so now I am trying to figure out how to cast a slice of 4 bytes to an integer
<FromGitter> <asterite> Yeah... I think that's missing. There's a method to decode it from an IO, but not from a slice. I think I'll add methods for that
emancu has joined #crystal-lang
<FromGitter> <yxhuvud> ok I'll get by with macro convert(type, slice);{{type}}.from_io(MemoryIO.new({{slice}}), IO::ByteFormat::BigEndian); end meanwhile, even if it is a bit horrible ;)
<FromGitter> <sdogruyol> Nice
<FromGitter> <asterite> @yxhuvud I managed to write this: https://gist.github.com/asterite/719e478f6f3dfd30a59405897d37dcd7 . It of course depends on decoding directly from a slice, but I'll commit that soon. Decoding is a bit verbose because you need to type the whole byte format, but it can be hidden behind a method or two
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <sdogruyol> @yxhuvud :heart:
<FromGitter> <sdogruyol> Oops @asterite :heart:
<FromGitter> <yxhuvud> wow, thanks. That is a lot more than I asked for :)
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v1egg
<crystal-gh> crystal/master d7b4bd3 Ary Borenszweig: ByteFormat: added methods to read/write from/to a slice
<FromGitter> <asterite> Committed! I just wanted to see how easy/hard it was to write that in Crystal, and, well, something was missing...
Ven_ has joined #crystal-lang
emancu has quit []
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v1e2N
<crystal-gh> crystal/master c758737 Ary Borenszweig: MemoryIO -> IO::Memory in some doc comments
pduncan has quit [Ping timeout: 240 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#d7b4bd3 (master - ByteFormat: added methods to read/write from/to a slice): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/178292274
ponga has joined #crystal-lang
<FromGitter> <luislavena> @asterite a quick design question if you have a minute. I'm migrating some old code to latest Crystal
<FromGitter> <luislavena> and wondered if will be good to *extend* `HTTP::Server::Context` with extra elements (eg. session, instrumentation) as part of some of the HTTP handlers
<FromGitter> <luislavena> so when you require them, they add that extra element to the Context and is available. Does that sound intrusive or would you say will be expected?
pduncan has joined #crystal-lang
ponga has quit []
<FromGitter> <asterite> @luislavena We actually talked about that with @waj in the past and we like that pattern. It's type safe and efficient. The only "problem" could happen if two extensions use the same name, but it's the same issue with class names, etc., so maybe not a big deal
pduncan has quit [Ping timeout: 258 seconds]
<FromGitter> <luislavena> :thumbsup:
<FromGitter> <luislavena> was wondering the scenario when the handler is required for the helper method on the context to work, if not added to the chain, then invoke the helper will blow :tongue:
<FromGitter> <luislavena> s/blow/blow up
hako_ has quit [Ping timeout: 260 seconds]
hako_ has joined #crystal-lang
<FromGitter> <luislavena> (that you forgot to add the handler to the chain when building the server, but you invoked the method anyway)
<FromGitter> <asterite> Ah, yes, but that can be fixed easily, I guess :-)
<travis-ci> crystal-lang/crystal#c758737 (master - MemoryIO -> IO::Memory in some doc comments): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/178295936
<FromGitter> <yxhuvud> Hmm, do we have any way of doing a non-arithmetic rightshift?
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
optikfluffel has joined #crystal-lang
pduncan has joined #crystal-lang
<FromGitter> <luislavena> @yxhuvud `Int#<<` and `Int#>>` does that help?
<FromGitter> <yxhuvud> > is arithmetic rightshift. << is left shift. Not the same.
<FromGitter> <yxhuvud> eh.
<FromGitter> <luislavena> @yxhuvud you want to shift bits, right? a bitwise shifting?
<FromGitter> <yxhuvud> I want to shift right, and shift in zeroes
<FromGitter> <spalladino> :point_up: November 21, 2016 11:33 AM (https://gitter.im/crystal-lang/crystal?at=583305a852af72f05432d59d) @kbrock we spent some time with @waj and @mverzilli yesterday on this, and got this working https://gist.github.com/spalladino/10c829db3191a89a8ba73bb001d3c921
<FromGitter> <spalladino> It's just a PoC, but it shows that it should be possible; we are wrapping Crystal objects as Ruby values, and using Ruby's `free` callbacks to have them collected by the Crystal GC.
<FromGitter> <spalladino> The main thing to look out for are mulithreaded invocations from Ruby
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pduncan has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
kulelu88 has joined #crystal-lang
w400z has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Raimondi has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
<FromGitter> <xdougx> how it works?
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Raimondii is now known as Raimondi
gloscombe has quit [Read error: Connection reset by peer]
<FromGitter> <spalladino> It creates Ruby classes using the Ruby C API (see https://silverhammermba.github.io/emberb/c/), and returns Crystal objects wrapped as Ruby objects
gloscombe has joined #crystal-lang
A124 has quit [Ping timeout: 250 seconds]
A124 has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
<FromGitter> <xdougx> crazy stuff :D
<FromGitter> <phoffer> @spalladino are you guys considering further work on that?
<FromGitter> <sdogruyol> @luislavena i extensively use that pattern also :)
<FromGitter> <kbrock> @spalladino thanks so much
mati_urunda has joined #crystal-lang
<FromGitter> <spalladino> @phoffer eventually yes, Crystal sounds like a much better choice than C for a Ruby developer to write a native extension; but I guess we'll be focusing on parallelism first
gloscombe has quit [Quit: Lost terminal]
<FromGitter> <sdogruyol> :+1:
<FromGitter> <spalladino> @kbrock a pleasure! And thank *you* for bringing up to front this usage for Crystal
<FromGitter> <sdogruyol> Parallelism <3
<FromGitter> <sdogruyol> @spalladino please don't forget crystal-db it's awesome and needs more love :)
gloscombe has joined #crystal-lang
<FromGitter> <phoffer> Whenever you get there, would you be open to some collaboration? I’ve done a lot of work for that, but don’t enough low level knowledge to get it production worthy
<FromGitter> <xdougx> crystal-db implementation +1
mgarciaisaia has quit [Ping timeout: 260 seconds]
gloscombe has quit [Client Quit]
<FromGitter> <drosehn> I have a few projects where I'd like to try using LLDB from crystal, FWIW. But as always, I can dream up new projects much faster than I can write them.
<FromGitter> <spalladino> @phoffer absolutely! I've just seen https://github.com/phoffer/crystalized_ruby and it has some truly awesome work. We'll reach out to you as soon as we start tackling this to join our efforts :-)
<FromGitter> <spalladino> @sdogruyol yep, especially having a "blessed" crystal-db compatible postgresql adapter. I know will was doing some work in that direction, but I'm not sure about the status. @bcardiff was working heavily on crystal-db, though he's off during this week. I'll make sure to coordinate with him to speed things up.
<FromGitter> <xdougx> it will be able to write ruby and transport to crystal and inverse of?
<FromGitter> <sdogruyol> @spalladino that'd be awesome, because i've used pg and crystal-db
<FromGitter> <sdogruyol> and i can say that crystal-db is really great
<FromGitter> <sdogruyol> we should definitely make this defacto
<FromGitter> <phoffer> @spalladino That would be amazing. I’ve been hoping somebody smarter than myself would get interested in the concept :) Not everything works yet, but I do have a part of Ruby’s ActiveSupport fully replaced using a Crystal ext, so a non-trivial example
<FromGitter> <spalladino> That's the idea. It's actually inspired in Go's SQL package https://golang.org/pkg/database/sql/, which defines a standard interface for sql-like libs.
<FromGitter> <sdogruyol> @spalladino yeah it's really great api
mgarciaisaia has joined #crystal-lang
optikfluffel has joined #crystal-lang
<FromGitter> <spalladino> @phoffer that's great. I guess the first step would be to define a friendly API to writing these extensions, and then start working on useful extensions to Ruby, such as the ones you've got. We'll stay in touch ;-)
<FromGitter> <phoffer> :thumbsup:
<crystal-gh> [crystal] ysbaddaden opened pull request #3572: Android targets [WIP] (master...support-android) https://git.io/v1v3J
<FromGitter> <ysbaddaden> @spalladino great work on the ruby example. it looks great!
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
datanoise has joined #crystal-lang
datanoise has quit [Client Quit]
<FromGitter> <spalladino> It was most @waj's :-)
<FromGitter> <sdogruyol> Kemal 0.17.0 released! https://twitter.com/crystalkemal/status/801496475662422022
<FromGitter> <spalladino> :clap:
<Papierkorb> sdogruyol: +1
Renich has joined #crystal-lang
optikfluffel has joined #crystal-lang
soveran has quit [Remote host closed the connection]
optikfluffel has quit [Ping timeout: 258 seconds]
<FromGitter> <sdogruyol> Thanks :smile:
mgarciaisaia has quit [Quit: Leaving.]
soveran has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter> <raydf> Hi everyone , i'm receiving the context.request.body io with empty string, is there any spec related to this in the new version?
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <raydf> I'm using gets_to_end
<FromGitter> <raydf> @sdogruyol nice work with the new version of kemal.
<FromGitter> <spalladino> @raydf there were indeed some changes w.r.t. http body IO (see here (https://crystal-lang.org/2016/11/22/crystal-0.20.0-released.html)). Could you share a failing example?
<FromGitter> <johnjansen> @raydf check its not a redirect
<FromGitter> <raydf> I'll try to reduce the example, i'm doing exactly the same as the example.
<FromGitter> <johnjansen> oh and dont you mean response
<FromGitter> <raydf> I'm using the Io with from_json
<FromGitter> <sdogruyol> Yeah there's definitely something changed
<FromGitter> <raydf> *I'll try to create a failing example for an issue, let's see if i can reduce it.
<FromGitter> <sdogruyol> There's already a issue in kemal
<FromGitter> <raydf> I'm not using kemal
<FromGitter> <raydf> that's the strange part
<FromGitter> <sdogruyol> Yeah it's probably related to io
<FromGitter> <sdogruyol> :)
<FromGitter> <raydf> As a side note @sdogruyol, IMHO i believe that the kemal docs should have this excellent routing scheme as an example: https://gist.github.com/cjgajard/b36ffed8070afc53f682b418ebf5476e, For noobs like myself this helped me a lot for a big future project.
<FromGitter> <sdogruyol> @raydf yeah yesterday I was saying the same that Kemal needs a cookbook for great stuff like this
<FromGitter> <raydf> :+1:
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
akwiatkowski 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
mati_urunda has quit [Ping timeout: 260 seconds]
A124 has quit [Remote host closed the connection]
A124 has joined #crystal-lang
<FromGitter> <raydf> Found my problem
<FromGitter> <raydf> just for full diclosure i was reading from io in a filter and later read again from the io and there where no more data to get, so an empty string returned and there's no rewind method implemented.
<FromGitter> <raydf> *disclosure
Philpax has joined #crystal-lang
<FromGitter> <drosehn> Ugh. Well, to correct a typo in an earlier message of mine: I have a few projects where I'd like to try using *LMDB* from crystal. As seen in https://github.com/LMDB/lmdb
soveran has quit [Remote host closed the connection]