Newton and Cinch – One awesome framework
A lot of time (3 months, actually) has passed since I’ve last blogged about Ruby and available IRC frameworks for writing bots. Back then I planned to fork Isaac or Cinch, in order to add proper abstraction and object-orientation to them. Well, I did fork Isaac, realized that it was, in all honesty, quite a mess and instead wrote my own framework, mostly from scratch. I did, however, call it “Newton”, completly ignoring the fact that Isaac was named after Isaac Hayes and not Isaac Newton. I still thought it was a suiting name for what was supposed to be a fork.
Well, in my obviously biased opinion, Newton is the finest Ruby framework for writing IRC bots. It has it all:
- a nice DSL
- proper debug output
- support for all relevant parts of the various IRC RFCs, including support for ISUPPORT
- support for plugins (in a separate branch)
There is, however, one thing that Newton is missing: Users. Shockingly enough (*cough*), good code (remember? biased opinion…) and features alone won’t attract a lot of users. Good advertisment does, though, and since you probably have never heard of Newton before, in all those months, there doesn’t seem to be any good advertisment to be going on.
This is where Cinch is coming into play. Cinch has remarkably many users, even though I think that not even its developer knows how that’s possible. Anyway, influenced by Newton (and a funserious rivalry between Cinch and Newton), the developer of Cinch decided to adapt “some” of my ideas, including more abstraction, tracking changes in state (joining/leaving users etc.) and developing a plugin system (admittedly, he did it first, Newton stole that idea). Threading was also on his to-do list.
And what’s the second most obvious thing to do, if two projects share the same ideals and both desire attributes of the other project? Right, consider merging the two projects (the most obvious thing is starting a huge flame war, of course).
And this is why there won’t be any new Newton releases. Instead, most of the current codebase of Cinch will be replaced by Newton, while some features of Cinch (its pattern matcher, mostly) will be backported to Newton. Yes, this will mean that all existing Cinch bots will not be compatible to the upcoming version, but on the other side, new and updated bots will be able to profit from a lot of new awesome features, which will be documented in a later post, and of course an official README. The current work on the merge can be seen in the merge branch, which will become the master branch in a few weeks.
Lastly, for real facts on why the merge is good for Cinch and Newton:
|Good for Cinch, because…||Good for Newton, because…|
|Awesome new features (threading, OO, plugins)||A new name, known by a lot of people|
|Two developers instead of one||Reworked documentation, which will be friendlier to newbies|
|Two developers instead of one|
That’s it for this article, stay tuned…