ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.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
duane has joined #crystal-lang
<hightower3> Daniel-Worrall: Done, thanks, good suggestions
<hightower3> Blacksmoke16 cool, static events seem like a really interesting approach to certain types of requirements
<FromGitter> <Blacksmoke16> Yea, the requirement you did for like removing and adding dynamically makes it a bit trickier
<FromGitter> <Blacksmoke16> As we found out hq
<FromGitter> <Blacksmoke16> Ha
<hightower3> hehe :)
<FromGitter> <ilanpillemer> methods via class seem much slower than methods just in a module.. is that expected?
<FromGitter> <Blacksmoke16> Benchmark it?
dwdv has left #crystal-lang ["leave"]
<FromGitter> <ilanpillemer> well.. the one version finishes running and the other doesnt
<FromGitter> <ilanpillemer> so I cant benchmark something so slow it never finishes!
<FromGitter> <ilanpillemer> maybe if I left it overnight..
<FromGitter> <ilanpillemer> just wondering if that is expected
<FromGitter> <tenebrousedge> not really
<hightower3> Hey remind me please, how can I see what text macros expanded into at some point in code? I thought it was something like {{ debug }} but can't get it to work
<FromGitter> <Blacksmoke16> That's it but you have to add it to the macro or within begin end tags
<hightower3> It seems that method description is not preserved over more than 1 macro... like... (example follows :)
<hightower3> I have also tried defining macros in a single line to avoid the potential issue of a newline appearing between documentation and "class", but it didn't help
<hightower3> Also while doing that I seem to have found that while e.g. "def x()nospaceMoreText" works, "macro x()nospaceMoreText" throws error
<hightower3> Well, at least in some cases it doesn't... got one example where it works, one where not
<FromGitter> <Daniel-Worrall> hightower3 do you know if your event lib is MT safe?
<hightower3> The only part where it writes something is when it is adding the handler into the array of handlers, or when removing something from that array.
<hightower3> It uses #insert_at and #delete for that.
<hightower3> So... should have a good chance for yes?
<FromGitter> <phangs> hello, newbie here
<FromGitter> <Blacksmoke16> o/
<hightower3> \o
<FromGitter> <phangs> i'm new in programming but have done few small apps using node, the basic stuff. html, css, js. now i want to shift to real programming and decided to use crystal. unfortunately there are a very few resource for newbies. any pointers? i tried using amber and followed starter guide but i realized i should not use a framework to automate some tasks.
<FromGitter> <tenebrousedge> I like using frameworks and automation
<FromGitter> <Blacksmoke16> or just ask here
<FromGitter> <tenebrousedge> I also recommend doing the Crystal track on Exercism (https://exercism.io)
<FromGitter> <Blacksmoke16> https://forum.crystal-lang.org/
<FromGitter> <Blacksmoke16> hightower3: what would the use case be for supporting removing listeners at runtime?
<hightower3> Blacksmoke16 well just one which I've seen in the source code I was looking at, a handler attaches itself and then removes itself if it detects a more suitable handler being subscribed
<FromGitter> <phangs> those are great resources, bookmarked
<FromGitter> <Blacksmoke16> im trying to think if i should support it
<FromGitter> <phangs> thank you very much
<FromGitter> <Blacksmoke16> np
<hightower3> another reason would be anything conditional, like e.g. turning mouse events on/off at will
<FromGitter> <Blacksmoke16> was thinking more so in the web framework context
<FromGitter> <Blacksmoke16> i mean if i can do it i my as well?
<FromGitter> <Blacksmoke16> im sure someone could come up with something where "oh i wish i could do x"
<hightower3> certainly :)
<FromGitter> <Blacksmoke16> ill keep you posted πŸ˜‰ i think it'll be pretty clean
<hightower3> awesome!
<FromGitter> <Blacksmoke16> yea
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dca0b72eeb63e1a8398a6b1]
<FromGitter> <Blacksmoke16> provide it the event and listener class
<FromGitter> <Blacksmoke16> now should i support adding them at runtime 😐
<FromGitter> <Blacksmoke16> im thinking no
<FromGitter> <Blacksmoke16> ...for now
<FromGitter> <Blacksmoke16> shouldnt this warn me that that method isn't defined? https://play.crystal-lang.org/#/r/802z
<FromGitter> <Blacksmoke16> ah the default value breaks it
<FromGitter> <Blacksmoke16> that should prob be an error...
<FromGitter> <ImAHopelessDev_gitlab> @watzon it's going well! I've been a code warrior with Crystal lately
<FromGitter> <ImAHopelessDev_gitlab> @phangs just take a look at the gitbook tbh. that's what i did
f1refly has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 268 seconds]
f1refly has quit [Ping timeout: 240 seconds]
f1reflyylmao has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Blacksmoke, hot loading and removing plugins that act on events. Ability to add and remove at runtime is a large benefit.
<FromGitter> <Blacksmoke16> would you be ok with a more explicit way of adding them dynamically?
<FromGitter> <Blacksmoke16> cant do much casting magic like i can at runtime
<FromGitter> <Blacksmoke16> well could use a macro to help i think, so maybe wouldnt be *too* bad
ht_ has joined #crystal-lang
<FromGitter> <watzon> @Blacksmoke16 how goes adding that feature to CrSerializer?
ht_ has quit [Remote host closed the connection]
Stephanie has quit [Ping timeout: 240 seconds]
Vexatos has quit [Ping timeout: 240 seconds]
Stephie has joined #crystal-lang
alexherbo27 has joined #crystal-lang
alexherbo27 has quit [Read error: Connection reset by peer]
Vexatos has joined #crystal-lang
alexherbo27 has joined #crystal-lang
_whitelogger has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
HumanG33k has joined #crystal-lang
olbat[m] has quit [Remote host closed the connection]
beepdog has quit [Remote host closed the connection]
vegai has quit [Remote host closed the connection]
ternarysolo has quit [Write error: Connection reset by peer]
erdnaxeli has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
<FromGitter> <Blacksmoke16> @watzon debating if i should try to support nested types
<FromGitter> <Blacksmoke16> is a bit tricker as i need to do everything so its format agnostic
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<hightower3> Who can be contacted regarding (re)enabling SSL on crystal-ann ?
vegai has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
duane has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
beepdog has joined #crystal-lang
olbat[m] has joined #crystal-lang
ternarysolo has joined #crystal-lang
erdnaxeli has joined #crystal-lang
<hightower3> Hey check out this one: https://play.crystal-lang.org/#/r/807s
<hightower3> Why does setting 'a' work, but setting 'b' not? Or, how to make 'b' work?
<hightower3> sorry need to update the paste..
<FromGitter> <tenebrousedge> I'd also like to know a solution to that, but I'm not sure it's possible
<hightower3> https://play.crystal-lang.org/#/r/807w .. just minimally updated but the issue is the same
<FromGitter> <Blacksmoke16> pretty sure the error is clear enough
<FromGitter> <tenebrousedge> and that's a different issue :/
<FromGitter> <Blacksmoke16> you're not yielding any args so you dont need the `|s|`
<hightower3> But where/why would I yield, I'm trying to capture the block
<FromGitter> <Blacksmoke16> but you're not?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/808c
alexherbo27 has quit [Ping timeout: 240 seconds]
alexherbo27 has joined #crystal-lang
alexherbo276 has joined #crystal-lang
alexherbo27 has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
alexherbo276 has quit [Ping timeout: 265 seconds]
vegai has left #crystal-lang ["User left"]
<hightower3> aaah, of course! Thanks!
<FromGitter> <Blacksmoke16> np
alexherbo276 has joined #crystal-lang
<hightower3> Is there anything to be discussed regarding Tenebrousedge's related question, as to why https://play.crystal-lang.org/#/r/807s couldn't automatically use the block as a proc?
<hightower3> actually... I'm not sure what the question was there.
<FromGitter> <tenebrousedge> it's related to the React problem on Exercism
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dcadf3292a84f79fe549e42]
woodruffw has quit [Ping timeout: 240 seconds]
woodruffw has joined #crystal-lang
ht_ has joined #crystal-lang
alexherbo276 has quit [Ping timeout: 240 seconds]
alexherbo276 has joined #crystal-lang
alexherbo276 has quit [Ping timeout: 265 seconds]
ht_ has quit [Remote host closed the connection]
ht_ has joined #crystal-lang
alexherbo276 has joined #crystal-lang
alexherbo276 has quit [Read error: Connection reset by peer]
alexherbo276 has joined #crystal-lang
<repo> hey
<FromGitter> <Blacksmoke16> hi
<repo> i wrote a little http proxy and got the following error when i'm running it: malloc(): unsorted double linked list corrupted
<repo> there's no other information :/
<repo> does this ring any bells for someone?
<repo> it's pretty simple actually: malloc(): unsorted double linked list corrupted
<repo> ups
<repo> i've never heard that error before :/
<repo> *seen
<repo> ahh
<repo> i think it's a race condition
gangstacat has quit [Quit: Ĝis!]
<repo> meh
<repo> wrapping session access in a mutex didn't help
<repo> this is the current state: https://p.jokke.space/XrIX/
<hightower3> I notice one inconvenient behavior. I thought the first line of documentation is taken as headline / short description. However, only the first sentence on the first line is taken.
<hightower3> What's the general opinion on this, and was this added because too much documentation was improperly formatted, having overly long first lines?
woodruffw has quit [Ping timeout: 268 seconds]
<repo> not sure if i have an opinion on that
<repo> i guess i would prefer treating the whole line as a headline/short description
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
woodruffw has joined #crystal-lang
dannyAAM has joined #crystal-lang
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> its the first sentence or the first line
<FromGitter> <Blacksmoke16> er let me rephrase
<FromGitter> <Blacksmoke16> its always the first sentence, either the ending character is a newline or a period
<hightower3> Yes, yes, and I found it inconvenient to be first sentence. I hoped for first line, regardless of dots appearing in it.
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 268 seconds]
<repo> hmmm it seems HTTP::Client isn't threadsafe
<repo> if i wrap the @client.exec(...) in a mutex it works
<hightower3> mm I see that if I do "x = true", it doesn't show up in documentation with documented type, whereas if I do "x : Bool[ = value]" it does. Is this a known limitation of crystal 'docs' command?
<FromGitter> <Blacksmoke16> why would it? its just text
<hightower3> Also I find it suboptimal that if I do "x : Bool = true", the default of 'true' is not documented; it only shows type.
<FromGitter> <Blacksmoke16> or do you mean when you do like `def foo(x = true)`
<hightower3> I have like this exactly: "class_property? async = true". I first had to add type("async : Bool") for the type to show in the docs, but "= true" didn't show in any case.
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> prob is a side affect of having optional types, in that case, the type of async was inferred from the bool
<FromGitter> <Blacksmoke16> i always specify both type and default for that purpose, and just makes it more clear in the future
<hightower3> yes, I did so but still no default value showing
<FromGitter> <Blacksmoke16> prob is more so because the default is applied to the class var, which neither class vars nor ivars are shown in the docs
<FromGitter> <Blacksmoke16> only methods
<hightower3> yeah, that must be it
<hightower3> almost forces me to define a constant with default value then set var's default to that constant
<hightower3> so that at least the constant is documented
<FromGitter> <Blacksmoke16> does it make sense for it to be a class level thing?
<FromGitter> <Blacksmoke16> never going to need to have one instance be async and another not?
<hightower3> Yes, well even more specifically I define it on the module... just 3 or 4 globally configurable knobs
<FromGitter> <Blacksmoke16> fair enough
alexherbo276 has quit [Ping timeout: 240 seconds]
alexherbo276 has joined #crystal-lang
<FromGitter> <watzon> @Blacksmoke16 nested types would be nice af, but if not there are worse things if you're not able to
<FromGitter> <Blacksmoke16> yea would be nice but i'll have to mess with it more
<FromGitter> <Blacksmoke16> kinda got sidetracked with my event thing
<FromGitter> <watzon> Ahh making an event handler for Athena?
<FromGitter> <Blacksmoke16> will be its own shard, but used in Athena yea
<FromGitter> <watzon> I may integrate that into my library too. I'm gonna need a good event management library.
<FromGitter> <Blacksmoke16> idea is for it to replace `HTTP::Handler` middleware
<FromGitter> <Blacksmoke16> i.e. another shard, or another Athena component could simply define a listener on like `request` on `exception`, and it would just work
<FromGitter> <Blacksmoke16> w/o having to add it to the handlers array
<FromGitter> <watzon> That's cool
<FromGitter> <Blacksmoke16> main use case would be mainly on exception and request
<FromGitter> <Blacksmoke16> request event could handle stuff like CORs
<FromGitter> <Blacksmoke16> request listeners*
<FromGitter> <Blacksmoke16> while exception could first globally log the exception before returning the response etc
<FromGitter> <Blacksmoke16> is the plan at least :p
alexherbo276 has quit [Ping timeout: 265 seconds]
<FromGitter> <Blacksmoke16> @watzon hightower3 also released https://github.com/crystallabs/event_handler
<FromGitter> <watzon> Yeah I saw that. It looks promising
<FromGitter> <Blacksmoke16> will depend on what syntax/UX you like the most
<FromGitter> <watzon> I'm really excited for him to finish that console gui toolkit
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/808e is what i was thinking for mine
<FromGitter> <Blacksmoke16> indeed :p just have to wait and see
<hightower3> Yeah looks promising indeed, I think all the major technical uncertanties have been worked out
<FromGitter> <Blacksmoke16> bum bum bum
<hightower3> So, just going in layers adding stuff
alexherbo276 has joined #crystal-lang
duane has quit [Ping timeout: 245 seconds]
ht_ has quit [Quit: ht_]
duane has joined #crystal-lang
Yxhuvud has joined #crystal-lang
alexherbo276 has quit [Ping timeout: 240 seconds]
alexherbo276 has joined #crystal-lang
alexherbo276 has quit [Ping timeout: 276 seconds]
<FromGitter> <bajro17> am I only one for who this site dont work
<FromGitter> <bajro17> https://crystaljobs.org/
<FromGitter> <tenebrousedge> It's been broken for a long time
<hightower3> I looked at it about 10 days ago, also didn't work
<FromGitter> <bajro17> @vladfaust are you here :)
<FromGitter> <igor-alexandrov> Hi guys, just wanted to pay your attention once again to Shrine.cr: https://github.com/jetrockets/shrine.cr. For the previous month I stabilized API, added documentation and more specs. Plan is to finish `Shrine::UploadedFile` API till the end of November and start working on a ORM integrations in December.
<hightower3> oo, cool bit
chachasmooth_ has joined #crystal-lang
chachasmooth has quit [Ping timeout: 276 seconds]
bazaar has quit [Quit: leaving]
bazaar has joined #crystal-lang