Patching running code

ziggy on 2004-02-25T16:14:14

Lisp folks like to talk about the power of their language and environment. A common citation is Paul Graham's experiences at ViaWeb, where using Lisp allowed developers to modify a system, while running. This was quite impressive, because Paul claims that many fixes could be performed while the customer was on the phone reporting the bug, and fixed live for the entire system.

Lisp isn't the only language to have this property. True, it's damn near impossible to do this in C/C++ or perhaps even Java. But you can accomplish this with any simple fork/exec CGI script, and with a little work, you can still do it with moderatly complex web apps, including those using mod_perl. Not as quickly as you could do with your standard lisp image, but not impossible.

Bill Clementson was talking about this Monday and Tuesday this week. I think I figured out why these kinds of systems make my skin crawl.

First, it's nice to work with a long running system, know you've got everything working and leave it alone when it works. Everything is in one place, including the test scripts. That development model works for some people, but it never worked for me. I'm a dyed-in-the-wool C programmer, and I'm used to lots of small programs running, with the odd server performing some task specific function. I don't expect every program I write to have a full development environment, along with multiuser connectivity so that approximately anyone can log into the system and make modifications. But that's just me.

Second, these Lisp-based systems tend to be written by very small teams of very talented programmers. They like the fact that Lisp environments give them all the tools they need to operate at light speed. At the same time, this kind of solution feels fundementally unscalable. This is not the kind of project I'd want to use with dozens of programmers, or programmers with widely varying levels of expertise. Allowing anyone (on the development team) unfettered access to the entire running project feels like an invitation to crash the system in horrible, almost irrecoverable ways. And always at the worst possible moment, of course.

And I think that's why I'm most uncomfortable working with system images. Not only is your source locked in, but enabling runtime patches to a live system just feels dangerous.

Then again, these are just cultural differences. I wouldn't expect most C programmers to understand that closures and runtime aliasing/redefinition of subs make Perl a more powerful language.


The author's reply

ajtaylor on 2004-02-27T17:09:10

The author noticed your post here and has posted his own reply: http://home.comcast.net/user/bc19191/blog/040225.html

I used to do that all the time

brian_d_foy on 2004-02-28T09:49:56

The clients would call up complaining about something, the phone guy would keep them on the line while I fixed it, then we would ask them if they had cleared their cache, reloaded the page, and other such things. People expected Windows and IE to be so buggy they bought it every time. :)