Sujet : Re: Top 10 most common hard skills listed on resumes...
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 06. Sep 2024, 12:53:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86cylhngkx.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Bart <
bc@freeuk.com> writes:
On 05/09/2024 16:21, Waldek Hebisch wrote:
>
Bart <bc@freeuk.com> wrote:
>
So what exactly is different about the LHS and RHS here:
>
A = A;
>
(In BLISS, doing the same thing requires 'A = .A' AIUI; while
'A = A' is also valid, there is a hidden mismatch in indirection
levels between left and right. It is asymmetric while in C it
is symmetric, although seem to disagree on that latter point.)
>
You seem to miss the point that assigment operator is
fundamentally assymetic.
>
If you've followed the subthread then you will know that nobody
disputes that assignment reads from side of '=' and writes to the
other.
>
The symmetry is to do with syntax when the same term appears on
both sides of '=', the type associated with each side, and,
typically, the internal representations too.
Maybe it would help if you would stop thinking in terms of the
word symmetry (clearly assignment is not symmetrical) and instead
think about consistency.
In C, the meaning of an identifier or object-locating expression
depends on where it is in the syntax tree. In some places it
means the address of the object; in other places it means the
contents of whatever is stored in the object. Those meanings
are very different; among other things, they have different
types (if one type is 'int' the other is 'int *').
In Bliss, by contrast, the meaning of an identifier is the same
no matter where it appears in the syntax tree: it always means
the address of the object. The meaning is independent of where
the term appears in the input, which is to say the meaning is
consistent from place to place.
In C the meaning is not consistent - in some places it means the
address, in other places whatever is stored at the address.
Considering the point of view of a compiler writer, it's easier
to write a compiler for Bliss than for C. In Bliss, upon seeing
an identifier, always simply put its address in a register. If
an object's value needs to be loaded, there will be a '.' to take
the address produced by the sub-expression and fetch the word
stored at that address. On the other hand, in C, upon seeing an
identifier, the compiler needs to consider the context of where
the identifier appears: on the left hand side of an assignment
it means one thing, in almost all other places it means something
else. There needs to be code in the compiler to decide which of
these two meanings is in effect for the node in question.
Please note that I am making no claim that the Bliss approach is
better than the C approach, or vice versa. My purpose here is to
explain the differences, not evaluate them.