Re: Compiler writers will love this language

genew@mail.ocis.net (Gene Wirchenko)
8 Jun 2003 22:09:20 -0400

          From comp.compilers

Related articles
Compiler writers will love this language ericmuttta@email.com (2003-05-29)
Re: Compiler writers will love this language torbenm@diku.dk (2003-06-03)
Re: Compiler writers will love this language vbdis@aol.com (2003-06-03)
Re: Compiler writers will love this language ericmuttta@email.com (2003-06-05)
Re: Compiler writers will love this language ericmuttta@email.com (2003-06-05)
Re: Compiler writers will love this language mwotton@cse.unsw.edu.au (2003-06-08)
Re: Compiler writers will love this language vbdis@aol.com (2003-06-08)
Re: Compiler writers will love this language genew@mail.ocis.net (2003-06-08)
Re: Compiler writers will love this language marcov@toad.stack.nl (Marco van de Voort) (2003-06-20)
Re: Compiler writers will love this language ericmuttta@email.com (2003-06-20)
Re: Compiler writers will love this language ericmuttta@email.com (2003-06-20)
Re: Compiler writers will love this language ericmuttta@email.com (2003-06-20)
Re: Compiler writers will love this language torbenm@diku.dk (2003-06-20)
Re: Compiler writers will love this language d00-mla@nada.kth.se (Mikael 'Zayenz' Lagerkvist) (2003-06-22)
[14 later articles]
| List of all articles for this month |

From: genew@mail.ocis.net (Gene Wirchenko)
Newsgroups: comp.compilers
Date: 8 Jun 2003 22:09:20 -0400
Organization: Posted via Supernews, http://www.supernews.com
References: 03-05-211 03-06-015 03-06-054
Keywords: design
Posted-Date: 08 Jun 2003 22:09:19 EDT

ericmuttta@email.com (Eric) wrote:


[snip]


>I have often wondered how specifying evaluation order impacts
>implementation. The arguments I have heard for it are:
>
>- it allows consistency between different compilers hence allowing
>code portability between compilers
>
>- it allows one to take advantage of evaluation order in expressions
>
>The second one sounds dubious at first but thinking about it, we
>always rely on our code executing from top to bottom and write the
>code so its dependant on that execution order. So then, is it
>unresonable to specify that evaluation order is left-to-right (or
>vice-versa)? If so, what are the arguments for leaving the order
>undefined? (I have heard something related to efficiency and register
>allocation during procedure invocations, but no explanation was
>given).


          Reversing that, you can take advantage of evaluation order. It
might be possible to optimise out constants by reordering evaluation:


                    #define OFFSET1 5
                    #define OFFSET2 15
                    ...
                    ... someint + OFFSET1 + OFFSET2 ...


          The natural order for most programmers appears to be variable
followed by constant(s).


[snipped previous]


Sincerely,


Gene Wirchenko


Post a followup to this message

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