[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
eval and other topics
A large number of arguments against doing feature X for a while have been
along the lines of:
We shouldn't do feature X because then the compiler becomes harder, and
couldn't optimize the code as much.
While this may certainly be true (though it is more likely that the compiler
would have to detect the use of feature X and THEN not optimize the code as
much), I think it completely avoids the much deeper issue.
I am a user of lisp. I am not a compiler writer (now). I don't CARE if such
and so is easily compilable. I use lisp because it lets me express my ideas
more easily than other languages do. If we stifle the growth of CL toward the
lisp USER's needs, we will have a very fast, very compilable language that no
one will want to use.
I think that the questions that need to be asked when feature X is proposed is
1) is it a real problem? is there a simple mechanism that already exists to
address the problem? If the proposal is syntactic sugar is it of the form that
will allow program writers greater perspicuity?
2) does the proposed solution actually address the problem generically, or
does it only address some instance?
3) can the solution be implemented at all?
4) is it reasonably upwards-compatible with the existing language? (not
necessarily existing implementations). If not, is the scope of the change
relatively small (will not require substantial rewrite of existing USER code,
and/or the rewrite involved could be handled via a simple text
5) has the proposed solution actually been tried? Has it actually helped users
who have run accross the problem? Does it otherwise constrain them? Is it
intuitive? (i.e. is it something that seems to "fit" the language - nebulous I
know, but this is an intuitive description too. Something like is it in the
style of Lisp.)
If the answers to the above are satisfactory, then I think there is a
reasonably good case for adding the feature to the language. Minor
difficulties like requiring smarter compilers, substantial rewrites to
existing compilers, etc. is a complete side issue, I think. Mostly because if
adding feature X allows a reasonable increase in USER productivity, who cares
how much time it takes the COMPILER writer to implement it - that time is
amortized over all the users who are now saving time with the new feature (or
at least able to express themselves more clearly in CL, or whatever).
PS: I bring this up because I mentioned the EVAL thing privately to Fahlman a
few months ago back when he was controlling new discussion, and basically got
back his original posting on the subject. While I certainly concur that a
lexical eval is not a particularly good idea as far as a compiler writer is
concerned (because it is very hard, and very inefficient), I think it is a
TERRIFIC idea for USERS. I've needed the functionality several times, and each
workaround is a total hack that has to be explaned in about a page of extra
documentation so the next poor slob that has to maintain my code can figure
out why I wrote such dreadful code in the first place (and what it does).