C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] C trap representations and unspecified values versus C++ indeterminate values

From: Freek Wiedijk <freek_at_[hidden]>
Date: Sat, 10 Oct 2020 13:49:50 +0200
Dear all,

This seems to be the DR451 discussion about "wobbly values"
all over again.

I think that having a memory model decorated with effective
types, provenance, wobbliness, and what other decorations
one can invent, is not the most elegant approach. I'm all
for Peter's attempt to get the C standard precise (it
currently isn't), and very much want to support him in this.
But I don't like the specific proposal of the provenance
study group. I think it's much too hacky.

I would expect that having a two layer model, in which
one has an abstract memory model (where values are typed
and abstract, and in which "uninitialized" is one of the
possible values, with undefined behavior if you want to
use it) and a concrete memory model (in which the values
consists of "object representations", i.e., of a sequences
of bytes) has much more potential. In such a model those
two layers should be updated simultaneously and be kept in
sync all the time, where one side of the model model can
use information from the other side if it needs it.

Then the effective types, provenance, wobbly values, etc.,
would just be that the abstract model has precedence,
and the concrete memory model only comes into play if
the abstract model doesn't have enough information, and
therefore these notions would not be needed anymore.

I think there is a Korean memory model that is a bit like that?

Freek

Received on 2020-10-10 06:49:55