[Conkeror] Lisp for conkeror?
Jeremy Maitin-Shepard
jeremy at jeremyms.com
Wed Mar 5 11:38:25 PST 2008
Evans Winner <thorne at timbral.net> writes:
> This might be stupid, but I was thinking, I believe it is
> possible to write a simple scheme or lisp interpreter in
> JavaScript[1]. Not knowing anything about JavaScript, and
> being a refugee from the Emacs world I would love to be able
> to write (at least simple) conkeror customizations in
> something more familiar to me (i.e., more lispy). Is this
> realistic or reasonable or whatever? Anyone already doing
> this?
Well, it might indeed be something interesting to try. I just looked
briefly at jsScheme. Given that JavaScript is already extremely slow,
the compile-to-javascript functionality of jsScheme seems to be most
promising. It claims not to support continuations, but I imagine that
it could easily be extended to support that as well, using the new
"Generator" support in JavaScript 1.7 that is the basis for the
coroutine library in Conkeror.
I also didn't look at jsScheme enough to know to what extent it is
designed to be its own self-contained scheme environment, and to what
extent it can fully inter-operate with JavaScript stuff. Naturally, in
order to be at all useful for programming Conkeror, it would need to be
able to fully inter-operate with JavaScript.
If you are interested, it might indeed be very interesting to extend
jsScheme as needed in order to work as needed. Then scheme code could
be compiled to JavaScript (or possibly compiled just-in-time) in order
to (hopefully) avoid any performance penalty. Unfortunately, I'm not
sure I will be able to devote much time to doing this sort of thing, but
I may be able to provide quite a bit of help, particularly in compiling
scheme continuations to JavaScript.
That said, it is not clear that there is really much of any advantage in
using Scheme in place of JavaScript. I think if you look at JavaScript,
you'll find that it is in fact surprisingly quite powerful; it supports
function closures, functions are first-class, the prototype-based object
facilities are quite powerful, and as a special note, Conkeror has
libraries in it to support coroutines and keyword arguments to
functions. Learning a new syntax is not terribly difficult.
--
Jeremy Maitin-Shepard
More information about the Conkeror
mailing list