BAF's Ramblings » #bafirc

BAFIRC: The IRC Layer

October 3, 2010bafirc

The first piece of BAFIRC is going to be the IRC communication layer. This layer will be totally standalone, making it easy to write first and test. There are several standalone pieces, but moving beyond that, everything will build on what has come before it.

I have thrown together IRC connection layers many times, using several languages. I could pull in one I’ve written before, but I’m starting from a totally clean slate and attempting to take advantage of the latest language features.

The IRC layer is fairly simple. The basic layer will support basic RFC IRC, including message parsing, message sending, message queuing (including a throttling layer to prevent you from flooding out the server and getting killed), all RFC defined commands and responses, and likely CTCP support. I am still undecided as to whether or not to include CTCP support in the base layer, as it is sort of an addon. DCC support will be separate, so I may make CTCP separate as well. I will provide hooks for these “addon” layers to plug in to, just to keep everything clean and modular.

I think I’m going to adopt an architecture similar to cbots as far as processing messages goes. I’m planning on having a single background thread that will manage both waiting to receive messages and sending messages (timer-based, to support message queuing). Once a complete IRC message is received incoming, it will be parsed down into an object and sent off to event handlers. Events will be fired for everything, giving a place for the core (or plugins, or any other non-BAFIRC uses) to plug in to and control anything.

That’s about all that comes to mind right now. The layer needs to be standalone enough that I can write a simple test program to get it on IRC. Once that is complete, I can begin working on other parts of the client, including the core server, web-chat support, logging system, etc.

Introducing: BAFIRC

October 2, 2010bafirc

Man, I’m doing it again - putting off my school work. That’s alright, because I’m just going to do a braindump, and then start on the work I need to get done (unless other distractions present themselves, like fixing and eating dinner).

Anyhow, I was just talking with Sevalecan, and we got into an interesting discussion. Both of us, for many years, have always talked about creating our own IRC clients. Both of us, however, never manage to actually finish them. I guess the fact that it’s sort of a dreamy personal project takes its toll. My personal experience (and, I would bet the same thing that happens to Sevalecan) is that I end up wanting everything to be perfect. Analysis paralysis, as it’s called. You code one portion of the project (or, worse yet, don’t even finish coding it before scrapping it), and find some flaw in it and decide to rewrite it. This happens over and over again, and, as its name implies, it paralyzes you.

I have a pretty lengthy feature list for BAFIRC, and I really would like to have it finished. I’ve sort of lost interest in the project, which may actually be a blessing in disguise, insofar as I won’t be concerned with it being 100% perfect. But at the end of the day, I really would like the project to be complete.

I was inspired by the movie The Social Network and was intrigued to see Zuckerberg blogging his progress of creating facesmash (this may or may not be true, the movie is highly dramatized). At any rate, I’ve seen other people doing the same thing on their projects, and it finally seems like both an interesting and useful idea to me. So I’m going to give it a try.

Whew. Now that we’ve got that out of the way, let’s lay the groundwork for BAFIRC. I have a list of features in mind that would create a pretty awesome IRC client that totally owns anything out there today. I’m going to attempt to list all the features here, though I am sure I will miss some. BAFIRC will be coded in C#, likely with .NET 4.0. I will likely use either Forms or WPF for this, I haven’t decided which yet, but I’m leaning towards WPF if only for the learning experience.

more