So instead of listening to Brian Valentine's keynote again, I started writing my protocol. Using POE and perl, I actually got pretty far. I've actually got the server listening, and the state machine is complete. The hard part is really making the server robust, as it is intended to expose bugs in my C# code. The previously mentioned Params::Validate should be helpful.
It's been nine months since I actually coded perl "for a living," and while today was hardly worth any money to anyone, the experience was both scary and refreshing. Due to the aforementioned network problems at work, it was just easier to switch to linux and get the code written. As usual, screen was employed, and mono was built in the background while I wrote the server and associated libraries. The hard part was the specifics. What were the flags to the constructors I wanted? How do I abstract my protocol into a cohesive lexer and subsequently into a lexer object? How do the data structures look? Perhaps the hardest part has actually been not writing the client in perl. Where the server is probably 500 lines (without contracts or documentation), the client would be less than fifty. But I know if I write the client, I won't actually get the C# client written, which was the whole point of the exercise to begin with.
I called it "Moscow," after an item in the book I'm reading. I had some pseudo-code for a client I had wanted to write six or seven months ago, and even some "real" code. Moscow gives me enough to be enthusiastic about that, I may finish it. The client I wrote back then was really more an exercise in dynamically pluggable code (C# doesn't have any real notion of code references, closures (well, sort of, but iterators don't count in my book), or the kind of interpreted code that allows perl to do it), and as such wouldn't impinge on my writing the C# client for Moscow.
Given Moscow's inherent extensibility, and the low barrier to actually getting a working client (fewer than ten lines to be fully functional, in perl), it seems a reasonable candidate for release. I'd just like to have a client before I publish. I don't suppose I could publish a C# client with a perl server, say Net::Moscow, and get away with it. This means I write two clients, one of which has a much steeper learning curve. Mono seems to have mostly built, so I may get that done tomorrow. The source itself is a lot easier to read than what MSDN offers as documentation, and the ability to offer "apropos System.Net" support is terrific.
Hadn't ever written a protocol before with the built-in requirement of extensibility. That in itself was refreshingly different. I'm really looking forward to adding in database access layers, an irc layer (client and server), and a syslog layer. Think about it. Sometimes it's hard to get your application to be able to speak syslog. If instead, you could speak a simplified dialect which would get you transactional, asynchronous access to both a database and syslog, wouldn't that be a huge win?