Thursday, June 29, 2006

XPCOM Lisp (or XPCommon Lisp or XPLisp or Mozillisp or Mozilisp)

For over a year now I've had this idea of a lisp interpreter embedded in Firefox (or more generically Mozilla). It seems the more I think about it, the better it might be.

Presently, Mozilla uses Javascript as the "glue" between XPCOM components, XUL, and whatnot. Why couldn't Lisp (or some variant) be used as well? You could send some Lisp code to an XPCOM component and it interprets it for you, with access to other XPCOM objects. AutoCAD has AutoLisp...I would have a hard time imagining that a Mozilla equivalent would be completely useless.

To compound things even more, I found another reason why it might be good: the GUI. Lisp seems to be stuck (for the most part) in the text-based world...except for HTML applications and a few others. However, a Lisp XPCOM object could take advantage of XUL for buttons & widgets, which is handled quite nicely in a cross-platform manner. Indeed, with an XPCOM Lisp interpreter, the whole thing is cross porting necessary. One could even set up a Mozilla-based SLIME & Emacs editor (has this been done?), so the Lisp code creates Mozilla-based applications from a Mozilla-based editor & interpreter.

From what I know, it seems like there are two approaches to this method:
(1) Create a replacement for XPConnect that interfaces Lisp directly to XPCOM objects.
(2) Use the exisiting Javascript system to communicate with a Lisp XPCOM object by passing strings which contain Lisp functions.

I'm thinking (2) is a much better/simpler/more elegant solution, although there may be some limitations that I'm not aware of.

Are there any showstoppers in the idea, or is it just complicated/hard?


Blogger Naveen said...

Similar thing has been done for python with PyXPCOM and used in komodo ide
To get started, read this

lighter weight implementations such as jscheme may be implemented with a chrome script, see roachfiend tutorial.

9/27/2006 8:01 PM  Edit
Blogger Michael Terry said...

Oh, snap, I've been having the same idea, although it started with my desire to bring Emacs into the modern age. What if Emacs were grafted onto xulrunner and much better looking cross platform Emacs were established. That'd be sweet.

7/27/2008 7:31 PM  Edit

Post a Comment

<< Home