Asynchronicity

The asynchronous networking rework of Straw is progressing pretty nicely. I've already got the basics working: feeds are polled successfully and images are fetched. The only significant bit of code to be converted is the subscription tool / rssfinder.

It hasn't been totally easy. Converting an existing code base which depends on synchronous network operation to be asynchronous is a bit hairy in places. In fact, rssfinder is one beast which makes me consider leaving some synchronous networking in place, but we'll see about that.

Things aren't all peachy in the brand new asynchronous world, though; first of all fetching data over the network is, at the moment, noticeably slower than in 0.15. However, I suspect that tuning a few constants (timing and limits on open sockets) a bit might help here a lot. And Straw speaks HTTP 1.1, I could try using the same connections for multiple files, even though that would complicate the code a bit.

The second problem is that DNS lookups are still freezing the program. First thing to do, I guess, is to implement a name cache, so it'll be an one-time (per session) cost. But I suspect I'll have to do something about the lookup part itself. The options are, I guess, either using ADNS or forking a separate lookup process. I've been dependency-happy in the past, but I'll have to think what to do with this one; I have no idea how common ADNS is.

Oh, and a big THANK YOU to Fredrik Lundh for the series about building EffNews on his web site. I have no prior asynchronous networking programming experience, and his examples have been extremely helpful.

Article page

The Problem With XML

XML, despite still having immense momentum, is not without problems. These days it probably is the pragmatic solution for many jobs, thanks to the multitude of tools for various platforms for processing it. That doesn't mean it couldn't, and shouldn't, be better. Not surprisingly, people persist in discussing its faults and how it should be.

Erik Naggum, in his characteristic style, details his beef with XML with a very long article [via Python Owns Us] where he makes many good points about the evolution of data formats and gives his suggestions on what should be changed in the XML format to make it better. While I'm not totally convinced about the binary format bit, otherwise I do agree with his points.

However, I think Aaron Swartz put it best in one little sentence, even if he didn't suggest any improvements: "XML [...] encourages you to be conservative in what you accept and liberal in what you put out.", in direct contrast to the traditional — and sensible — ethos of protocol designers. That is the single thing that is most damning to XML. Thanks to Aaron for articulating it.

Article page

Back to Work

Christmas is over; read two books — Dead Air by Iain Banks, a decent book if not among his best, and Red Dog by Louis de Berniéres, a fun and fast read — did a couple of jigsaws with my gf, ate way too much, drank some very nice wines — like Masi Mezzanella and Bollinger Special Cuvée — and had a very good time in other respects, too.

Now it's back to work. It would probably have been a good idea to be on vacation for this week, too.

Article page

Base64

I have this base64 implementation (both decoding and encoding) in Common Lisp available on my web page. I have had some very nice feedback about it, but I've been a lazy maintainer; KMR sent me some patches for ACL compatibility many moons ago but I never got around to integrating them. Um. I think. Or maybe I did... Well, anyway, it took ages.

Now it turns out that a) Edi Weitz created a page for it in CLiki and b) KMR forked base64, now calling it cl-base64, giving it some undoubtedly much-needed optimizations (I never benchmarked my implementation and speed wasn't much of a concern when coding it) and adding some nice extra functionality.

Thanks, guys, both of you.

Article page

Zope sessions documentation

Zope has built-in sessions support, has had since 2.5.0. However, in the best Zope tradition, the documentation has been a bit spotty, and I was experiencing some major frustration because of this. Someone else on #zope was just asking about this too.

Not to worry: there is, this time, documentation. You just have to find it. The correct solution is the Zope Book, 2.6 Edition, under development. It's not easy to find; I found it via a mailing list archive where there was a link to it, and after that located the link at Zope.org.

So, the correct path is: Zope web site -> The Zope Book (2.5 Edition) -> Other versions of this book -> The Zope Book (2.6 Edition) -> Chapter 19: Sessions. Congrats, you are there.

Article page

CLCL rising

Teemu writes: I woke up the other day and said to myself: "There does not seem to be a cross-platform natively multithreading common lisp with sources available for me to play garbage collection games with, so why don't I write one?".

The working name is CLCL.

Article page