🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1869

Re: C and its pesent 'ancestos'

#1869
From: Ross Finlayson
Date: Thu, 26 Nov 2026 15:38
230 lines
12360 bytes
On 11/26/2026 07:02 AM, Ross Finlayson wrote:
> On 11/26/2026 02:10 AM, Bonita Montero wrote:
>> Am 26.11.2026 um 11:02 schrieb fir:
>>
>>> btw, no one understand the neccsity of
>>>
>>> int tab[100];
>>>   tab.length*=3;
>>
>> In C++ you dont' have to do that. In C++ you simply use emplace_back
>> and let the templated runtime to the growing of the capacity. No need
>> to handle with pointers yourself. And accessing the contents of a
>> container is bounds-checked while debugging (optional with libstdc++,
>> default with VC++).
>>
>>> classic c arrays but bused on realloc internally and thus being able
>>> to be resized freely (i already made tham in my own compiler
>>> (unfinished)
>>> ) you just emit calls to reallock when you meed those reallocking
>>> cyntaxes
>>
>> In C++ the contained values of a vector could have an arbitrary type and
>> if the values are moveable a resize is very cheap. Doing this in C is a
>> magnitude more work.
>>
>>> void EmitResizeFromEax(chunk name)
>>> {
>>>                FlushOutAsm("\n push eax" );
>>>
>>>                FlushOutAsm("\n push eax" );
>>>         FlushOutAsmChunkPE("\n  push (", name, ") ");
>>>                FlushOutAsm("\n   call (\"msvcrt.dll\"->realloc)");
>>>         FlushOutAsmChunkPE("\n    mov (", name, ") eax ");
>>>                FlushOutAsm("\n     pop edx");
>>>                FlushOutAsm("\n      pop edx");
>>>         FlushOutAsmChunkPE("\n       mov (", name, ") eax ");
>>>                FlushOutAsm("\n      pop eax");
>>>         FlushOutAsmChunkPE("\n         mov (", name, "_size) eax ");
>>>
>>>      if(emit_basic_debug_info_for_initial_reallocks)
>>>      {
>>> //          FlushOutAsm("\n    mov eax (__realloc_sum_counter) ");
>>> //          FlushOutAsm("\n    add eax %d", size);
>>> //          FlushOutAsm("\n    mov (__realloc_sum_counter) eax");
>>> //
>>> //
>>> //         FlushOutAsm("\n  push %d ", size);
>>> //         FlushOutAsm("\n   push __reallocked_str_label");
>>> //         FlushOutAsm("\n    call (\"msvcrt.dll\"->printf)");
>>> //         FlushOutAsm("\n     pop edx ");
>>> //         FlushOutAsm("\n      pop edx ");
>>>      }
>>>
>>> }
>>
>> Sick, totally sick !
>>
>>> instead of insane bulshit of c++ containers?
>>
>> They're much easier to handle.
>>
>> You don't trust into abstractions and you would be overburdened with
>> a language like C++ or Rust. These abstractions that do the same thing
>> you do manually in C. Instread you want to flip every bit yourself in
>> C. This leads to more and less readable code.
>>
>
>
> One challenge I'm trying to figure out is basically
> about strings and that strings are variable-length.
>
> So, with basic operations on strings including things
> like "concatenate" and "truncate", then how to deal with
> the buffers is being a thing, where for example languages
> like C++ their standard implementations of basic_string
> for std::string might stuff a "small" string into the object's
> own representation on the stack, otherwise on the heap,
> or for example the data-segment for "constant" strings,
> and including ideas like "string atoms" a.k.a. "string internment".
>
> So, there's the stack and the heap, with regards to things
> like "variable-length-arrays", basically for the strings and
> mostly the algorithms on them like substitution/interpolation,
> and formatting among all the various types, for basically an
> "output" case and an "input" case to algorithms, then to
> result that to all the standard routines it's a "char *",
> so usually.
>
>
> You might think of that as a natural algebraization about
> the usual formal language's account since concatenation
> and the empty string, what operator-overloading "+" makes
> for string vis-a-vis whatever types and formatting them
> to string, and what operator-overloading "-" makes for
> truncation and whatever type is to indicate what/how/where
> is to be truncated, about truncation & concatenation,
> formatters & converters, and operations on strings (or
> for example any other account of growing | shrinking "arrays").
>
>
> Of course C doesn't have "operator-overloading" in the language,
> yet so that concatenate() and truncate() can be given
> function-overloading via _Generic in C, then that it's sort of
> "reverse-reverse
> Polish notation" like as for a usual stack-notation
> operand-operand-operator that it's function-operand-operand of the
> operator, pair-wise.
>
>
> Then, there's * and /, the arithmetic operators, and an idea about
> whether that's to align quite directly with the notion of
> pointer-indirection quite like "+" aligns with concatenation, here though
> basically to make for assignment-targets and the scope & state,
> that what enters-scope and embodies-state in block-scope then
> function-scope then globals by being reference-able, about what
> "*" and "/" can mean, or for example "*=" and "/=", about basically
> what makes for in-parameters and out-parameters, these kinds of
> things, and not exactly like move semantics, instead basically
> into-the-stack or offto-the-heap, as it were.
>
>
> About then "natural" "algebraizations" about the syntax of the
> language and its cousin(s), here is about concepts like "seating"
> the references vis-a-vis "homing" the references, in a language
> like C where there are only _pointers_, that it results for
> type-safety that pointers are furthermore _typed_ as to result
> then for either behaving like "seating" the references in C++,
> or not, when for example the growing | shrinking of the textual
> data, or other accounts of tuples or lists or otherwise "arrays",
> has an entirely different approach that's yet on its own account,
> "natural".
>
>
> The concatenation and truncation, for example, one might aver
> looks like
>
> s += 1
>
> intuitively formats the integer, according to formatters & converters,
> then for example where
>
> s -= 1
> // or
> s -= -1
>
> truncates from the right or left, intuitively then toward the
> "natural" that's what intuitive about the scope & state and
> left/right branching in the procedural language, is "natural"
> in the up/down jumping on the program counter, scope & state
> on the core/CPU, and giant uniform global memory, scope & state
> the RAM, that "scope" and "state" make a stack in the procedural
> definition, and two different things, yet an array and constant block as
> "CPU" or "RAM", the contents, and one thing.
>
>
> So, one may aver that accounts of "typing the pointers" can make
> for example pretty much exactly like C++, or quite entirely different,
> then to result a model of "natural operator overloading" that results
> "plain syntax in what happens to be the arithmetic operators instead
> of the reference operators", arithmetic on scope & state.
>
>
>


