Lisp IDE's of the Future?
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
I have been doing a lot of thinking about the way we edit Lisp code. Increasingly, there are lots of subtle things that one needs to know when writing Lisp code.
I’l state the first example that I ran into, many years ago, when I began writing Lisp - the distinction between Functions and Macros. “You just have to know”. No color coding to provide hints.
The situation now is getting even worse (I’m contributing to the chaos with many of my own creations.) But let’s take one simple example: A function that produces functional closures for later use in other contexts.
(defun make-a-doit-fn (&rest *state*)
(lambda (&rest msg)
(match msg
…
)))
The implication here is that among the client users of these functional closures, there will be a dynamic binding named *STATE* which carries the encapsulated closure bindings at the time of closure construction, used colloquially as a kind of object state.
Clearly, this example will *NOT* produce the desired effect because of a mismatched understanding of when certain things happen during runtime. In this case, when the constructed functional closure is Executed, the binding of *STATE* will very likely NOT be what it was when the closure was Created.
And so, while you and I can recognize the difficulties here - you just have to know - what about newbies coming to Lisp. Now the cognitive loading has severely increased, and thanks in no small part to dull text editors, there are no clues that things may have disparate lifetimes.
I have not seen any code editors that offer colorization or fonts differences to highlight lifetimes, or any other dimension of separation, other than semantic class - variables versus functions, or Special Operators vs everything else. But I haven’t even seen one that distinguishes Macros from Functions, even though this distinction can often be as important as understanding the difference between functions and special operators, like BLOCK, or TAGBODY.
I don’t have any solutions to offer at the moment. But more and more of my own code offers up blocks of program text that intermingle multiple future threads of activity when eventually executing different portions of the code. Not even sure how you would hint to an editor that different highlighting might be called for.