[parenscript-devel] Package system: a modest approach.

Vladimir Sedach vsedach at gmail.com
Sat Aug 4 06:44:57 UTC 2007


Hello everybody,

If you've been following the darcs repository, you may have noticed
the addition of Red Daly's package system. Upon working with it for a
little while, I've concluded that I don't like it very much. I think
it falls outside the scope of what ParenScript is intended to do (for
instance, I don't think PS needs its own implementation of the Lisp
reader...), tries to provide too much functionality, and from working
with the code I find that it adds significant complexity without
offering a corresponding increase in value.

My proposal, which I will start implementing next week, is based on
the observation that there are really only two things needed for a
namespace system for Javascript that will cover almost all use cases:

1. Being able to mangle identifiers for different namespaces. This can
be easily implemented by associating a prefix string to a Lisp
package.

2. Being able to import/use the ParenScript constructs from a
different package. This can be implemented by adding some simple
lookup logic to the ParenScript script-expander.

The underlying idea behind ParenScript is to integrate as closely as
possible with Common Lisp, which is why I think the other possible
namespace features (in-package, hierarchical imports, exports, etc.)
will not be necessary, and, if they ever turn out to be, should be
implemented in a different way than the current system.

Having made the observation above, I also think it is wrong to extend
ParenScript in any way that will prevent its integration with Common
Lisp (this is why the ParenScript reader in particular, and
ParenScript files in general, now seem like a bad idea to me).
Besides, that functionality is better implemented on a level above
ParenScript (for example, I have absolutely no interest in having a
function for compiling ParenScript files to Javascript files - it can
be implemented trivially with the usual ParenScript forms, but why
would you want to do it in the first place if Lisp lets you store the
output in the web server's memory?).

Having come to these conclusions, I've decided to remove the reader
and the ParenScript ASDF system from the ParenScript repository. Red,
if you want to continue working on them, I really think that those
parts will fit better in their own projects. I am planning to start a
re-implementation of the package system and a long overdue refactoring
of the compiler next week.

Happy hacking,
Vladimir



More information about the parenscript-devel mailing list