Re: technology discussion → does the world need a "new" C ?

Liste des GroupesRevenir à l c 
Sujet : Re: technology discussion → does the world need a "new" C ?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.c
Date : 08. Jul 2024, 01:02:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240707164747.258@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-07, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
On 7/7/24 16:10, BGB wrote:
On 7/7/2024 9:03 AM, James Kuyper wrote:
On 7/7/24 00:55, BGB wrote:
On 7/6/2024 5:38 PM, Keith Thompson wrote:
...
No, there is no implicitly defined pointer.
...
This implicit pointer need not exist at a location in memory...
>
Which is why C doesn't give you access to it's location in memory -
something you complained about earlier.
>
I don't think I was claiming that one should have direct access to its
location or value within the language, rather that their existence and
behaviors could be acknowledged in the language design (for a "not
quite C" language).
>
I think that the existence of an implicit pointer would be a bad thing
to acknowledge, given that the language doesn't require that it exist,
and typical implementations don't use them. From what I understand, the
fact that your implementation does have implicit pointers makes it a rarity.

Ritchie's B language had arrays which contained a pointer to their
first element. Via a hack, it was possible to relocate an array.

In C, such a thing is not simply not required; it is ruled out
by the detailed semantic description of arrays.

The entire representation of an array of size N elements of type
T is contained in the memory block that is sizeo(T)*N bytes wide.

If you copy that block, you have a fully functional copy of the array.
No extra pointer needs to be set up with the correct value.

Furthermore, to dynamically allocate an array, you need only
provide sizeof(T)*N bytes of storage, and not a bit more.

There is simply nowhere in the representation of an array where
a pointer could hide that is part of the representation.

Code that manipulates arrays can be translated into something that
calculates a pointer. So a pointer can exist at run time, in a transient
way, perhaps in a register. That register can even be spilled into
memory. However, that's just part of the state of an evolving
calculation, not part of the representation of the array.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
5 Jul 24 * Re: technology discussion → does the world need a "new" C ?305BGB
5 Jul 24 +* Re: technology discussion → does the world need a "new" C ?2Lawrence D'Oliveiro
5 Jul 24 i`- Re: technology discussion → does the world need a "new" C ?1yeti
15 Jul 25 +- 
5 Jul 24 `* Re: technology discussion → does the world need a "new" C ?26bart
5 Jul 24  +- Re: technology discussion → does the world need a "new" C ?1BGB
6 Jul 24  `* Re: technology discussion → does the world need a "new" C ?24Lawrence D'Oliveiro
6 Jul 24   +* Re: technology discussion → does the world need a "new" C ?17Keith Thompson
6 Jul 24   i+- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
6 Jul 24   i`* Re: technology discussion → does the world need a "new" C ?15Lawrence D'Oliveiro
6 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Ben Bacarisse
6 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
7 Jul 24   i +* Re: technology discussion → does the world need a "new" C ?10James Kuyper
10 Jul 24   i i`* Re: technology discussion → does the world need a "new" C ?9Lawrence D'Oliveiro
10 Jul 24   i i `* Re: technology discussion → does the world need a "new" C ?8James Kuyper
11 Jul 24   i i  `* Re: technology discussion → does the world need a "new" C ?7Lawrence D'Oliveiro
11 Jul 24   i i   +* Re: technology discussion → does the world need a "new" C ?2David Brown
11 Jul 24   i i   i`- Re: technology discussion → does the world need a "new" C ?1Malcolm McLean
11 Jul 24   i i   +* Re: technology discussion → does the world need a "new" C ?3bart
11 Jul 24   i i   i`* Re: technology discussion → does the world need a "new" C ?2Chris M. Thomasson
12 Jul 24   i i   i `- Re: technology discussion → does the world need a "new" C ?1Chris M. Thomasson
11 Jul 24   i i   `- Re: technology discussion → does the world need a "new" C ?1James Kuyper
7 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
25 Aug 24   i `- Re: technology discussion ? does the world need a "new" C ?1dave thompson 2
6 Jul 24   +- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
6 Jul 24   +- Re: technology discussion → does the world need a "new" C ?1James Kuyper
6 Jul 24   `* Re: technology discussion → does the world need a "new" C ?4bart
7 Jul 24    `* Re: technology discussion → does the world need a "new" C ?3Keith Thompson
7 Jul 24     `* Re: technology discussion → does the world need a "new" C ?2bart
7 Jul 24      `- Re: technology discussion → does the world need a "new" C ?1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal