thoj / go-ircevent

Event based IRC client library in Go (golang)
BSD 3-Clause "New" or "Revised" License
503 stars 108 forks source link

Look into standardizing around a library for IRC parsing #92

Open belak opened 7 years ago

belak commented 7 years ago

Right now, it seems like go has an issue with a "standard" (http://xkcd.com/927/) IRC library... it would be really nice if all the main frameworks started standardizing around something, whether that's the Line parsing in fluffle/goirc, the Message parsing from sorcix/irc, the Message parsing from belak/irc, or the Event parsing from this library...

I'd like to propose switching to one of them and translating messages to the ircevent.Events. I would be willing to do the work, if there could be some consensus as to which one we'd want to use.

Also, is there anywhere else that would be good to discuss this? Somewhere we could pull in all the people who work on these libraries?

If this isn't something you want to do, you're welcome to close this, I'm just not sure of a better place to put this.

belak commented 7 years ago

I have a PoC up here: https://github.com/thoj/go-ircevent/compare/master...belak:belak/irc-poc

Though, master seems to be failing tests, so this is as well.

thoj commented 7 years ago

I understand that parsing could be improved and refactored. It's pretty awful as it is now. But pulling in an external dependency for saving 15 lines of code brings to much complexity with way to little gain.

ghost commented 7 years ago

Yes, there's the matter of pulling in an external dependency. In this instance, I can understand that perhaps we (as an IRC-and-Golang programming community) could adopt a generic, standardized parser that is highly RFC(s)-compliant and "correct" with the edge cases and the like accounted for. The reason for this, is an attempt to: once we have wide adoption and popularity among the other IRC-related projects (including my own), have a good point in which to potentially manage to get IRC into stdlib. Giving Go a standard way to do IRC out-of-the-box, along with other widely used protocols like SMTP, HTTP and so forth. If not stdlib, then at least something we can all use and put trust into as a "correct" implementation of the various IRC protocol standards both from the perspective of a client AND server.

belak commented 7 years ago

I understand the reluctance to pull in an external dependency... And this doesn't have to happen now... I was simply hoping to plant the idea of standardizing around something since all the different implementations (my own included) seem to have some problems, and it would be nice have at least a common set of encoding/decoding messages which could be used by multiple projects, rather than seeing more bots or IRC servers which implemented their own form of message parsing, more broken than the last.

I'm not sure where the best place to put this would be? I'm pretty sure there would need to be a proposal put together for that to be considered by the go team if we wanted to get anywhere close to the stdlib.

It also seems like getting everyone to agree on a single IRC library outside the stdlib would be the simplest solution... replacing the parsing (at the base level) with something we can all agree on would be the first step towards making components more pluggable... things like tracking users, tracking channels, and more complicated things could be built around a single message type so we wouldn't have to duplicate work on those as well.