ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.0 | 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
sagax has quit [Remote host closed the connection]
sagax has joined #crystal-lang
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
laaron has quit [Remote host closed the connection]
<FromGitter> <anicholson> Urgh, the official Arch packages for Crystal are completely borked: https://bugs.archlinux.org/task/63438 :(
<FromGitter> <dscottboggs_gitlab> oh shit I hope that gets fixed before it works its way into manjaro
<FromGitter> <dscottboggs_gitlab> building locally from master seems to be fine
laaron has joined #crystal-lang
<FromGitter> <voximity> @anicholson Pass --threads=1 when you compile, works as a temporary workaround
<FromGitter> <voximity> I think I read in an issue that asterite fixed it for 0.30.1
<FromGitter> <dscottboggs_gitlab> building locally @0.30.0 also seems to work strangely enough
<FromGitter> <sam0x17> any advice on this one? https://github.com/crystal-lang/crystal/issues/8072
<FromGitter> <tenebrousedge> are you sure that's because of your monkey patch?
<FromGitter> <sam0x17> well without monkey-patch you get this: https://github.com/taylorfinnell/awscr-s3/issues/55
<FromGitter> <tenebrousedge> the error just doesn't seem to have anything to do with the monkeypatch
<FromGitter> <tenebrousedge> I would assume that the patch is correct and that there's some other problem elsewhere
<FromGitter> <sam0x17> ah ok, I thought it was related because it's an abstract def and the abstract def checker is what is complaining
<FromGitter> <tenebrousedge> hmmm.
<FromGitter> <tenebrousedge> and your class there implements `Comparable` ?
<FromGitter> <tenebrousedge> spose it must
<FromGitter> <tenebrousedge> is `Nil` getting passed to that at some point?
<FromGitter> <sam0x17> yeah what's interesting is I can't find where in `awscr-s3` the `Awscr::Signer::Header` class is defined. It's mentioned in a few places, but defined nowhere from what I can find searching on github
<FromGitter> <sam0x17> it could be, not my shard
<FromGitter> <sam0x17> I just need it to work xD
<FromGitter> <tenebrousedge> the signer is from here (https://github.com/taylorfinnell/awscr-signer/)
<FromGitter> <sam0x17> aww that makes sense lol
<FromGitter> <sam0x17> looks like they actually have 0.30.0 fixes on that shard, so maybe the root shard just hasn't included those yet
<FromGitter> <tenebrousedge> it should though
<FromGitter> <tenebrousedge> nope
<FromGitter> <tenebrousedge> version pin is too low
<FromGitter> <tenebrousedge> try cloning the repo, bumping the dependency to `0.6.0`
<FromGitter> <tenebrousedge> (and then point your project at your new clone)
<FromGitter> <sam0x17> it worked!!! thanks
<FromGitter> <tenebrousedge> np. Maybe submit a PR with the bumped version?
ht_ has joined #crystal-lang
devil_tux has joined #crystal-lang
ht_ has quit [Quit: ht_]
devil_tux has quit [Ping timeout: 276 seconds]
devil_tux has joined #crystal-lang
<FromGitter> <sam0x17> yeah I think I will
<FromGitter> <sam0x17> @RX14 any reason you archived parallel.cr? I'm looking for something like that
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<Stephie> @sam0x17 it never worked
<Stephie> it was never a good solution to the problem
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
_whitelogger has joined #crystal-lang
sorcus has quit [Quit: WeeChat 2.5]
Yxhuvud has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
_whitelogger has joined #crystal-lang
<jokke> hey
<jokke> does Process.new de-own the process?
<jokke> hm not sure how the exact terminology ist
<jokke> -t
<jokke> basically i need to spawn a process which will keep running after my crystal program exits
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<FromGitter> <naqvis> you can use `nohup` and append `&` in your command to execute the process. This will ensure process keep running in the backend, even if `tty` session is closed
<FromGitter> <naqvis> I assume you are asking about `daemon` processes, which keep running even if you have terminated the `tty` session
alex`` has joined #crystal-lang
lucasb has joined #crystal-lang
<FromGitter> <j8r> @naqvis I think jokke was asking about a Crystal solution
<FromGitter> <j8r> jokke you can try `fork` and then `Process.exec`
<FromGitter> <j8r> it seems possible to then kill the parent and let the child alive
<jokke> mhm ok
devil_tux has joined #crystal-lang
laaron has quit [Remote host closed the connection]
devil_tux has quit [Ping timeout: 268 seconds]
laaron has joined #crystal-lang
sagax has quit [Remote host closed the connection]
devil_tux has joined #crystal-lang
duane has joined #crystal-lang
sorcus has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ht_ has joined #crystal-lang
<robacarp> sorcus: what fails?
<robacarp> I'm having a hard time even understanding what this code is supposed to do
<FromGitter> <tenebrousedge> tabs >_<
<robacarp> yeah that
<sorcus> robacarp: https://sorcus.name/screenshot-2019-08-12_15-40-15.png - this is what i get.
<sorcus> robacarp: https://sorcus.name/screenshot-2019-08-12_15-41-15.png - this is what i want.
<robacarp> okay, but ... this feels like an exercise in complexity. Perhaps you're after something that might not require tihs complexity?
<robacarp> it seems like the extra fiber is causing the receive loop to run slow enough that the top sending fiber runs longer?
<sorcus> robacarp: I don't know. :-(
<FromGitter> <j8r> is there any plan to have let/const/final variables?
<FromGitter> <naqvis> Is it possible to auto-invoke some kind of registration process for sub-types, without manually invoking them somewhere from the code? Just an example, developing some kind of extension classes, where each class can take care of one or few types to work on, after class is defined, it should auto-register with type of extension it can handle. So that top handler can invoke the extensions based on their
<FromGitter> ... capabilities. ⏎ Maybe prototype code below might try to clarify my question ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d518e5b2612bb718c558fcc]
<FromGitter> <Blacksmoke16> Just define an initializer on the parent?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <naqvis> yeah. I’m just trying to think if that is possible without me registring the individual handlers somewhere else from the code? My use case is main network handler, which receives different types of messages, so that main handler can invoke respective handlers for type of messages received.
<FromGitter> <naqvis> kind of pub/sub but only registered handlers with respective type will be invoked, instead of broadcasting to all
<FromGitter> <Blacksmoke16> and the expected result for `@@handles` would be like
<FromGitter> <Blacksmoke16> ```{ ⏎ "bar" => Bar, ⏎ "baz" => Bar, ⏎ }``` [https://gitter.im/crystal-lang/crystal?at=5d51943bbeba830fff7df80c]
<FromGitter> <Blacksmoke16> ?
<FromGitter> <naqvis> yeah
<FromGitter> <Blacksmoke16> sec
<FromGitter> <naqvis> sure and thank you @Blacksmoke16
devil_tux has quit [Ping timeout: 248 seconds]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7e0s something like that would prob do it
<FromGitter> <Blacksmoke16> might be better to have another class that is responsible for "managing" the diff handlers
<FromGitter> <Blacksmoke16> vs lumping that in with the abstract?
<FromGitter> <naqvis> Thank you so much @Blacksmoke16 , yeah agree, will have separate class for managing the handlers. I was just thinking if this could be doable and you helped me with that. Thanks again. 👏
<FromGitter> <Blacksmoke16> np
<robacarp> at least I think that's what you're talking about
devil_tux has joined #crystal-lang
<FromGitter> <naqvis> Thank you robacarp, much appreciated
<FromGitter> <Blacksmoke16> i do it in Athena as well https://github.com/Blacksmoke16/athena/blob/master/src/cli/registry.cr#L4-L7, is what i referenced
<FromGitter> <Blacksmoke16> is nice since it happens at compile time
<FromGitter> <Blacksmoke16> so as far as your program is concerned, the hash should always be accurate
<robacarp> yep
<FromGitter> <Blacksmoke16> @naqvis is each handler a concrete class, or just like another instance of same base `Handler` class?
<FromGitter> <naqvis> that would be concrete class
<FromGitter> <naqvis> I’m thinking of separating concerns, each class only taking care of its own specific functionality
<FromGitter> <naqvis> I’m just toying around XMPP protocol, so thinking of having separate handlers for different Stanzas types
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <naqvis> idea is to have Node handler for different XML nodes and just invoke the respective handler to deal with specific format
<FromGitter> <naqvis> Thanks @Blacksmoke16 and robacarp for help and references. That really helped.
<FromGitter> <naqvis> sorry don’t know how to `at` user from IRC 😆
<FromGitter> <Blacksmoke16> np
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<robacarp> just mentioning the name works :) no @ required
<FromGitter> <Blacksmoke16> oh really? thats how it doe sit?
<robacarp> there's nothing special about IRC... just a telnet connection and a fancy ui
<FromGitter> <Blacksmoke16> fair enough, i didnt actually know it alerted you when you're name was mentioned tho
<robacarp> irc clients have a list of highlights, of which the username is a member. any chat line which matches on a highlight is subtly emphasized at some client/user defined level
<robacarp> for me, it just changes the color of the username that posted the comment (in this channel, almost every user is FromGitter)
<FromGitter> <naqvis> yeah, but there are still few who are on IRC
<robacarp> the only drawback is that code pastes don't represent well from gitter. you get a link which is just to the chat room at a certain line.
<FromGitter> <naqvis> but still good, if you are on console. as don’t have to switch to XWin
<FromGitter> <Blacksmoke16> neat
<robacarp> I'm of the opinion that gitter is dieing anyway...
<FromGitter> <naqvis> so we still have another major player `slack` 😆
<rkeene> The #Tcl IRC channel is bridged with Jabber and Slack
<FromGitter> <Blacksmoke16> *discord*
<rkeene> I'm not a fan of discord
<FromGitter> <bararchy> Discord isn't fun :/ (much better then hitter though)
<FromGitter> <greenbigfrog> is there a (unofficial) crystal one by now?
<FromGitter> <Blacksmoke16> discord server? yes
<rkeene> "server"
<FromGitter> <greenbigfrog> gimme invite
<FromGitter> <bararchy> TBH even RFC 1149 is better then gitter :(
<FromGitter> <Blacksmoke16> https://discord.gg/Vbses4
<FromGitter> <naqvis> discord looks *coool*
<robacarp> discord is neat, thanks for the invite link.
<robacarp> however, I don't think I'll have it open much...
<FromGitter> <andrius> @naqvis I had exactly the same need with handlers
<FromGitter> <andrius> DId it within main abstract class, but after evaluatin and testing of code thinking to refactor and detach
<FromGitter> <naqvis> yeah true, I also prefer separating concerns and loose coupling
<FromGitter> <Blacksmoke16> could also do something similar to https://dev.to/blacksmoke16/dependency-injection-in-crystal-2d66#manager
<FromGitter> <Blacksmoke16> but instead of DI, use the `subclasses` macro to build out the hash of the manager
<FromGitter> <naqvis> yeah very neat approach and excellent article. After reading your articles on `annotations` and `DI`, i had thought of writing some `annotations` for XML-mapping, but couldn’t get my thoughts consolidated and also got engaged with other stuff
<FromGitter> <naqvis> maybe someday I’ll try to some kind of XML-Binding interface to be used in Crystal, as atm there is none like they have for `json` and `yaml`
<FromGitter> <Blacksmoke16> would be more ideal to have a singular annotation like `SerializationContext` that could be used for any format
<FromGitter> <Blacksmoke16> but each format would read diff properties off of it
<FromGitter> <Blacksmoke16> er could read format specific things, or use common keys
<FromGitter> <naqvis> yeah agree and I really miss Golang tags
<FromGitter> <naqvis> unfortunately there is no RTTI yet available in Crystal, so would be difficult to write some code which could do the magic at run time
<FromGitter> <Blacksmoke16> was the first iteration i did for `oq`
<FromGitter> <Blacksmoke16> `from_xml` would be much harder
<FromGitter> <Blacksmoke16> imo
<FromGitter> <naqvis> true, i wrote little script in crystal to auto-generate crystal classes when feeded Golang like tags for XML 😆
<FromGitter> <naqvis> which generates complete class along with to/from_xml methods, based on those tags info
<FromGitter> <Blacksmoke16> was talk of moving the serialization stuff out of the stdlib
<FromGitter> <Blacksmoke16> see if it ever happens
<FromGitter> <naqvis> wow great, but they will still have to provide some interfaces for others to implement
<FromGitter> <naqvis> like Java does, they have whole lot of interfaces and specifications, leaving the implementation details to 3rd party (though Java always comes with standard implementation for reference)
<FromGitter> <Blacksmoke16> would be nice to have indeed :p
<FromGitter> <naqvis> 😆
<FromGitter> <naqvis> Crystal is awsome and coding in crystal is fun 👏
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<robacarp> the java model is difficult though, because the implementation is informed by the interface. the big benefit of using a 3rd party serializer could very well be that it performs in a way that is completely unexpected by the person writing the interface
<robacarp> for example, the crystal-db shard is essentially a standardized interface, but relying on it means you suffer under the least-common-denominator for the database APIs it references
<FromGitter> <absolutejam_gitlab> Does the Crystal Discord get much use?
<FromGitter> <Blacksmoke16> are a few people on it
<FromGitter> <absolutejam_gitlab> I think I'm a member; I guess I could just check
<FromGitter> <Blacksmoke16> @bcardiff llvm isnt required to use crystal if you're not building from source correct? If so could it be marked as a build only dep in https://github.com/Homebrew/homebrew-core/blob/a6e20f4570ee134e672fd77e4e4e1d08e59d3dc1/Formula/crystal.rb#L38 ?
<FromGitter> <absolutejam_gitlab> I'm not a big fan of the over-separation of things like Discord & Slack though
<FromGitter> <absolutejam_gitlab> too many channels
<FromGitter> <absolutejam_gitlab> It doesn't help conversation. I'd rather just have threaded conversations in a single channel
<FromGitter> <Blacksmoke16> otherwise even if you're getting the bottled version it still does the download
<FromGitter> <meltheadorable> that doesn’t scale to hundreds of people very well, if this room had more than 15-20 regular active participants you’d probably be happier to have multiple channels
<FromGitter> <absolutejam_gitlab> Yeah, definitely
<FromGitter> <absolutejam_gitlab> Be nice to have those problems
<FromGitter> <bcardiff> @Blacksmoke16 it is required. Some dependencies like compiler-rt are installed because of that dependency.
<FromGitter> <Blacksmoke16> 👍 gotcha, thanks!
<FromGitter> <absolutejam_gitlab> So, I'm defining a base class, and so far it has an `abstract def run`
<FromGitter> <absolutejam_gitlab> Say I want to add a pre-run and post-run which are optional, can I check to see if they are defined/
<FromGitter> <absolutejam_gitlab> I guess that's a Macro job?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Crystal/Macros/TypeNode.html#has_method?(name:StringLiteral%7CSymbolLiteral):BoolLiteral-instance-method maybe
<FromGitter> <Blacksmoke16> might be easier to just define two protected methods that are noop in parent
<FromGitter> <Blacksmoke16> but children can overload
<FromGitter> <absolutejam_gitlab> oh yeah
<FromGitter> <absolutejam_gitlab> that makes sense
<FromGitter> <Blacksmoke16> mhm
<FromGitter> <Blacksmoke16> another reason it would be nice to have protected methods (optionally) in the api docs...
<FromGitter> <Blacksmoke16> but meh
bcardiff has joined #crystal-lang
laaron- has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> I appreciate the ability to call method parameters with the name for clarity
<FromGitter> <Blacksmoke16> main benefit is you can call them out of order
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has left #crystal-lang [#crystal-lang]
<FromGitter> <absolutejam_gitlab> Is there a way I could make my `run` method always call `prerun` and `postrun`, even when overwritten?
<FromGitter> <absolutejam_gitlab> I mean, I thought I could define `_run` or something and then it's called by `.run`, but that seems shitty
laaron has quit [Ping timeout: 260 seconds]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
<FromGitter> <Blacksmoke16> well my assumption was your run method would be like
<FromGitter> <Blacksmoke16> nvm
<FromGitter> <Blacksmoke16> prob be better you define like an abstract `execute` or `do_work` or something
<FromGitter> <Blacksmoke16> then have the parent define run like
<FromGitter> <Blacksmoke16> ```def run ⏎ prerun ⏎ execute ⏎ postrun ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5d51c6ee7d56bc6080409787]
<FromGitter> <absolutejam_gitlab> yeah, that's what I was thinking.
<FromGitter> <absolutejam_gitlab> I guess if I make the names more obvious and document it, it's no worry
<FromGitter> <Blacksmoke16> the child is just defining the logic that gets ran, not how to actually run it
<FromGitter> <Blacksmoke16> which should be left up to the parent
devil_tux has quit [Ping timeout: 248 seconds]
bcardiff has joined #crystal-lang
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
bcardiff has quit [Client Quit]
ht_ has quit [Remote host closed the connection]
devil_tux has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> wish there was a single line `def` for initialize
<FromGitter> <absolutejam_gitlab> eg `def initialize(@foo : String, @bar : Int32)`
<FromGitter> <absolutejam_gitlab> or some kind of same-line end
<FromGitter> <dscottboggs_gitlab> yeah you can do that
<FromGitter> <dscottboggs_gitlab> `def initialize(@foo : String, @bar : Int32); end`
<FromGitter> <dscottboggs_gitlab> I use that a lot
<FromGitter> <absolutejam_gitlab> I think it worked without the semicolon
<FromGitter> <absolutejam_gitlab> just tried it
<FromGitter> <dscottboggs_gitlab> wtf
<FromGitter> <j8r> with `abstract` yes
duane has quit [Ping timeout: 272 seconds]
<FromGitter> <dscottboggs_gitlab> I really like how `String#succ` and `String#to_big_d` are right next to each other in alphabetical order
<FromGitter> <tenebrousedge> 👀
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 258 seconds]
Raimondi has joined #crystal-lang