It seems like that any account of reasonable performance about
dynamic objects besides what's straight pushed/popped the stack
up to stack-depth-limits, is going to involve abstracting away
and not calling malloc/free or variously new/delete with regards
to allocators, making the process & thread according to accounts
of "globality" of the thread then the process, according to
accounts like "allocators" or "allocations", what pretty much
resolve to free-lists, of like-sized elements, or slabs, to be
carved up of variable length elements, then for the function
to do the maintenance of the slab itself including defragmentation
and basically "reorg" it's called, or "reorganization" of the
data-structure, a usually under-served account of the "cost"
the "total cost including maintenance" of algorithms & data-structures.


Then, for accounts like free-lists and slabs, then for example
whether "arena" is a bit overloaded over time and usually these
days means means "slabs" yet was also "free-lists apiece for
various types", about locality and proximity & affinity when
for example "data local to a routine should be local in memory",
basically is about "typing the memory" as making for accounts
of "these fixed-size arrays of byte_t which is unsigned char,
sized LINE_SIZE, PAGE_SIZE, HUGE_SIZE, and to be aligned also
to LINE_SIZE, PAGE_SIZE, HUGE_SIZE like for alloc_aligned in C
or as carved from the slab or from an array of same", then for
things like NAME_SIZE = 32 with SHORT_NAME = 16 and LONG_NAME = 64
and MAX_NAME being NAME_MAX, then those being char_t as "char*",
when decayed from char[SIZE] fixed-size, is that
placeholder-substitution and formatting & conversion pretty much
universally involves a sufficiently larger bounded region to fit else
truncate the results of formatting & conversion and interpolation &
placeholder-substitution, or most usual textual routines what that
usually according to re-entrancy of routine, the thread-local is safely
holding state to maintain re-entrancy, while, otherwise it's on
the stack the thread's as it were program-stack, when those fit
on the stack and when they don't, and when they can be directly
re-used, vis-a-vis, re-allocated, according to scope & state in
the blocks and functions, about things like move in C++ or that
ridiculous-seeming same-block variable hiding which seems entirely
introducing new variables the same names in Rust, basically about
"I accept this gone" or "I want this back", "in" and "out" params,
then also that usually is "I shouldn't know or care: the functions
work on types with type-safety and whatever works, arithmetic & algebra".


