Get your kaftan, we're talking Lisp
permalinkMay 1, 2007. Filed under: None
Anyone who has been in the software industry for a decent period of time is bound to have come across at least one Lisp fanatic. They are rare beasts, for sure, but what they lack in numbers they more than make up for in dedication to the object of their fanaticism. Unlike Java or C# hackers though, these Lispians have a real air of self-satisfaction about them; they aren't just passionate about the prospect of using a neat tool for cutting code, they've been to the top of the mountain and they've seen the other side.
For a long time I politely ignored this discomforting aspect of their characters, assuming that one day they would all just end up in some secluded compound in the desert happily coding Arc with Paul Graham as their leader and prophet, but actually I'm not that polite. If someone's walking around with a serene glow and inner peace then I either want some of it, or enough knowledge to outsmug them.
I've tried to teach myself Lisp on more than one occasion, and each time come away mildly competent in the basics but frustrated at the lack of knowing smile and spiritual contentment. And then in the same week I happened to read an article on defmacro.org and a number of similarly themed essays on domain languages, and the penny dropped.
In very Zen and the art of motorcycle maintenance terms the secret isn't in what the Lisp language is, it's in what it represents.
Just as in Robert Pirsig's book where the notion of an ad-hoc metal shim to stabilise loose motorcycle handlebars is discussed, it may be just a coca cola can cut into shape by tin snips, but it represents an elegant and optimal solution to the problem.
Understand the problem, Luke, then see the practical solution, not the can.
I'm still enough of a newbie to find the density of thought and excessive use of brackets in Lisp confusing, but I am starting to get a curious feeling that it might be time order my crimson robes.
Here's why.
I spent more than ten years as a software journeyman, wandering from project to project, industry to industry, staying in one place anywhere from a few weeks to a few years, earning my corn as an IT Contractor. The industries covered included investment banking, software houses, financial services, government, retail, utilities, military, and telecommunications.
All to some extent employed Java as their development language of choice. What are the chances, really, that Java is the ideal language to express the solutions to business problems in all these industries? Not very high. It was chosen because of the availability of people that know it, not because it fits the problem domain better than any other language.
And Java works (after a fashion) because in each corporate location it's been put to use, the classes, methods, packages and components of the JEE are selected and tailored to the domain in question. Perhaps not very well in some cases, but over time what is being created is a domain-specific language with nouns (classes) that represent ideas or entities and verbs (interfaces and methods) that act upon them.
If you forget Java for a second and see what's happening here, it's self-evident that any mechanism that makes it easier to define this tailored language is going to be a good thing. And that good thing will have to have properties that deal with fundamental things like types, data, classes, and even itself in some quite special ways.
And, as I reach for my guitar, I have to admit that, so far in my meanderings, Lisp appears to have those special ways. Even when I instinctively disagree with them, I find my instincts to be wrong.
I still hate the brackets (surely it would look more lovely if it were structured like Python?), but I'm stepping off the Greyhound in a remote corner of Texas, and I'm at the compound door. I'm a little shy and not quite ready to go in yet, but I can see Paul waving from the window.
He says he's been expecting me.