Mono
Most of my personal projects are built on top of ASP.NET, Mono and Lighttpd. One of the benefits of keeping them all running on the same stack (as opposed to mixing Python, Mono and PHP together) is that I don't need to maintain different infrastructure bits to keep them all up and running. Two key pieces that keep it easy to dive back into the the side-project whenever I have some (spurious) free time are my NAnt scripts and my push scripts.
NAnt
I use my NAnt script for a bit more than just building my web projects, more often than not I use it to build, deploy and test everything related to the site. My projects are typically laid out like:
- bin/ Built DLLs, not in Subversion
- configs/ Web.config files per-development machine
- libraries/ External libraries, such as Memcached.Client.dll, etc.
- schemas/ Files containing the SQL for rebuilding my database
- site/ Fully built web project, including Web.config and .aspx files
- sources/ Actual code, .aspx.cs and web folder (htdocs/ containing styles, javascript, etc)
Executing "nant run" will build the entire project and construct the full version of the web application in the site/ and finally fire up xsp2 on localhost for testing. The following NAnt file is what I've been carrying from project to project.
<?xml version="1.0"?> <project name="MyProject" default="library" basedir="."> <property name="debug" value="true" overwrite="false" /> <property name="project.name" value="MyProject"/>
I spoke with Tammy (our PR mastermind) about whether or not Slide was going to let me out of my cage to go to South by Southwest Interactive this coming March and it seems like they might actually let me! (I'm just as surprised as you are)
Unfortunately things with Facebook were at such a ridiculous pace when SXSWi was accepting panel submissions, that I never got a chance to submit my panel idea: "Slide is awesome, now let's talk about how great Slide is." This leaves me in a slightly awkward position, I cannot remember the last conference or event that I went to where I wasn't speaking or talking or dancing with a baboon in front of a live studio audience. Even at the last SXSWi I was there for about 36 hours and most of that time was spent setting up and then helping run BarCamp Austin2. Ideally I'd like to get on stage with some of the guys from Twitter, Facebook, Bebo, Google and maybe even Myspace to discuss the more open social web that we seem to be moving towards and a bit about how awesome Slide is. It's probably nothing more than a pipe-dream however, since the panels seem to be quite locked down at the moment.
Of course, if nobody will have me, then I might be relegated to slumming up and down 6th street in Austin hanging out with the usual drunkards that I know in Austin (you know who you are) and getting into trouble. Mmm, trouble.
Regardless, if you're going to be in Austin for SXSWi let me know, I've got a stack of swanky new business cards I want to get rid of :)
First a little background to help explain some of the terms, etc. "Python" is a language, similar to how "Java" is a language; unlike Java wherein the language is also relatively synonymous with the actual implementation of that language, Python has multiple implementations. If you've run python(1) from the command line, you're most likely running the CPython implementation of the Python language, in effect, Python implemented in C. Other implementations of Python exist, like Jython (implemented on top of the Java virtual machine), PyPy (Python implemented in Python), and IronPython (Python implemented on top of the .NET CLR).
I was talking with some of the guys from the #mono channel on GIMPNet about IronPython versus CPython as far as performance is concerned and I decided that I would refine my testing (using pybench) for more similar versions of the respective implementations, in as controlled of an environment as possible.
I ran pybench.py on a "quiet" (i.e. not-busy) machine sitting in a remote datacenter not too far from Novell, the machine is a Pentium III (i386) based machine running openSUSE 10.3. Since IronPython reports it's "implementation version" as Python 2.4.0, I decided to build and run CPython 2.4 against it. IronPython is running on top of the recently released Mono 1.2.6 which I also built from source (I got IronPython from the IPCE package in YaST however). pybench reported the various implementation details for both as such:
CPython
Implementation: 2.4.4
Executable: /home/tyler/basket/bin/python
Version: 2.4.4
Compiler: GCC 4.2.1 (SUSE Linux)
Bits: 32bit
Build: Dec 18 2007 23:00:48 (#1)
Unicode: UCS2
IronPython
Implementation: 2.4.0
Executable: /usr/lib/IPCE/ipy.exe
Version: 2.4.0
Compiler: .NET 2.0.50727.42
Bits: 32bit
Build: (#)
Unicode: UCS2
IronPython did alright, but it got pretty thrashed on a lot of the benchmarks. Unfortunately it's hard to tell whether it's Mono getting beaten up, or whether it's IronPython itself that's losing the battle here, running similar tests on the .NET 2.0 CLR would be beneficial but not something I am curious enough to boot a Windows virtual machine for. Regardless, here are the results, I've highlighed the rows where IronPython performs better than CPython.
I've spent the week tweaking and adjusting my lighttpd configuration to where it cooperates better with Mono's FastCGI server, and I finally feel confident enough with the configuration to share.
Around thursday morning or so (maybe it was wednesday) the site was spewing so many 500 errors that somebody who I'm not sure I know where I know them from, emailed me saying "dude, site's broke." After checking the error logs, I found a lot of errors that were all like this:
fcgi-server re-enabled: 0 /tmp/fastcgi-mono-server backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead: reconnects: 0 load: 130 fcgi-server re-enabled: 0 /tmp/fastcgi-mono-server backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead: reconnects: 0 load: 130
After diagnosing the problem and kicking the server again, I decided that a couple of tips on the wiki page for Mono's FastCGI & Lighttpd had done me in, the first being about the FastCGI handler's max-procs configuration variable:
Fortunately Urlenco.de doesn't really need any session information, so I did what Emeril and Apache admins are both familiar with doing, I kicked it up a notch (to about 10). After kicking the server one more time, this time with "max-procs" > 10 I watched the load on my little 1U server spike up to 30. While every terminal I had became so sluggish I could barely interact with the machine, I managed to open up "top(1)" and see what processses were royally screwing my machine. Turns out it was 10 instances of Mono, all trying to digest an ASP.NET site at once, all competing for the meager resources available. It seems that the Mono FastCGI server will process and compile your entire ASP.NET web application as soon as the FastCGI server is bootstrapped and accepting requests. Fortunately pushing new code to the site gets updated on the next HTTP request, so the number of times you'll have to kick (i.e. restart) the Lighttpd server should be minimal and you won't have to incur the huge performance penalty that often (I've since changed max-procs to 4).
During the nigh 12 hour break I had between regular work over Thanksgiving, I spent about four hours writing a little utility that I wanted to use instead of TinyURL, and found a fantastic domain name for it too: Urlenco.de. I also wanted to use the opportunity to explore using Npgsql, the .NET connector for PostgreSQL, which was a very pleasant experience after using the MySQL .NET connector (part of the pleasant experience was using PostgreSQL itself, of course). Another new thing to explore was the FastCGI support for Mono/ASP.NET, I'll be sure to jot down my experiences with Mono's FastCGI support in a later post since my brain is too fried to talk about it coherently in detail.
The most important part of the entire project was further refining my rapid-development process for Mono and ASP.NET so I can do quick little projects like this and push them to a live webserver in a matter of hours instead of days (of time I don't have). This mostly consists of boiler-plate project templates for some basic database code, page templates, and a NAnt build script that facilitates the building and testing of the site using xsp2 on localhost. Nothing spectacular, just having a toolkit of necessities to take from one project to the next, especially when time is at such a premium, is a minor but important difference from how I work now as opposed to how I used to work (when I had expendable time).
I hope everybody enjoyed their stay this past week in Madrid for the Mono Summit 2007.
Unfortunately, it's been too hectic a month to take the week off and go to Madrid, so I'm incredibly jealous of all of you. Grumble.

When I originally wrote the Facebook demo application "Why are you awesome?"
I wrote it in PHP4 in about 3 hours and hated myself for every one of those miserable 180 minutes. Since then however, I've been slowly and methodically working on a new, JSON-based, Facebook client library (Mono.Facebook.Platform) specifically to bring together some of the aspects of pyfacebook, the PHP client, and the Facebook Toolkit that I like (implementation progress can be found in the NOTES). After getting some of the key Facebook calls implemented to support "Why are you awesome?" I figured I might as well give it a whirl and see if a "real" application would work on top of the library (it does).
Thus far, all that were needed as far as library calls were:
- feed.publishActionOfUser
- notifications.send
- fql.query
- profile.setFBML
A couple of the things I've found thus far in my work have been, that writing a library that you have to use forces you to think about what you add and what you remove a lot more and focus on simplicity and extensibility; secondly, JSON is much faster, meaning I can do things with the Mono.Facebook.Platform library that I couldn't with the XML-based PHP4/5 library. Operations like fetching the user IDs of all 700 friends of mine complete in a timely fashion under the JSON library, whereas they typically timeout with the XML-based libraries.

The Mono.Facebook.Platform library isn't even alpha, it's in negative greek letters right now, there's not enough of the API implemented, and it doesn't handle errors very well at all, so don't use it. When it's finished however, I intend to support over 90% of the Facebook calls, and offer it up as a faster, viable option, for ASP.NET developers on Windows and on Mono.
Of course if you want to check out "Why are you awesome?", head on over to the application page and install it.
I figured I'd write up a guide to building Mono from Subversion in preparation of the upcoming 1.2.6 release, on a site I've neglected since I set it up, mononews.org (I hope to get back to writing tutorials and "newsy" stuff with the 1.2.6 release).
Anyways, if you've got Leopard installed, Geoff Norton did a great job in helping me track down the remaining Leopard/i386 bugs earlier today, so now you can build and run Mono relatively easily from Subversion on your fancy smancy new OS.
Last week at the Widget Summit speakers dinner I met an executive from DoubleClick, you know, that gigantic ad company that recently got acquired by Google, Inc. While talking about some of the difficulties in developing scalable web products I brought up some of my history in terms of developing .NET web applications and of course, Mono (at least I think that's how we got on the topic).
As it turns out, DoubleClick is really pushing to modernize their internal infrastructure on the .NET platform and really needs some smart folks either willing to move to New York City, or that already live there. If you're looking, feel free to contact me at tyler@monkeypox.org and I'll put you in touch, or hit up their careers page.
If you go to work at DoubleClick, I think you can technically get away with saying you work for Google. You'll also be able to say you are working on truly scalable .NET, which is something I really only think Windows Live and Myspace* developers can say currently.
Of course, if you're on the west-coast or lean more towards Python, Slide is always hiring.
* As it turns out, Myspace runs one of the largest .NET sites on the internet, and lays claim to the largest SQL Server installation on the entire planet.
Earlier this week, following CommunityNext and Graphing Social I was lucky enough to have been asked out to Boston for Remix 07 Boston. After receiving the necessary flack from my co-workers at Slide (primarily a Python/Linux shop), I boarded a plane late Sunday night to arrive extremely early on Monday morning (6a.m. isn't my best hour).
Upon arrival to the Hyatt Regency Cambridge, I found out that I had access to the Media Room, which allowed me to recharge my laptop and plug into a hard-wired connection such that I was able to write up a few blog posts from the conference itself. Having such access also allowed me to work on some sample Silverlight applications that I'll write up over the weekend covering Silverlight and IronPython.
While I enjoyed the sessions, such as Miguel's session on Moonlight and Mono and another session on the DLR and dynamic languages, what I enjoyed most was the ability to pick the brains of some of the folks there. Specifically guys like Aaron Brethorst, who works a lot on Microsoft Popfly's interface among other things, who let me question just about everything under the sun with regards to Popfly while still maintaining that I really like the application and its potential.
Before I leave Boston, I had to make sure of one more thing, that my fellow Mono bretheren got to see what I got to see, Miguel's keynote. Thanks to lots of hard encoding and video preparation done by G. Andrew Duthie and his crew from Microsoft's Media Room at Remix 07 Boston, the videos from the keynote have already been posted in their entirety to Channel 9.
Unfortunately they didn't clip the videos on a per-speaker basis, so you'll probably want to fast-forward in the video to about the 11 minute marker to watch our fearless leader question the manhood of 400 Microsoft developers as I had previously mentioned. Talking with Miguel after the fact he mentioned that some of his more witty quips were mostly due to him worrying about things breaking on stage and going impromptu with some of the things he was talking about. Overall though I think Miguel did a great job exhibiting Moonlight and the Gnome desktop in general, so I hope you enjoy the video (again, fast-forward to the 11 minute marker).
(Download VLC to watch on Linux/Mac OS X)
Miguel de Icaza, one of my own personal geek heroes, just gave his brief "keynote" as part of Microsoft's partner talks component of the overall Remix Boston 07 keynote speech.
After previous demos being proudly shown for "working in Safari on Mac OS X, and oh by the way, it's PC compatible too", Miguel showed everybody up by pulling up the still very development version of Moonlight and dazzled a room full of hardened .NET/ASP.NET developers and designers with Mono's progress on the Moonlight project in a scant 4 months since the original "Mix Vegas" conference earlier this year.
If you hang around Miguel enough, you'll know how much he loves Compiz, which he used gratuitously during his demonstrations. The mixture of a good looking Gnome skin and Compiz really helped convey that "yes, Linux is here, Gnome is a fully-featured desktop environment, and check out this AWESOME CUBE EFFECT!" As a developer who's participated in the open source community for almost five years now, it was very inspiring to see a room full of Microsoft's battle-tempered third party developers pine to have some of the cool features that Linux has!
After a grueling flight that started with a full-on sprint from the TSA security checkpoint and ended about a quarter mile through the terminal (in socks no less), I have made it across the country to Boston for Remix 07 Boston.
I'm still anxiously awaiting the keynote, and trying to find the Mono guys that are in attendance to try to learn as much as possible about the development and future of Moonlight, while simultaneously trying to learn as much as possible about how other developers are embracing and using Silverlight too.
If you're at Remix, come find me, I'm a San Franciscan in a rainy Boston, and I'm scared ;)
I'm this idiot, rocking my "business attire"


Turns out I'll be attending Remix 07 Boston next week but unfortunately my mega-cool-Silverlight hack won't be finished due to some scheduling complexities involved with working 130% of my time at a start-up in San Francisco (turns out, not too conducive to side-projects). I will be arriving bright and early at 6:30a.m. pounding down a gigantic (and expensive) airport coffee, and then heading to the Hyatt Regency Cambridge, so I apologize in advance if I look exceedingly tired Monday morning.
It'll be a great opportunity to get a feel for where Microsoft thinks that Silverlight is going, and how they intend to get there. It's a long hard road to even become near where Flash is in terms of market entrenchment, but Microsoft is one of three companies I believe currently capable of acheiving it (the other two being Adobe itself [bought Macromedia, they cheated], and Apple).
I would also like to give those Popfly guys an earful but I may spare them depending on how busy I am trying to find some fellow Facebook developers that live in the Boston area, or Miguel, who I'm pretty sure doesn't exist, but is merely a robotic creation of some wacky laboratory in Mexico.
If you'd like to meetup and have lunch, or a beer in the evening Monday or Tuesday, feel free to send me at email (tyler@slide.com) or track me down during the actual conference (i'm this guy).
Special thanks to Anand for what us young-folk call "the hook-ups" and I look forward to seeing both of my blog readers in Boston next week ;)
I remember watching a Channel 9 interview about Popfly with my coworker and former landlord David Young just after the original Facebook F8 Platform Launch back in May, laughing hysterically at a user-interface that used grass as an interface element, but at the same time thinking it was a very cool use of Silverlight as an application platform, instead of a Microsoft reply to Flash. Since that fateful day in May when a Microsoft Vice President of Business Development unveiled Popfly (exactly who should be unveiling a developer tool), I've heard close to absolutely nothing about Popfly, but loads about Silverlight.
Waiting to build a new version of Mono from trunk, I figured I'd check it out again, hoping their ludicrous "private beta" period would have passed, and I could finally use the technology that was unveiled almost 5 whole months ago. Alas, despite having the Silverlight plugin for Safari, popfly.com doesn't support Safari (I thought people wrote cross-platform web pages these days). Admitting my defeat, I popped open my VMWare instance of Windows XP, and Internet Exploder 7, only to discover that yes, Popfly is still invite-only or they're having server difficulties? Despite their about page jokingly referring to themselves as the developers behind products like Microsoft Bob, I'm starting to wonder if they weren't joking, as Popfly's introduction at F8 was either woefully premature or Microsoft decided that a developer environment where you draw lasers in-between boxes that represent stuff is too silly.