Newsgroups: | comp.compilers |
From: | schrod@iti.informatik.th-darmstadt.de (Joachim Schrod) |
Keywords: | syntax, design |
Organization: | TH Darmstadt, FG Systemprogrammierung |
References: | 95-04-193 95-05-066 |
Date: | Fri, 12 May 1995 10:11:05 GMT |
> lutz@KaPRE.COM writes:
> >schrod@iti.informatik.th-darmstadt.de (Joachim Schrod) writes:
> >> [indentation syntax makes it hard to generate programs]
> >
> >Could you provide some more details? I've heard this argument
> >before, but it's not clear to me that it would be any harder to
> >generate N tabs than to generate block delimeters correctly. How
> >hard is it to keep a global tab counter?
plong@perf.com (Paul Long) writes:
> I assume he means that generating proper indention is not as easy as
> generating a basically unindented program but with proper syntax.
No, I think I wrote what I mean; it was in the deleted part.
It's convenient to use refinements when one generates programs.
(There exist processors for them.) While generating one does not
necessarily know the current lexical level. I don't think one should
be forced to track it if not necessary, just because the language
designer thought one *must* indent properly. OTOH, I'll virtually
shoot any programmer working for me who does not indent properly.
Another example is the run-time generation of programs as strings
that are evaluated later. It's more convenient to create a Lisp-like
(i.e., fully parenthesized) structure -- and I think convenience is a
very important point in language usage. It allows the programmer to
focus on the problem at hand, not at the language quirks. (I'm not a
friend of C and C++, can you tell? :-)
Or take as an example the generation of Makefiles. Here you have a
language format where indentation and empty lines are important. (Even
tabs are important.) Again one has to pay lots of attention in getting
the quirks right, time that would be better spent working on
solutions to the real problem...
Hope I expressed myself clearer this time,
Joachim
PS: Please don't tell me one should use other target languages & CM
tools. Technical matters are only one (and most often minor) point in
the selection of languages & tools for a project.
--
Joachim Schrod Email: schrod@iti.informatik.th-darmstadt.de
Computer Science Department
Technical University of Darmstadt, Germany
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.