Huge life changes ahead.

In October, I will be moving to California to work for a hugely awesome lisp company there.

Exciting and excellent times ahead, I’m sure!

clucumber-baby-steps.PNG

I’ve been toying around with making a Common Lisp adapter to Cucumber, a behavior-driven development tool. I think this will really be very sweet.

Here’s how the step definition file would look like (these are really just stubs; in reality, you’d put in the lisp code you want to happen for the given textual description):

(Given* #?"^I start clucumber in (.*)$" (path)
  (assert path))

(When* #?"^I define some-other-package as the test package$" ()
  (pending))

(Then* #?"^the current package should be \"([^\"]+)\"$" (package-name)
  (pending (format nil "package is ~A" package-name)))

Vienna informal Lisp meeting 2010-02-27

Date: Saturday, 2010-02-27
Time: 12:30 Venue: In and around the Metalab, Rathausstrasse 6, Vienna (map)

I’m pleased to announce the first international totally informal lisp meeting in Vienna. A bunch of Lisp hackers are coming to here on the 27th, and we will meet, talk and hack in and around the Metalab.

The approximate schedule is as follows:

12:30 - Lunch at Fromme Helene. There is a table reserved for 15 persons (we’re 5 confirmed hackers at the moment). If you want in, drop me a line.
~14:30 - Reconvene at the Metalab for hacking/coffee/cold drinks/(optional) lightning talks

Hackers who have confirmed they’ll be there, so far:

  • Tobias C. Rittweiler
  • Luke Gorrie
  • Stelian Ionescu
  • Attila Lendvai
  • Gábor Melis
  • Mark Evenson

Thanks to the SBCL team for infusing this event with positive energy. SBCL: Harming the software industry since 1999.

cl-beanstalk: A queue service client

Over the weekend, I wrote a little client library to a queue server that I’ve grown very fond of over the last year, beanstalk. It’s a very simple queue server, but it comes with a nice feature (delayed jobs) that I’ve had a use for recently.

The queue server is nicely engineered (written in C, works with queues a few million jobs deep), and very fast; it has guards in the protocol against worker failure, and it was a pleasure to implement: The whole thing is just 320 lines of code, including comments.

You can get the source (and a tiny example) at the cl-beanstalk github repository.

Hope this is useful for anyone else - I am planning on using this in autobench myself, to distribute work across several build hosts.

Hunchentoot gets a debugging-acceptor

Today, I submitted a patch (the first free software lisp one in months for me!) to the Hunchentoot project, and it got accepted. Yay!

Some backstory: Hunchentoot’s 1.0.0 release dropped a lot of implementation-dependent features, among them functionality to invoke the debugger if an error happens while handling a request. While workarounds exist, none of them were obvious to new users or users who recently upgraded.

The patch I sent should fix this, hopefully. It adds a rudimentary error handling protocol to Hunchentoot, and provides two generic functions whose behavior can be adapted to your error handling needs. You can see for yourself in Hunchentoot’s svn repository.

