ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
alex`` has quit [Ping timeout: 245 seconds]
<FromGitter> <sam0x17> @j8r it links to the github -- not sure how else to provide the source as for some reason docker hub doesn't list the dockerfile
<FromGitter> <sam0x17> I'd be happy to make an changes that would make it more transparent I just dont know how
<FromGitter> <sam0x17> *any
<FromGitter> <fenicks> @j8r Thanks. I just realize that the cc command is to execute on target system. ⏎ It's not easy to find LLVM targets, but I found this one : aarch64-unknown-linux-gnu ⏎ 👌
gangstacat has joined #crystal-lang
chemist69 has quit [Ping timeout: 250 seconds]
chemist69 has joined #crystal-lang
z64 has quit [Quit: WeeChat 2.0.1]
<FromGitter> <naqvis> @Blacksmoke16 Played around and found that your cited behaviour is only visible when both of your Test classes are enabled. Just disable any of the Test class and code behaves normally. ⏎ https://play.crystal-lang.org/#/r/7f68 (https://play.crystal-lang.org/#/r/7f68)
<FromGitter> <kingsleyh> hi - anyone know what this exception means
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d58f429beba830fffb50d20]
<FromGitter> <naqvis> @kingsleyh WS client is not conforming to the WS protocol. You are getting this error when Server expecting Termination request, but WS client sending different Opcode
<FromGitter> <kingsleyh> oh I see - what is the best way to handle this?
<FromGitter> <naqvis> Better to have right WS client, but if you believe WS client is conforming to WS protocol higher than what current implementation supports, then I would say you extend the current functionality and implement missing Protocol features
<FromGitter> <kingsleyh> @naqvis I'm using the Crystal one here: https://crystal-lang.org/api/0.30.1/HTTP/WebSocket.html
<FromGitter> <naqvis> so both client and server are from stdlib?
<FromGitter> <kingsleyh> server is not
<FromGitter> <kingsleyh> I'm using this server: https://crystal-lang.org/api/0.30.1/HTTP/Server.html
<FromGitter> <kingsleyh> with this routing middleware: https://github.com/tbrand/router.cr
<FromGitter> <naqvis> When in your code do you receive such exception?
<FromGitter> <naqvis> Above exception you shared is from server-side component of the WS
<FromGitter> <naqvis> and its failing on decoding the client sent header information
<FromGitter> <naqvis> so I would suggest, you take a look at client portion of your code and see which invocation is causing that problem?
<FromGitter> <kingsleyh> this is the client side log
<FromGitter> <naqvis> might be some misconfiguration or it might be some bug
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d58fa18029a51607fb70b26]
<FromGitter> <kingsleyh> inside some spawn
<FromGitter> <kingsleyh> Interesting that the client mention opcode 5 but the server mentions opcode 6
_whitelogger has joined #crystal-lang
<FromGitter> <bararchy> How wierd is it for me to want a `.on_added` event based trigger for arrays and hashesh ?
ht_ has joined #crystal-lang
devil_tux has joined #crystal-lang
Groogy has quit [Quit: WeeChat 2.5]
devil_tux has quit [Ping timeout: 248 seconds]
<FromGitter> <j8r> @sam0x17 you push prebuilt images, rights? To have the source, they needs to be built automatically
alex`` has joined #crystal-lang
<FromGitter> <j8r> and you build in local
Groogy has joined #crystal-lang
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 258 seconds]
alex`` has joined #crystal-lang
<FromGitter> <Blacksmoke16> @naqvis yea but I shouldn't have to do that. I can't disable 80% of my specs just to workaround it
devil_tux has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 246 seconds]
lucasb has joined #crystal-lang
<FromGitter> <naqvis> @Blacksmoke16 agree and didn’t mean to have you disable specs 😆 thought of just sharing the finding
<FromGitter> <Blacksmoke16> ah 👍 ill add that to the issue
<FromGitter> <naqvis> thanks 👍
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <sam0x17> @j8r ah, ok I'll see if I can find a tutorial on that
<FromGitter> <sam0x17> all: is there like a "include Foo if not already included" mechanism?
<FromGitter> <tenebrousedge> you could write a macro for that
<FromGitter> <sam0x17> yeah that's what I'm thinking
<FromGitter> <sam0x17> just wanted to make sure I wasn't re-inventing the wheel first
<FromGitter> <sam0x17> depending on how `include` is implemented, it might already do that
<FromGitter> <tenebrousedge> I wouldn't think that re-running `include` would do anything significant
devil_tux has quit [Ping timeout: 244 seconds]
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<FromGitter> <sam0x17> (twice)
<FromGitter> <sam0x17> @j8r apparently you can go through the change history on any prebuilt image like this: ⏎ `docker history durosoft/crystal-alpine:0.30.1 --no-trunc`
<FromGitter> <sam0x17> good to know in general
rohitpaulk has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
<oprypin> shouldn't "include Foo if not already included" be just `include Foo` ?
<FromGitter> <sam0x17> one would think, but it looks like if you do: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5d59abbb4e17537f52587e20]
<FromGitter> <tenebrousedge> but should including a module have side effects?
<FromGitter> <sam0x17> in most cases it wont, but if it interacts with class variables that are used by other modules it could
<FromGitter> <Blacksmoke16> well in that case it would since you're executing code that happens when you do it
<FromGitter> <sam0x17> right, hence my example
<FromGitter> <Blacksmoke16> other than that id imagine the 2nd would override the first
<FromGitter> <tenebrousedge> that would be a good reason not to write code like that
<FromGitter> <tenebrousedge> class variables are a great way to run into complicated state problems
<FromGitter> <sam0x17> I would rather the compiler just prevents this or automatically only runs the first include
<FromGitter> <sam0x17> off the top of my head I can't think of an easy way to write a guard macro that prevents this -- maybe it could key off a constant I dunno
<oprypin> i think this is more about macro included
<oprypin> that causes the duplication
<oprypin> but good way to show it
<FromGitter> <sam0x17> well I'm assuming all the module macros do that like finished as well
<FromGitter> <sam0x17> the reason the behavior is this way is probably something to do with allowing people to monkey-patch the macro included section of modules
<FromGitter> <sam0x17> but you could allow that without allowing this
devil_tux has quit [Ping timeout: 248 seconds]
ht_ has quit [Remote host closed the connection]
<FromGitter> <j8r> @sam0x17 oh ok, so we can reproduce exactly the images you built - even the old ones?
<FromGitter> <sam0x17> for any layer hash you can see the commands that produced that layer, so eventually yes but it takes some trepsing around
<FromGitter> <sam0x17> its not perfect tho, the better way is to just automate it like you said, my only concern is I build when an update becomes available for the crystal package in the alpine package manager, so there is no git file change associated with that
<FromGitter> <sam0x17> could I have it activate it off of a new tag being created maybe?
<FromGitter> <sam0x17> (in git)
<FromGitter> <sam0x17> omg, gleefully surprised that this worked: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d59bc2ebb5364334c597565]
<FromGitter> <tenebrousedge> eh?
<FromGitter> <sam0x17> as in, my module can do things like `Array(Self)` where `Self` is the class that included my module
<FromGitter> <sam0x17> in this very obscure situation (defining procs at the class level that need to have references to the instances of the class that call them), it was extremely helpful
<FromGitter> <j8r> you use generics?
<FromGitter> <sam0x17> no
<FromGitter> <j8r> you could do `include Foo(T)`
<FromGitter> <sam0x17> ah that's good to know
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 272 seconds]
<FromGitter> <sam0x17> new question, is there a way to define a infinitely self-nestable type e.g.: ⏎ ⏎ ```alias MyType = Int32 | Int64 | Array(MyType)``` ⏎ ⏎ with the goal of allowing things like `Array(Array(Array(Array(Int64))))` etc ... [https://gitter.im/crystal-lang/crystal?at=5d59c4d4beba830fffbba20e]
<FromGitter> <sam0x17> well I'll be damned, it actually works out of the box
<FromGitter> <j8r> avoid recursive aliases
<FromGitter> <tenebrousedge> @j8r are they going away?
<FromGitter> <sam0x17> what's the preferred workaround?
<FromGitter> <j8r> they are known to be buggy
<FromGitter> <j8r> @tenebrousedge yes, but that's not recursive what you have shown
<FromGitter> <tenebrousedge> I said it *used* to be recursive
<FromGitter> <j8r> but you are pointing to the wrong code
<FromGitter> <j8r> back to the topic of @sam0x17
<FromGitter> <j8r> the solution is to have a container type, like `JSON::Any`
<FromGitter> <sam0x17> yeah I saw that that was a struct with a bunch of tricks on it
<FromGitter> <sam0x17> would love a high level description of the technique
<FromGitter> <j8r> that's a struct with an alias, that's it
<FromGitter> <j8r> pick the first two line ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d59c8f0029a51607fbdbe5c]
<FromGitter> <sam0x17> and once I do that, it will behave exactly as if I had done: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ? [https://gitter.im/crystal-lang/crystal?at=5d59c9397d56bc60807ccbdb]
<FromGitter> <sam0x17> only less buggy?
<FromGitter> <j8r> no
<FromGitter> <j8r> what you have done isn't the same
<FromGitter> <j8r> it's a recursive type. note the struct
<FromGitter> <j8r> that would do more or less the same yes
<FromGitter> <sam0x17> ok so its basically a drop-in replacement that's cool
<FromGitter> <j8r> not sure exactly
<FromGitter> <sam0x17> I wonder why its less buggy that way
<FromGitter> <j8r> in anyway, it's considered better
<FromGitter> <j8r> there are issue, search for "recursive alias"
<FromGitter> <sam0x17> asterite gives a very concise explanation: https://github.com/crystal-lang/crystal/issues/5155#issue-267300953
<FromGitter> <sam0x17> basically, the advantage is you can add methods to the struct version, which lets you make helpers for some annoying situations
<FromGitter> <sam0x17> if I'm reading it correctly that is
<FromGitter> <j8r> that's an advantage, obviously
<FromGitter> <j8r> thanks for the ref