So, the usual account of lifetime and storage about scope & state
and mutability and ownership and all the things like C++ gives
after references and ref-ref or about the universal/forwarding
and that templates and plain-code are two different languages now,
has that that's not the only possible game in town according to
"C", about again these sorts of "natural" accounts, sort of with
regards to the movie "The Natural" yet not so relevant, point
being that the modern many-core NUMA machine, thread-of-control CPU
scope & state and all-memory RAM scope & state, living in a hyper-vised
containerization cluster, really appreciates the
alias-less/stall-less/branch-less/call-less/fault-less, ASBCF-free, then
as with regards CMPEXCH or LL/SC, with the operating system doing
pre-emptive multithreading giving process & thread model, have already
built one.





Technical Details
Message-ID: <VASdnXqtT48Mz5X2nZ2dnZfqn_adnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11dup6q$v4j9$1@dont-email.me> <11e0kde$1jpvu$1@dont-email.me> <11e0r13$1lqm6$1@dont-email.me> <11e0uc0$1mtpv$1@raubtier-asyl.eternal-september.org> <11e7fj4$37l9$1@dont-email.me> <11e8oro$ft4l$1@raubtier-asyl.eternal-september.org> <11e8stp$hajr$1@dont-email.me> <11e8ti0$hhqa$1@dont-email.me> <11e8v24$i2mc$2@raubtier-asyl.eternal-september.org> <11e9045$ihk3$1@dont-email.me> <11e90j7$io87$1@raubtier-asyl.eternal-september.org> <0oSdnUooBKya15X2nZ2dnZfqn_udnZ2d@giganews.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 26 Nov 2026 15:38:56 +0000
Subject: Re: C and its pesent 'ancestos'
Newsgroups: comp.lang.c
References: <11dup6q$v4j9$1@dont-email.me> <11e0kde$1jpvu$1@dont-email.me>
 <11e0r13$1lqm6$1@dont-email.me>
 <11e0uc0$1mtpv$1@raubtier-asyl.eternal-september.org>
 <11e7fj4$37l9$1@dont-email.me>
 <11e8oro$ft4l$1@raubtier-asyl.eternal-september.org>
 <11e8stp$hajr$1@dont-email.me> <11e8ti0$hhqa$1@dont-email.me>
 <11e8v24$i2mc$2@raubtier-asyl.eternal-september.org>
 <11e9045$ihk3$1@dont-email.me>
 <11e90j7$io87$1@raubtier-asyl.eternal-september.org>
 <0oSdnUooBKya15X2nZ2dnZfqn_udnZ2d@giganews.com>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Thu, 26 Nov 2026 07:38:25 -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: <0oSdnUooBKya15X2nZ2dnZfqn_udnZ2d@giganews.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <VASdnXqtT48Mz5X2nZ2dnZfqn_adnZ2d@giganews.com>
Lines: 230
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-yDUC78F7Pd0b+FQUZJUsiRVVOiSJDqiqigHPHi7fc3a8Q0c0aIHGnyZYaNlOTQMv6jCISaiimLKKxkm!R0zF1UDqmkzx1duJAAQvGhqSYo7n95d09i2IwjRDfQHBrrkXON1Hou+dwi6lHHk7GxqiAR4MeKeR
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