Re: What is the meaning of an expression?

gah4 <gah4@u.washington.edu>
Tue, 18 Jan 2022 15:18:51 -0800 (PST)

          From comp.compilers

Related articles
[4 earlier articles]
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-14)
Re: What is the meaning of an expression? gneuner2@comcast.net (George Neuner) (2022-01-15)
Re: What is the meaning of an expression? matt.timmermans@gmail.com (matt.ti...@gmail.com) (2022-01-15)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-16)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-17)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-18)
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-18)
Re: What is the meaning of an expression? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-01-19)
Re: What is the meaning of an expression? 0xe2.0x9a.0x9b@gmail.com (Jan Ziak) (2022-01-19)
Re: What is the meaning of an expression? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-01-19)
Re: What is the meaning of an expression? tkoenig@netcologne.de (Thomas Koenig) (2022-01-19)
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-19)
Re: What is the meaning of an expression? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-01-20)
[3 later articles]
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Tue, 18 Jan 2022 15:18:51 -0800 (PST)
Organization: Compilers Central
References: <AdgJPKhi/NiNfECvRNaA6+4Wq/M8OQ==> 22-01-052 22-01-060 22-01-066 22-01-067
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="54647"; mail-complaints-to="abuse@iecc.com"
Keywords: optimize
Posted-Date: 18 Jan 2022 21:38:18 EST
In-Reply-To: 22-01-067

(snip, and our moderator wrote)


> [If you go back the the start of the thread, someone asked about
> a statement that "The meaning of an expression is the value of the expression."
> I suppose we could ask what it means to a compiler but that seems awfully
> anthropomorphic. -John]


This is reminding me too much about the episodes of Star Trek
where Kirk and Spock have to destroy a computer. (None of which
ever seem to have a compiler.)


They give a logical inconsistency, which the computer works
on for a while, until smoke comes out and we know it is dead.
(And the computers always talk, making the anthropomorphising
easier.)


As for actual compilers, what do they do with logical inconsistencies?


As above, normally they should just compile what they are given,
and not try to actually process it. But more and more compilers optimize
code, which means (often enough) that they do processing that would
otherwise be done at run time.


My favorite optimization story, which I heard many years ago when it
was already old, is from the OS/360 Fortran H days. It seems that
there was a popular Fortran benchmark program that evaluated
some very complicated expression, mostly with the use of statement
functions. (The sometimes useful, but now deprecated Fortran
feature.) Fortran H expands statement function inline (it seems
unlike others at the time.)


The result of this, was that the compiler evaluated the
whole complex expression at compile time (very slowly),
and printed the result at run time (very quickly).


So, back to anthropomorphic computers and logical
inconsistencies. How good are compilers, especially ones
that evaluate constant expressions at compile time, at
dealing with logic failure? And especially, as the question
needs, expressions that don't have a value?


Post a followup to this message

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