Lisp Befuddlement
Posted by Daniel Lyons Thu, 31 Jan 2008 08:24:00 GMT
The world seems to be a little bit less optimistic today, because Arc has been out for 24 hours and has not yet changed the world.
In case you can’t tell, I like Lisp a lot. Seeing a Lisp machine work recently changed my opinion of Lisp a bit. I had been looking forward to Arc as a Lisp-2 with dirty macros and a lot of opinionatedness, basically as a tiny Scheme which celebrates all that’s gross about the other half of the Lisp family. But now that it’s here I’m not sure I see the point. It’s not that I don’t love Paul Graham, either. I just feel like something is awry.
There are, as it turns out, a number of minor Lisps out there which attempt to address some aspect of what makes Lisp annoying:
- Qi attempts to bring advances in functional programming back to Lisp.
- Lush tries to push Lisp into the multimedia/science sector.
- Scsh attempts to blend Unix and Scheme together.
- newLisp is a refresher and a shot at bringing Lisp to the web.
- Liskell is a Lisp syntax for Haskell with macros.
The problem, essentially, is that the Lisp machine was not a machine programmed in Lisp. It was a comprehensive environment which blurred the distinctions between language, operating system, hardware and editor. To use Emacs is to accept that the editor and the language/OS/hardware will be separate. To use Common Lisp on a modern OS is to accept that the language and the OS are separate. This goes against the nature of Lisp as fully realized on the Lisp machine. It feels inauthentic.
Of the five above, I have the most interest in the Scheme shell because I see it bringing back the tight integration between Lisp and the OS. Scsh not only brings a concise process spawning/piping and IO redirecting sublanguage to Scheme, it also bridges most of the POSIX APIs. It’s way more than just a shell, covering territory you’d traditionally need C for at the low level, the shell for process control, and a scripting language for logic. Instead you get all three for the price of one. I’m very intrigued.
This of course makes me wish I knew more Scheme. Which is an awkward position to be in as a Lisp partisan of so many years. This quote from Lambda the Ultimate helps:
An hygienic macro is one where the meanings of symbols that aren’t parameters to the macro are bound at the definition site rather than the expansion site.
Another user points out that you can accomplish variable capture with a hygienic macro as well as an unhygienic one, but there are problems you can run into with an unhygienic one that you can’t solve with gensym.
I wish I were less tired so I could be more coherent about all this, but it’s been a hell of a day, a hell of a week, and a hell of a month.

AFAIK there is now way to make a variable capture with hygenic macros (pure syntax-rules) unless you pass in the symbol, but that’s not really a capture. ;] You can, however, introduce new symbols in the callers scope with syntax-case (which I suggest starting with if you come from CL; this or find a defmacro library for your Scheme).
IMHO Scheme feels like cleaned up CL with most of the usefull stuff missing. On the other hand it is more functional (like in functional programming) and PLT Scheme give you back most of the missing things (check you the prerelease versions; the unmutability mentioned on LtU is not as important as the other changes).