If you’re a Hunchentoot user, I urge you to test this (in both development mode using debuggable-acceptor and running with the default settings). The sooner you find bugs, the sooner they can be fixed, the sooner a release can be pushed out. And if you don’t find bugs at all, that’s cool, too (-:

Caching and naming things.

Well, maybe not caching. But if two people are getting married in Austria, they do have to solve the other hard problem.

Clojure and Art of Illusion: BFF

Two weeks ago, the rotary program dial on my dishwasher broke. Luckily, I could fix it with two Lego parts (a Cross Axle #6 and a 16-teeth gear) initially, but the program selection experience suffered from the axle’s being too thin: it’d always bend in the turning direction until the selector would too-rapidly rotate past the point I wanted to select. Ugh.

Luckily for me, there’s a reprap at the Metalab. This is a low-cost 3d printer that can extrude parts made of ABS (the same material that Lego pieces are made of). With the help of Philipp’s MetaCADEvaluator plugin to Art of Illusion (AoI), I managed to create a very nice 3d model of a replacement for the dial. That plugin let me define parameters for each part, so I could easily resize all parts manually once I discovered that I’d mistakenly noted down each part’s diameter instead of the radius. However, this was slightly fiddly business: All editing happens inside Art of Illusion’s part name text fields, the syntax is slightly odd, and you can’t define your own part library.

Enter my urge to try out Clojure. This little side project took three steps:

  1. Find out how to embed clojure in AoI (done).
  2. Make it open a swank port so I can on AoI from emacs without having to recompile all the time (done).
  3. Build a part definition DSL (ongoing, one milestone achieved).

There’s a detailed description of these steps after the jump. Here’s the github project for my AoI clojure plugin.

perfectstorm screenshot

This isn’t original work, so perhaps more suited to being in my soup than this blog, but it’s so cool it just has to be on Planet Lisp. perfectstorm is:

a real time strategy game study written in Common Lisp using OpenGL for graphics display and cairo for texture generation.

Looks very very interesting. Google SoC students take note: this is an open source project (-:

(found via neingeist)

A public service announcement

It has been brought to our attention that asdf-install is still thought to be the preferred way to install cool lisp software. I would like to use this space to advertise an alternative tool that too few people know about, and that allows you to almost instantly (OK, as fast as your computer can install the required software and download & build the packages) get you up and running with and get you updates of the newest in cool lisp packages.

That tool is clbuild.

It doesn’t yet bring in all of the software available on cliki, but it includes enough cool things that I would recommend it to anyone who wants to check out with a minimum of hassle either of (not an exhaustive list, but you get the idea):

  • McCLIM,
  • Climacs, Closure, Beirc, Gsharp,
  • Hunchentoot, and
  • CXML

Or just get a lisp system up and running that includes most of the useful libraries out there. If you have been messing around with asdf-install (raise hands if you ever asdf-installed a library to get its dependencies and then pulled that library from CVS again and replaced the symlinks manually), do yourself a favour and check it out.

Recently, I got a used Mac Mini from a friend; I decided to put it to good use as a media station in my living room, and it does indeed work pretty well (after fixing it up with codecs that are in use in the real world, but that’s not the topic of this article (-:).

One thing that I find very useful is the ability to import movie files (that one might download from the vast and unfriendly-to-copyright-holders internet, as described here for instance) into iTunes on my desktop mac and have the Front Row thing on the living room machine play them over the network. The steps one needs to take in order to get this working are many and tedious, and so I’ve created an AppleScript to do all the hard work for me. It:

  • Converts an .avi movie (they usually come encoded as DivX or Xvid) into a standalone .mov file using Quicktime Player (this doesn’t transcode),
  • extracts the Show name, Season, Episode number, Episode name from the file name via a friend’s service called “renamr” (a telnet 2.0 service, he calls it),
  • imports the file into iTunes, tags it nicely, and
  • cleans up after itself.

The files thus imported will pop up in the nicely remote-controllable interface, marked as “unwatched,” and wait for me to finally get some spare time to sit down and watch them. (Which might very well be after the WGA strike ends, so it all should work out nicely in the end.)

If you find yourself wishing for a similar solution, download this file, read the comments in the beginning, skip over the MIT-style licence, and read the code until you are convinced I’m not doing anything stupid or malicious. Then, have fun using it!

I didn’t really like the DWIM interface for type translations on the client, so I made the type information mandatory. (-:

This means that instead of:

* (xrpc:call "http://localhost:8080/RPC2" "addNumbers" '(1 2 3.0)) ; WRONG

You get to do this:

* (xrpc:call "http://localhost:8080/RPC2" "addNumbers" '(:integer 1
                                                         :double 2
                                                         :double 3.0))
6.0

This doesn’t look vastly superior, but consider this case:

* (xrpc:call "http://localhost:8080/RPC2" "weekDay" `(:time ,(get-universal-time)))
0

Where before, you had to construct an xml-rpc-date structure; ew. This also allows nicer handling of (unsigned-byte 8) vectors (you can base64-encode them now), and you don’t have to construct yucky xml-rpc-struct objects anymore: just use alists. The decoding functions now return the type tag that they saw in the response or request.

Speaking of requests, the server is now finished, lifting CXML-RPC to more or less the same level as s-xml-rpc. It implements the introspection functions specified in xmlrpc-c’s documentation, and the faults_interop spec. You can define methods for different handlers, which means that you can attach more than one handler to different URLs and they can expose different sets of methods to the world. This might be handy for those running virtual hosts.

In response to yesterday’s post, Rafal Strzalinski pointed me at Ivan Boldyrev’s s-xml-rpc-hunchentoot, which adapts the s-xml-rpc server functions for use with hunchentoot’s handlers. There’s no port to DRAKMA for the client part.

I think you should give CXML-RPC a try if you either want to expose multiple sets of methods on different handlers, or you don’t want to install aserve just for an xml-rpc client. (-:

A few weeks ago, I tried using S-XML-RPC for use with a hunchentoot-based web interface to rtorrent. Unfortunately, it comes with a long list of dependencies that are already implemented better by Ediware such as drakma: it can speak HTTPS, connect via proxies, and allows cookies (although I’m not aware of any xml-rpc implementation that supports this (-:).

So I re-implemented s-xml-rpc’s client part to use the libraries that are already available in clbuild, and got a pretty pleasant-to-use library. To simply invoke an xml-rpc method, use:

* (xrpc:call "http://betty.userland.com/RPC2" "examples.getStateName" '(:integer 41))
"South Dakota"

* (xrpc:call "http://time.xmlrpc.com/RPC2" "currentTime.getCurrentTime" ())
#<CXML-RPC::XML-RPC-DATE 20071202T06:56:43>

It’s entirely undocumented right now, and some names (and interfaces) may be subject to change, but I’m making it available now anyway, at my git repository.

The plans for the near future (e.g. next weekend) include a server part based on Hunchentoot, and, um, test cases and documentation. Stay tuned!

Blagging about blagging

I just upgraded this blog to MovableType 4, for which this is a test entry. While I’m at it, I might as well say things about where I’ve been gone in the last couple of months. First, I spent a lovely week in Cambridge, MA, consulting for ITA software. (Photographic evidence here.)

Now I’m hacking on a sweet new project again (news about that in due time, I promise). In the meantime, I started a new (lighter on the technical content, heavier on the pop cultural stuff) tumblelog at http://mublag.boinkor.net/. This one’s powered by Soup, a new blogging platform that two friends of mine are just launching.

Right. More technical content will happen in a few days. Until then, don’t look at the Unicorn baby link.

ASDF(reference manual) is a fine piece of software: I like to use it, and find some of the design choices in it to be very good (besides, it’s the thing that has allowed things like clbuild and asdf-install to grow). However, it is now in wide enough use that people are looking at its internals and are scratching their heads when finding some not-so-very-good design choices.

Here’s a selection of the things that I think would be good candidates for review in a new version of ASDF (bsdf? yasdf? qwer? /.,m?):

Ok, so this was lame.

I just attended my first CACert assurance party thing. It started off with a 2-hour talk that gave information that could be easily extracted (with a bit of patience for bad english grammar and spelling) from their wiki. Two things that stuck out to me (like, indeed, sore thumbs):

  • PGP key signatures are useless, because a signature on a key doesn’t tell you anything about the standards that were used to get the key owner’s identity to the signing party.
  • CACert are trying to get a WebTrust-compatible audit. From what I heard at the talk, instead of being audited for the first time, they worked with the auditors to get into auditable shape (with the same auditor) next year. That sounded kinda familiar to me…

Anyway, after the talk ended (which was cut short at 2:00h by a person who graciously stepped in as a moderator), the assurance thing itself was kind of anticlimactic: There were ~20 people present; everyone was told to get 10 forms, fill them out, and get assured by (and assure themselves) three people who are Assurers, then repeat the process with seven others. Nobody knew who of the attendees were assurers. I don’t think the guy who held the talk understood what I was trying to get at when I suggested that this was kinda suboptimal. Frustrated at the lack of a response when I asked him if he himself was an assurer, I left.

I feel like I just wasted (and not in a good way) two hours. I applaud cacert.org’s server and client certification services (and I’ll continue to use them), but I’ll gladly forfeit the 100 assurance points that state my ability to sit through 2 hours of boredom and to defy bad organization at an assurance meeting. Give me a useless (but non-boring) PGP key-signing party in a cafe or a pub any day.