Sujet : Re: technology discussion → does the world need a "new" C ?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 11. Jul 2024, 19:27:21
Autres entêtes
Organisation : None to speak of
Message-ID : <87r0bzu6ly.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
[...]
I've stated several times now that the type system on my systems
language is simple, consistent and orthogonal. Parameter passing is
consistent from the language POV (despite the efforts of the ABI).
Your personal language might be the best thing since sliced bread, but I
fail to see how it's relevant here.
C's on the other hand, especially combined with its parameter passing,
is a fucking mess. Everyone here secretly knows that; I don't know
what they're trying to gain from pretending otherwise, and trying to
put the blame on people who are calling it out.
Nobody is keeping any secrets. I agree that the way C treats arrays and
pointers is a mess. But it's a *consistent* mess, and once you
understand it, it's not as difficult to work with as you pretend it is.
Nobody is blaming you for pointing out that C's type model has problems,
or that there could be better ways to do it. Most of us agree with you
on that. You're being blamed for spreading misinformation, and for
describing C in the most confusing and insulting terms possible.
I have repeatedly *described* how C works. I rarely *defend* it other
than to correct inaccurate statements. You insist on describing it
incorrectly, pretending that "arrays are passed by-reference", even in
the face of repeated demonstrations that they are not.
And the frustrating thing is that I'm sure you understand all this.
Someone who tries to learn C from your posts would think that arrays can
be passed as parameters, and that they are passed by reference, unlike
all other data types which are passed by value -- ah, but passing by
reference loses bounds information, and applying sizeof to an array
parameter doesn't do the obvious thing for some vague reason that's the
fault of C being a poorly designed language, and yours is so much
better.
None of that is true (though the "poorly designed" part is arguable and
I have no opinion on your language).
Isn't it better to understand the language as it's actually defined?
Have you ever tried to describe it accurately in its own terms?
Ada (a non-C language I happen to be familiar with) treats arrays very
differently. Indexing is not defined in terms of pointers. Array
parameters are really arrays, and implicitly carry bounds information.
Arrays can be assigned, with a run-time exception being raised if the
bounds don't match. None of this is true of C.
And I'll ask you again, have you read section 6 of the comp.lang.c FAQ?
It probably won't tell you anything you don't already know, but it's
correct, well written, and inconsistent with what you've been saying
here.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */