Newsgroups: | comp.compilers |
From: | rabin@CS.YALE.EDU (Dan Rabin) |
Keywords: | syntax, design |
Organization: | Computer Science, Yale University, New Haven, CT 06520-2158 |
References: | 95-04-013 95-05-078 |
Date: | Fri, 12 May 1995 17:40:47 GMT |
Stefan Monnier <monnier@di.epfl.ch> writes:
Wouldn't it be so much easier to store your source as a syntax-tree ?
1 - the compiler doesn't have to care about parsing.
2 - but somebody else (the editor, for instance) has, so 1 is moot.
3 - you can edit your file with whatever indentation style you want: just ask
the editor (the editor would do the unparsing)
4 - you can even choose between different syntaxes. If you prefer indentation
over block delimiters ... go ahead. The mapping from text to syntax tree
would not be part of the language itself, but would be a little
editor-customization !
[...]
I am 100% in agreement with Stefan Monnier, and I would like to see this
point of view on the proper relation of concrete-syntax design to
programming-language design gain greater acceptance. Concrete syntax
is essentially part of a programming language's user interface, not
part of its functionality. Like all user-interface issues, this one
deserves careful design and testing, but this is largely an
independent issue from designing the semantics of the language and the
capabilities of the compiler.
The usual gripes along the lines of `Lisp sucks--it has too many
parentheses' seem to me to be roughly analogous to saying `Internal
combustion engines suck--my Buick's steering wheel gets too hot in the
summer'.
-- Dan Rabin (rabin-dan@cs.yale.edu)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.