MC's Journal

Go and xmpp-client

The last two weeks I've been programming mostly in Go. The language, I think, feels a lot like Python would if it had been re-designed by an old C programmer. I got productive rather quickly and it feels very much at home. I'll probably write something about my experience later.

I've been mostly happy with emacs-jabber as my XMPP chat client for the last few years but as more and more of my contacts move to mandatory use of OTR encryption it leaves something to be desired. There's Magnus' jabber-otr which uses a pure-Python OTR implementation under the hood, but it's rather fragile and very much a work in progress.

Linus Nordberg pointed me to Adam "agl" Langley's xmpp-client a couple of months ago. It's a minimalist command line XMPP chat client written in Go with excellent OTR support. I started using it, but missed emacs-jabber a bit.

When I started learning Go two weeks ago I had an idea that I would do an Emacs frontend to xmpp-client and get back some of the emacs-jabber goodness. My idea was that, if the current user interface in xmpp-client was isolated from the functionality, I could write my own user interface code, specifically meant to be easy to parse from Emacs Lisp.

I delved into the code, but found that the terminal user interface is sprinkled all over xmpp-client together with the code that defines its function as a chat client. This means that if I go this way I would either have to reproduce a lot of the chat client functionality in my code or, probably better, do a lot of work to isolate the UI code.

While I was in the xmpp-client code I decided to at least make it nicer for me to use. I added a few commands and a new configuration item. My changes so far:

Code here:

https://github.com/mchackorg/xmpp-client

All features merged in master branch. Each future is on a similarly named topic branch. InitialAwayIsOnline is on the "who" branch.