Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2843

Re: What is the meaning of an expression?

Path csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Newsgroups comp.compilers
Subject Re: What is the meaning of an expression?
Date Wed, 19 Jan 2022 09:17:17 -0800 (PST)
Organization Compilers Central
Lines 41
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <22-01-070@comp.compilers> (permalink)
References <AdgJPKhi/NiNfECvRNaA6+4Wq/M8OQ==> <22-01-052@comp.compilers> <22-01-060@comp.compilers> <22-01-066@comp.compilers> <22-01-067@comp.compilers> <22-01-068@comp.compilers> <22-01-069@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8bit
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="40871"; mail-complaints-to="abuse@iecc.com"
Keywords semantics
Posted-Date 19 Jan 2022 14:20:42 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
In-Reply-To <22-01-069@comp.compilers>
Xref csiph.com comp.compilers:2843

Show key headers only | View raw


On Wednesday, January 19, 2022 at 4:13:36 PM UTC+1, Hans-Peter Diettrich
wrote:
> On 1/19/22 12:18 AM, gah4 wrote:
>
> > 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?
> Optimization is a special science. A compiler might evaluate a constant
> expression properly, in the sense that evaluation at runtime might fail
> due to overflows of too narrow types in compiled code.

An analogy: There exist two kinds of compression algorithms: lossy and
lossless. Similarly, there exist two kinds of optimization algorithms. If it
is a lossless optimization algorithm, then any kind of difference between
compile-time evaluation and run-time evaluation is a software bug in the
optimizer. If it is a lossy optimization algorithm, then it should be
sufficiently clearly specified what kind of information is permitted to be
lost during the optimization process.

> > And especially, as the question
> > needs, expressions that don't have a value?
> Aren't these called *statements*?

One could imagine that, as a minimal requirement that has to be fulfilled by
any statement, the "value" of a statement X must include information about
what the next statement is after X is done executing, unless the programmer or
the compiler proves that the statement never terminates by itself.

Back to the original post by Roger L Costello: A problem with both "The
meaning of an expression is its value" and "The semantics of an expression is
the value of the expression" is that some expressions never return a value
because their values aren't computable; we are only able to observe that,
while the expression is being computed/evaluated, it is executing as a
sequence of well-defined steps where each of the steps is known to
evaluate/terminate quickly. If a person adopts the belief that "The
meaning/semantics of an expression is its value" then consequently the person
will later be forced to adopt the belief that it is impossible to know the
meaning of certain kinds of expressions.

-atom

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

What is the meaning of an expression? Roger L Costello <costello@mitre.org> - 2022-01-14 12:15 +0000
  Re: What is the meaning of an expression? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-01-14 18:20 +0000
  Re: What is the meaning of an expression? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-01-15 00:28 +0100
  Re: What is the meaning of an expression? gah4 <gah4@u.washington.edu> - 2022-01-14 17:58 -0800
  Re: What is the meaning of an expression? George Neuner <gneuner2@comcast.net> - 2022-01-15 02:05 -0500
  Re: What is the meaning of an expression? "matt.ti...@gmail.com" <matt.timmermans@gmail.com> - 2022-01-15 06:21 -0800
    Re: What is the meaning of an expression? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2022-02-03 12:50 +0000
  Re: What is the meaning of an expression? Jan Ziak <0xe2.0x9a.0x9b@gmail.com> - 2022-01-16 07:44 -0800
    Re: What is the meaning of an expression? Jan Ziak <0xe2.0x9a.0x9b@gmail.com> - 2022-01-17 15:45 -0800
      Re: What is the meaning of an expression? Jan Ziak <0xe2.0x9a.0x9b@gmail.com> - 2022-01-18 10:03 -0800
        Re: What is the meaning of an expression? gah4 <gah4@u.washington.edu> - 2022-01-18 15:18 -0800
          Re: What is the meaning of an expression? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-01-19 11:54 +0100
            Re: What is the meaning of an expression? Jan Ziak <0xe2.0x9a.0x9b@gmail.com> - 2022-01-19 09:17 -0800
              Re: What is the meaning of an expression? gah4 <gah4@u.washington.edu> - 2022-01-19 14:03 -0800
              Re: What is the meaning of an expression? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-01-20 13:02 +0100
                Re: What is the meaning of an expression? dave_thompson_2@comcast.net - 2022-01-30 22:51 -0500
            Re: What is the meaning of an expression? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-01-19 20:13 +0200
              Re: What is the meaning of an expression? Thomas Koenig <tkoenig@netcologne.de> - 2022-01-22 20:46 +0000
  Re: What is the meaning of an expression? Thomas Koenig <tkoenig@netcologne.de> - 2022-01-19 20:51 +0000

csiph-web