Alright, so I can no longer keep this to myself. I've been fantasizing about it for too long:
I want a true Common Lisp implementation running on top of, and integrated with,
Microsoft's CLR, and I want it badly.
It took a while, but after all those years at
CoCreate
(where we write a lot of Lisp code), I fell in love with
the language. I want to work on projects which use Common Lisp, and I want
the language to be successful and popular in lots of places - if only so that
I have a choice of cool jobs should the need ever arise
In other words, I want Common Lisp to become a mainstream language - which it arguably
isn't, even though pretty much everybody agrees about its power and potential.
One way to acquire mainstream super-powers is to team up with one of the
planet's most potent forces in both software development and marketing: Microsoft. This
is the strategic reason for my proposal. Yes, I know, many Lisp gurus and geeks out
couldn't care less about Microsoft and the Windows platform, or even shudder at the
thought. But there are also tactical and technical reasons, so bear with me for a minute
before you turn on your flamethrowers.
When I say Microsoft, I really mean .NET and its Common
Language Runtime. Well, that's
what
they say is how to spell out C
LR. But I claim that the L could just
as well stand for Lisp, as the CLR, particularly in conjunction with the
Dynamic Language Runtime
extensions which Microsoft is working on, is a suspiciously suitable platform to build an
implementation of Common Lisp upon: Not only does it provide a renowned garbage collector
(designed by former Lisp guru
Patrick
Dussud)
and a rich type system, it also has extensive reflection and code generation support,
and - through the DLR - fast dynamic function calls,
AST processing and compilation,
debugger integration, REPL support, and all that jazz. It's no coincidence
that languages such as C# and even VB.NET are picking up new dynamic language
features with every new release, and that Microsoft has even added a new functional
language, F#, to the set of languages which are (or will be)
fully integrated into Visual Studio.
The wave is coming in, and we better not miss it!
Best of all, it's not just about Windows anymore: The DLR and IronPython also
run on top of
Mono. Mono is available for Linux, Solaris, Mac OS X,
various BSD flavors as well as for Windows, so layering Common Lisp on
top of the CLR doesn't limit us to the Windows platform at all!
Note that I explicitly said "Common Lisp". I think that it's vital
for an implementation on top of the CLR/DLR to be truly standards-compliant. I am not alone
in this belief: In the
IronPython and
IronRuby
projects, Microsoft went to great lengths to make sure that the implementations are true
to the original language.
What would this buy us? Well, one recurring and dominant theme in discussions about
the viability of Lisp as a mainstream language is the perceived or real
lack of actively maintained libraries and tools. With the approach I'm outlining,
we could still run all those excellent existing
Common Lisp libraries
and
projects
out
there,
but we'd
also be able to use the huge body of code both in the .NET framework
itself and in third-party .NET components. Common Lisp code could seamlessly
call into a library written in, say, C#, and VB.NET programmers would be able
to consume Common Lisp libraries!
Taking it a little further, we could also integrate with Visual Studio. Where I work,
it would make all the difference in the world if we could edit, run and debug
our Lisp code from within Visual Studio. I'm convinced that this would
attract a large new group of programmers to Common Lisp. Hordes of them, in fact
Yes, I know about
SLIME and
Dandelion and
Cusp, and I'm perfectly aware that
Emacs will simultaneously
iron your shirts, whistle an enchanting tune, convincingly act on your behalf
in today's team phone conference, and book flights to the Caribbean
while compiling, debugging, refactoring and possibly even writing all your
Lisp code for you in the background. Still, there's a whole
caste of programmers who never felt any desire to reach beyond the confines
of the Visual Studio universe, and are perfectly happy with their IDE,
thank you very much. What if we could sell even those programmers on
Common Lisp? (And yes, of course you and I could continue to use our
beloved Emacs.)
Now, all these ideas certainly aren't original. There are a number of projects
out there born out of similar motivation:
- L Sharp .NET - a
Lisp-based scripting language for .NET by Rob Blackwell
- Yarr - Lisp-based scripting language for .NET
based on L Sharp
- dotLisp - a Lisp dialect for .NET,
written by Rich Hickey (of Clojure fame)
- Rich Hickey mentioned in a presentation that the original versions of
Clojure were actually written to produce code for the CLR
- IronLisp - Lisp on top of the DLR,
initiated by Llewellyn Pritchard, who later decided to tackle
IronScheme instead
- There's a even a toy Common Lisp implementation by Microsoft which they shipped
as a sample in
the .NET Framework SDK (and now as part of the
Rotor sources)
- Joe Marshall has an interesting project
which looks like Lisp implemented in C#.
- LispSharp is a CLR-based
Lisp compiler (Mirko Benuzzi)
- ClearLisp is another
CL dialect written in C# by Jan Tolenaar.
- A LISP/Scheme language for .NET (Adam Milazzo)
- CLearSharp, by Ola Bini
- Joe Duffy's Sencha project
- VistaSmalltalk may not sound like
Lisp, but it actually contains a Lisp engine (implemented in C#), and according to
the architecture notes I found, Smalltalk is implemented on top of Lisp.
- CLinNET, by Dan Muller
- CarbonLisp, by Eric Rochester
- MBase, a "metaprogramming framework"
providing a Lisp-like definition language
- Sohail Somani experiments with .NET IL generation from Lispy syntax
- RDNZL - .NET interop layer for Common Lisp (Edi Weitz)
- FOIL - Foreign object interface for Lisp (i.e. an interop layer) on top of both the JVM and the CLR, by Rich Hickey (again!) and Eric Thorsen
Unfortunately, some of those projects are no longer actively maintained,
others implement just a small subset of Common Lisp or even made design decisions
which may conflict with the standard, or they are "merely" interop layers which allow
Common Lisp code to call code written in managed languages, but don't provide
full CLR integration. Don't get me wrong: Most of those projects produced
impressive results - I don't mean to bash any of them, quite to the contrary.
What we learn from this project list is that there are quite a number of
brilliant Lisp hackers out there who are both interested in such a project
and capable of
working on it. Most encouraging!
So maybe it isn't just me. Or am I really the only remaining Lisp programmer with such
weird cravings? Be brutally honest with me: Am I a freak?
PS: I did not explicitly look for them while researching this article, but I know
there are also a number of similar endeavours in the Scheme world, such as
Common Larceny,
Bigloo.NET, Dot-Scheme and
Tachy.
PS/2: A few days after posting this article, I found that
Toby Jones
already coined the term "Common Lisp Runtime" three years ago...