Orthodox Otter

Here's another new Lisp: Perry Metzger's Otter is a sketch of a case-sensitive Lisp-1 with short names and a little extra syntax and a module system and regular expressions and a cute animal mascot. Hygenic macros and a fancy compiler are planned but have been put off. It's supposed to be radical and heretical.

Radical? Heretical? Quite the opposite! There are a lot of new Lisps nowadays, and most of them include most of Otter's features (except maybe the mascot). There's hardly anything unusual here, except maybe the distaste for improper lists (a mistake which I also made for a while) and the choice of ! for setf (which seems obvious in retrospect - I will steal it now kthx). The rest of Otter is a reflection of what most Lispers consider the right way forward. It's not heretical, it's orthodox!

It's hard to detect these changes from the inside, but it seems to me this is a new development. Ten years ago, there was not so much agreement on what new Lisps should look like, nor on their desirability. The old orthodoxy was to cling to the existing dialects, as the language was perceived to be under threat. Remember when everyone was defending Common Lisp, except the Schemers, who claimed their language wasn't even a Lisp? But nowadays most Lispers don't think of the language as threatened. Instead we look forward to its future growth, and we aren't afraid to let a hundred flowers bloom.

But Otter probably won't be one of them. That presentation, from last August, seems to be the only available information on it. There's still nothing on the website but a picture of some sea otters. Sketching new lisps is fun (well, I think so, and evidently Perry does too) and easy, especially when you have an orthodoxy to guide you. Implementing them, and solving all the problems that surface in the process, is a lot of work, and prone to being put off forever. I suspect that's what happened to Otter.

But where one person can sketch a Lisp, others can build one. And we should. Never in the history of Lisp (or any programming language, IMO) have we had such an appealing orthodoxy. It is an irony not surprising in the Lisp community that that orthodoxy is now a language that does not actually exist; you cannot use it. But it is the sort of language that makes you want to. The popularity of new Lisps, and the extent of agreement on their features, suggest that it will have many incarnations in the years to come.

And now I'm better go work on mine...

2 comments:

  1. I guess I'm a bit late, as I just stumbled across an old post from a search, but I'm curious as to what changed your mind about improper lists?

    ReplyDelete
  2. Old posts are fair game - it's not like commenting on one interrupts another conversation or anything.

    I was paranoid about improper lists after reading CLtL's warnings of undefined behaviour, e.g. "an attempt to print a circular structure may lead to looping behavior and failure to terminate." I thought this was scary because it made it essentially impossible to work with lists safely - they could always be circular, and you usually couldn't even detect it. I stopped worrying when I realized this isn't specific to lists - any old structure can be made circular, and it's rarely a problem in practice (except when you forget to set *print-circle*). And it's almost never a problem for lists, because lists don't become circular by accident.

    Requiring every cdr to be a list makes more sense than prohibiting circular lists, because it's much easier to enforce, and because it doesn't lose as much useful functionality (although it still does - improper lists let you do things like represent an environment as an alist whose last cdr is a module). It also has the practical benefit of making list operations faster by removing a typecheck (or rather moving it to construction, where it only happens once and can often be optimized out). In a language which supports enforcing type restrictions on slots, requiring cdrs to be lists makes sense. But this is about optimization, not expressiveness, so I think including it in the early stages of a language design is a mistake.

    ReplyDelete

It's OK to comment on old posts.