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> <phoffer> @jwoertink are you looking at Marshal for the session stuff or for something else?
<FromGitter> <jwoertink> no, it was for the session stuff. I scraped that though and just rolling with json for now
<FromGitter> <phoffer> ah ok. I was just gonna mention that Marshal was dropped in Rails land cause there are security issues, I’m not sure if that would apply to Crystal
<FromGitter> <jwoertink> though, I guess that's not the latest. But it's all good though
<FromGitter> <bew> What are you working on?
<FromGitter> <jwoertink> TL;DR A user logs in to my rails app, and is magically logged in to my kemal app
<FromGitter> <phoffer> ahh that would explain why >5.0 needs the `serializer` param
<FromGitter> <jwoertink> that would make sense
<FromGitter> <bew> Nice! (and nice require in the usage ^^)
<FromGitter> <jwoertink> Anyone know what this error means?
<FromGitter> <jwoertink> ```code paste, see link```
<crystal-gh> [crystal] MakeNowJust reopened pull request #4188: Reduce formatter's spec requires (master...fix/crystal-format/spec-reduce-dependency) https://git.io/vSTZl
fenicks has left #crystal-lang [#crystal-lang]
<FromGitter> <jwoertink> Anyone know what the reverse of this is?
<FromGitter> <jwoertink> ```icr(0.21.1) > "abc".to_json ⏎ => "\"abc\""``` [https://gitter.im/crystal-lang/crystal?at=58e866658bb56c2d11883996]
<FromGitter> <jwoertink> actually, scratch that
<FromGitter> <jwoertink> I see what I was doing wrong
<FromGitter> <elorest> is there a way to configure the crystal home page http server example to be https without using nginx or apache to proxy?
<FromGitter> <fridgerator> I know kemal can use an ssl cert without proxy
<FromGitter> <fridgerator> so, yes
<FromGitter> <fridgerator> might look at how he does it
<FromGitter> <elorest> Good idea.
fenicks has joined #crystal-lang
fenicks has quit [Ping timeout: 264 seconds]
olek_poz has joined #crystal-lang
Qchmqs has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<jhass> should be a matter of passing a properly setup OpenSSL::SSL::Context::Server to its tls parameter
_whitelogger has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
Qchmqs has quit [Ping timeout: 264 seconds]
Qchmqs has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olek_poz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Qchmqs has quit [Ping timeout: 240 seconds]
InternetFriend has joined #crystal-lang
InternetFriend has quit [Ping timeout: 240 seconds]
bmcginty has quit [Ping timeout: 268 seconds]
bmcginty has joined #crystal-lang
jj66 has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest22771
sagax has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
Guest22771 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <redcodefinal> I just found out the hard way that Slice(T) only lets you do primitive types, but I need something like it that would be a fixed size buffer that could hold a struct type. Any recommendations?
Ven has joined #crystal-lang
Ven is now known as Guest89504
Guest89504 has quit [Client Quit]
<FromGitter> <mverzilli> `StaticArray`?
<FromGitter> <mverzilli> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58e940ec8fcce56b20e29217]
_whitelogger has joined #crystal-lang
<BlaXpirit> so, Go has Qt bindings now https://github.com/therecipe/qt
<FromGitter> <fridgerator> i just saw that
<BlaXpirit> the implementation of C++ -> C wrappers is so familiar to me, very similar to what i did https://github.com/oprypin/crsfml
<FromGitter> <sdogruyol> wow
<FromGitter> <sdogruyol> this is tons of work
<BlaXpirit> i figured out some parts of qt but it would indeed need a lot of work. i certainly don't have enough time to do it alone now
<FromGitter> <sdogruyol> i'm really jealous of all the resources going to go
<BlaXpirit> it's mostly one person anyway
<BlaXpirit> wow it's a long running project alright
<BlaXpirit> i want to do the qt bindings for crystal so much but it's so scary :p
<FromGitter> <fridgerator> qt is huge
<FromGitter> <sdogruyol> what i meant is that
<BlaXpirit> obviously it would be autogenerated, that's not new to me
<FromGitter> <sdogruyol> nvm :P
bjz has joined #crystal-lang
jj66 has quit [Ping timeout: 260 seconds]
<FromGitter> <redcodefinal> @mverzilli Thank you for the help! StaticArray looks good but I am having some issues making some things work. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58e969d17ea420cc4250095f]
<FromGitter> <redcodefinal> In this example of how I would use this the crystal compiler complains that I can't use ```X * Y``` on the 5th and 7th line. It seems to only except a literal like `10`. Is there any way I can get this behaviour working?
<RX14> @redcodefinal you might have to macro that one
<FromGitter> <redcodefinal> @RX14 haha sounds like fun. do I need to set up a macro for the whole class? I may have found a weird workaround but I'm guessing crystal won't accept needing to do anything as a class argument. I actually didn't even know that you could use anything but a class in those arguments.
<RX14> let me have a fiddle...
<FromGitter> <redcodefinal> ty ty I didn't think it would be this hard to implement a static 2d and 3d array. I was using Slice(T) before but then I found out that it didn't handle non-primitive types wich was a surprise.
<FromGitter> <redcodefinal> I'm kind of interested in why they built StaticArray(T, N) to take N instead of StaticArray(T).new(size, value), I love that I can look at the source code and find out.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> Slice(T) handles non-primitives...
<RX14> and StaticArray is stack allocated
<RX14> i.e. it's size needs to be known at compile time to allocate the correct number of things on the stack
<RX14> or, as this is a class, in this case it's to know the size of the class
<FromGitter> <mverzilli> StaticArray is very very special, there's a related discussion here: https://crystal-lang.org/2016/09/09/a-story-of-compromises-and-types.html
<RX14> here it's best just to take the hit and use a normal array
bjz has joined #crystal-lang
<FromGitter> <redcodefinal> darn, weird why Slice(T) was complaining earlier today about using it for a non-primitive type. If I could use Slice that would be the best. This is what I get https://play.crystal-lang.org/#/r/1u81
<RX14> @redcodefinal you can use Slices, but you can't use Slice.new(size) for non-ints without providing a default value
<RX14> I suggest you provide a default value for the TIme
<RX14> Tile*
<FromGitter> <redcodefinal> Ah I see that might be better.
<FromGitter> <redcodefinal> @RX14 your Slice recommendation worked wonders! Ty RX14!
<RX14> np :)
<FromGitter> <redcodefinal> @RX14 well I thought I fixed it but now it seems to have gone back https://play.crystal-lang.org/#/r/1u8o
<RX14> that code shouldn't compile
<RX14> looks like a bug
<RX14> do this
<FromGitter> <redcodefinal> @RX14 how so? Although I did manage to get it work like this https://play.crystal-lang.org/#/r/1u8p I guess it wants it to be in T.new
<FromGitter> <redcodefinal> haha
<FromGitter> <redcodefinal> thats interesting
<RX14> the &block wasn't in the args list...
<RX14> it didn't work when it was in the args list with a weird error
<RX14> 9another compielr bug?)
<RX14> but not capturing worked
<FromGitter> <redcodefinal> Yeah that is a little strange
<FromGitter> <redcodefinal> well i think that about solves my issue, I'll probably be back with more questions later. I'm almost to the point where I have a working program.
<FromGitter> <redcodefinal> Does Slice(T) not support having a union type or something?It doesn't seem to like being nillable or something. https://gist.github.com/redcodefinal/69bbfb5aac8807c2223a14dfb3e76798
<RX14> @redocdefinal you need to cast the nil to the union
<RX14> nil.as(Int32?)
<RX14> wait no
<RX14> nil.as(Time?)
<RX14> nil.as(Tile?)