Sujet : Re: Top 10 most common hard skills listed on resumes...
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.lang.cDate : 05. Sep 2024, 17:21:01
Autres entêtes
Organisation : To protect and to server
Message-ID : <vbci8r$1c9e8$1@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
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. This is quite visible at low level, where typical
machine has 'store' instruction. Store takes address (memory location)
as left argument, but a _value_ as right argument. Your example
introdices fake symmetry, you ealuate right hand side using
a load ant this may look symmetric with store. But even here
there is asymetry, which is better visible with naive compiler.
You may get code like
compute addres of A
load
compute address of A
store
The last step implement '=', the second 'compute address' corresponds
to A on the left had side. First 'compute address' corresponds to
A on the right hand side. Now you see that beside address computation
there is also load corresponding to A on the right hand side.
So clearly in most languages treatment of sides is assymetric:
extra loads are inserted due to 'lvalue convertion'.
To put in more general context: early success of C was related
to exposing address computations, so that programmers could
do optimization by hand (and consequently non-optimizing compiler
could produce reasonably fast object code). This has a cost:
need for explicit point dereferences not needed in other langiages.
Bliss went slightly further and requires explicit derefernces
to get values of variables. My point is that this is logical
regardless if you like it or not.
-- Waldek Hebisch