Re: Incomplete compiler?

haberg@matematik.su.se (Hans Aberg)
4 May 2002 14:19:45 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Incomplete compiler? haberg@matematik.su.se (2002-05-01)
Re: Incomplete compiler? bernhard@cs.waikato.ac.nz (Bernhard Pfahringer) (2002-05-01)
Re: Incomplete compiler? haberg@matematik.su.se (2002-05-03)
Re: Incomplete compiler? Martin.Ward@durham.ac.uk (2002-05-03)
Re: Incomplete compiler? idbaxter@semdesigns.com (Ira D. Baxter) (2002-05-03)
Re: Incomplete compiler? tfb@apocalypse.OCF.Berkeley.EDU (2002-05-04)
Re: Incomplete compiler? haberg@matematik.su.se (2002-05-04)
| List of all articles for this month |
From: haberg@matematik.su.se (Hans Aberg)
Newsgroups: comp.compilers
Date: 4 May 2002 14:19:45 -0400
Organization: Mathematics
References: 02-04-147 02-04-156 02-05-017
Keywords: design, UNCOL
Posted-Date: 04 May 2002 14:19:45 EDT

"Ira D. Baxter" <idbaxter@semdesigns.com> wrote:
>> This clash is then a consequence of insisting on using only
>> one syntax for the whole language.
>
>The standard phrase for this is "Domain Specific Language (DSL)". The
>usual argument is that you should let designers write down their
>problem/solution in a familiar notation to minimize errors and
>maximize productivity. The issue then becomes, how to implement such?
...
>It turns out that the specification of such translators is nicely done
>by yet another set of DSLs, including ones we all know and love like
>regular expressions for lexers, BNF for grammars, attribute evaluators
>for analysis. Perhaps the most interesting "DSL" we use are
>source-to-source rewrite rules. Here's a language which is extended
>(automatically) to include other languages as part of its notation.


An idea I have in my mind is to design a common binary (runtime)
model, to which every grammar translates its semantics. This roughly
then corresponds to the mental picture that mathematicians make use
of, namely to build a set of notions (semantics) and then introduce
suitable notation (syntax) in order to express that. I made such a
runtime model that includes the lambda calculus, so I feel one can
capture most of computer programming this way.


One problem, when thinking about extensibility for C++ expressions
(operators with precedence) that I do not know how to solve is how to
merge grammars. For example, in C/C++ ²^" has lower precedence than
"+" and "*". What if somebody wants to use "^" to denote
exponentiation, too, and for that wants "^" to have a higher
precedence in some circumstances?


    Hans Aberg * Anti-spam: remove "remove." from email address.
                                    * Email: Hans Aberg <remove.haberg@member.ams.org>
                                    * Home Page: <http://www.matematik.su.se/~haberg/>
                                    * AMS member listing: <http://www.ams.org/cml/>
[A common runtime model? Hmmn. Perhaps this would be a good time to
review all of the UNCOL projects that have failed over the past 50
years. -John]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.