🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2013

Re: C and its peasant 'ancestors'

#2013
From: Ross Finlayson
Date: Mon, 30 Nov 2026 09:48
112 lines
6823 bytes
On 11/29/2026 06:25 PM, Dan Cross wrote:
> In article <11eij2a$hq5$1@kst.eternal-september.org>,
> Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
>> cross@spitfire.i.gajendra.net (Dan Cross) writes:
>>> In article <11eieib$3v2hj$1@kst.eternal-september.org>,
>>> Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
>> [...]
>>>> I'm not aware that there's any widely accepted definition of
>>>> "strongly typed".  And I would argue that "strong typing" cannot
>>>> be measured along a single continuum, with "weakly typed" languages
>>>> at one end and "strongly typed" languages at the other.  One language
>>>> might have strong typing enforced at run time; another might have
>>>> weak typing enforced at compile time.
>>>
>>> No, these terms of art that are, as I understand it, fairly well
>>> understood in the PL community.  Generally, "strong typed" means
>>> "no implicit conversions", and "statically typed" means "types
>>> are known at compile time."
>>
>> You may well be right about that.  On the other hand, I think there
>> are a lot of people who don't use the terms that way, and some of
>> them participate in discussions like this one.  (I'm not referring
>> to anyone in particular.)
>
> Perhaps; I'm not in anyone else's head so I don't know how they
> conceptualize these things, but programming languages are a
> domain within computer science (actually, I suppose within the
> intersection of a few different fields) and domain nomenclature
> has meaning within that domain.
>
> It is fine not to know the nomenclature; it is not fine to say
> that it means something different with respect to the domain
> because someone is not deeply immersed in the field.  And I say
> that as someone who is not a PL person: I'm an OS person.
>
>> In the particular case of "hello" + 1 being valid in C, there are
>> two things going on.  One is the implicit conversion of the array
>> expression "hello" to a pointer expression; that's weak typing.
>> The other is the existence of a + operator that takes pointer and
>> integer operands; that's just a weird operator, no more weakly
>> typed than Pythons "foo" * 3" or Perl's "foo" x 3.
>
> I'd put the whole thing in C more succinctly: it's an accident
> of history.  B had no types other than a "word"; memory was
> viewed as an array of words.  As Dennis Ritchie put it in his C
> history paper from HOPL III,
>
> |Because pointers in BCPL and B are merely integer indices in
> |the memory array, arithmetic on them is meaningful: if `p` is
> |the address of a ceil, then `p + 1` is the address of the next
> |cell.  This convention is the basis for the semantics of arrays
> |in both languages".
>
> He goes on to explain what `auto V[10]` means as a result:
>
> |...a cell named `V` is allocated, then another group of 10
> |contiguous cells is set aside, and the memory index of the
> |first of these is placed into `V`.  By a general rule, in B,
> |the expression `*(V + i)` adds `V` and `i`, and refers to the
> |`i`-th location after `V`.  Both BCPL and B each add special
> |notation to sweeten such array accesses; in B, an equivalent
> |expression is `V[i]`....
>
> The rest is literally history.
>
> https://dl.acm.org/doi/epdf/10.1145/234286.1057834
>
>> A digression: I'm not happy that C's array-to-pointer conversion is
>> referred to as a "conversion".  It's not like other type conversions.
>> An ordinary type conversion is an operation (either performed
>> implicitly or specified by a cast operator) that takes an operand of
>> some type, and the result depends only on the *value* of the operand.
>> It notionally happens at run time, but can sometimes be optimized
>> to occur at compile time.
>>
>> The array-to-pointer conversion could more accurately be described as
>> a compile-time *adjustment*, similar to the array-to-pointer parameter
>> adjustment (for which the standard does use the word "adjusted").
>>
>> Likewise for function-to-pointer conversions.
>
> To be provocative, I think it is easier to conceptualize if one
> thinks of C as lacking first-class array types.  Rather, C has
> pointers to contiguous regions of memory of some size; the
> array-like notation is just syntactic sugar around this.
>
> Btw, in the Q&A transcript at the above link, Ritchie says this
> when asked about C declaration syntax:
>
> |It was Ravi Sethi who observed that if C's unary star operator
> |were a postfix operator instead of a prefix operator, suddenly
> |everything becomes nice and linear and clear.
>
> (Now excuse me, I am ducking and running for cover....)
>
> 	- Dan C.
>

That's one of the problems or ambiguities of C the
East/West of the pointers vis-a-vis the qualifiers,
here with "pointers West, qualifiers East", and that
the pointers always go on the type when they're declared
not when they're referenced thusly on the value, since
nobody needs to write "int a, *pa" when they can write "int a; int* pa",
then that const should pick a side basically for having
qualifiers after so they're not ambiguous in the middle.

A pointer in a declaration is not an operator, it's a type-modifier.
(Any conflict with the actual standard these terms would be un-intended.)


Technical Details
Message-ID: <2nGdnVnB270R25D2nZ2dnZfqnPSdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11dup6q$v4j9$1@dont-email.me> <11eieib$3v2hj$1@kst.eternal-september.org> <11eifmr$4dk$1@reader2.panix.com> <11eij2a$hq5$1@kst.eternal-september.org> <11eimr1$4c3$1@reader2.panix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 30 Nov 2026 09:49:00 +0000
Subject: Re: C and its peasant 'ancestors'
Newsgroups: comp.lang.c
References: <11dup6q$v4j9$1@dont-email.me>
 <11eieib$3v2hj$1@kst.eternal-september.org> <11eifmr$4dk$1@reader2.panix.com>
 <11eij2a$hq5$1@kst.eternal-september.org> <11eimr1$4c3$1@reader2.panix.com>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Mon, 30 Nov 2026 01:48:56 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <11eimr1$4c3$1@reader2.panix.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <2nGdnVnB270R25D2nZ2dnZfqnPSdnZ2d@giganews.com>
Lines: 112
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-RWapZwuC+UH7NWm1YRW0R6r8DEX4GxEXGuHTk9x1lwsNkZAcaFaoWd1AAcDDeCNbe6zwDnLNps9PWi4!LxCXPUmzR02k2sEU92WxU3vvJqnbqL7E8C2yqotB32LeWBNKHaojwWp1TRqBB5KFbV4UkFKvjApD
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40