<bmcginty>
Can anyone tell me how to pull in the json.mapping from an inherited class into an inheriting one? so `class A JSON.mapping end class B < A end`, B will have all class A's json.mapping bits, while still allowing b to have it's own initialize methods?
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<watzon> Here’s a hypothetical for you guys. Would it be possible, using macros, to directly modify the AST? I mean actually creating nodes and adding them rather than just using other macros’ to do trivial things
<FromGitter>
<watzon> I was looking at Nim recently and it has that ability. Just wondering if Crystal does as well
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<oprypin>
watzon, there is no such ability. you can however write a program depending on the compiler that does this, generates code, and use it at compile time of another program
<oprypin>
Nim has arbitrary code execution at compile time, Crystal has a tiny templating language that only trivially resembles Crystal
<FromGitter>
<watzon> Hmm, maybe that could be a feature in a future revision of the compiler? I don't have a use case for it at the moment, but I think it would be awesome to be able to hook into the compiler like that
<oprypin>
it is extremely doubtful
<FromGitter>
<watzon> Yeah I figured as much haha
<FromGitter>
<watzon> Probably a ton of work
<oprypin>
note that Nim basically has an interpreter that duplicates almost all functionality, in order to do that
<FromGitter>
<codenoid> hhmm, my latest chat wasnt deleted,
<oprypin>
not only is it a lot of work that nobody really has time for, but also macros are intentionally kept limited, even within the current incarnation, according to the language's creator
<FromGitter>
<johnjansen> @codenoid you can in fact *hack* something in to xml that works more like nokogiri fairly easily ⏎ again, this is not in any way recommended code, but a starting point ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5971bca576a757f80830ce38]
<FromGitter>
<watzon> Well that's a super easy macro. I feel like it should be in the standard library
<FromGitter>
<watzon> I wonder why it doesn't work in 0.23.1
<FromGitter>
<watzon> bug?
<FromGitter>
<bew> there have been some movement about macro and method lookup recently, it probably broke this example, but I'm not sure how and why exactly..
<FromGitter>
<watzon> Is there at least an easy way to check if a class has a method?
<FromGitter>
<watzon> I feel like I've seen it in the API
<FromGitter>
<crisward> Anyone here using Crystal-db ?
rohitpaulk has quit [Ping timeout: 246 seconds]
tzekid has quit [Remote host closed the connection]
Mark-6ma has joined #crystal-lang
<Mark-6ma>
how can I cache responses with memcache in kemal app?
Philpax_ has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
Disrecollection has quit [Remote host closed the connection]
tzekid has joined #crystal-lang
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
<FromGitter>
<tpberntsen> @crisward Yes, I am. :-)
mark_66 has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
<FromGitter>
<tpberntsen> @Mark-6ma: What kind of application are your developing, and what kind of responses are you looking to cache (JSON, HTML, etc.)?
raz has quit [Changing host]
raz has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
<FromGitter>
<crisward> @tpberntsen just wondering how everyone is handling connection errors. At the moment my errors trickle up to Kemal's 500 page. I can customise this, but can't help thinking there should be something else. Pretty sure the driver has retry logic in it, but I had an incident recently when a severs hard drive filled and when I cleared the issue, my node app came straight back up, but crystal needed restarting.
<FromGitter>
<tpberntsen> @crisward Ouch, a full disk is a bad thing. I haven't experienced an error like the one you mention, but I am wrapping my database requests in exception handlers to proactively handle any connectivity problems that can throw exceptions. However, a disk running full I would consider force majeure, and I wouldn't expect really any non-OS level system to recover gracefully from that situation. It's nice that
<FromGitter>
... the Node app did, though. :-)
<RX14>
@crisward you're saying that crystal-db's connection pool didn't recover after a period of failure?
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<crisward> @RX14 Not been able to recreate it locally. But I think the lack of disk space may have caused the db to not respond, as opposed to disconnect causing the failure. I'm really guessing though at this point. @tpberntsen We're using a process manager with Node (PM2), which I think was the magic behind that recovery. The full disk was caused by gitlab BTW. It's backups are massive.
Mark-6ma has quit [Quit: -]
Philpax_ has quit [Ping timeout: 246 seconds]
fenicks has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
tzekid has quit [Remote host closed the connection]