🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1889

Re: C and its present 'ancestors'

#1889
From: Ross Finlayson
Date: Fri, 27 Nov 2026 15:55
413 lines
21731 bytes
On 11/27/2026 06:57 AM, Ross Finlayson wrote:
> On 11/26/2026 01:46 PM, fir wrote:
>> Ross Finlayson pisze:
>>> On 11/26/2026 12:08 PM, fir wrote:
>>>> Ross Finlayson pisze:
>>>>> On 11/26/2026 08:09 AM, Bonita Montero wrote:
>>>>>> Am 26.11.2026 um 16:02 schrieb Ross Finlayson:
>>>>>>
>>>>>> You’re jumping from one topic to another—going off on tangents.
>>>>>> I’m pretty sure I can’t follow you. I mean, I can follow what
>>>>>> you’re saying, but I’m wondering how it fits into the context
>>>>>> you’re responding to.
>>>>>>
>>>>>>> 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.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> Hello. It's not much speaking to "C and its present ancestors",
>>>>> (not, "C and its peasant ancestors") except about the "natural" these
>>>>> days I guess they're calling it "mechanical sympathy" or
>>>>> "close-to-the-hardware", yet also that there's the process & thread
>>>>> model and the heap & stack model, "systematic sympathy", if C was
>>>>> "declarative flow-of-control, close to the hardware", that what's
>>>>> involved about state & scope is also about the process & thread and
>>>>> stack & heap.
>>>>>
>>>>>
>>>>> So, the usual account of dynamic allocation of textual data or
>>>>> strings,
>>>>> or bytes, here calling "unsigned char" byte_t and "signed char" char_t
>>>>> since those are un-used and probably will be un-used forever in C and
>>>>> C++ themselves, about the implicits according to _types_ in C and C++
>>>>> (or, "C/C++" when the same code is hidden inside "__cplusplus"), then
>>>>> is about _types_ in C, and adding only a few types to the language,
>>>>> that are fixed-size, yet quite large than a register word, and usually
>>>>> accounts of multiples of cache-line size (LINE_SIZE, here when it's
>>>>> "64B
>>>>> these days, 32B not so long ago, often in pairs of cache-lines 128B,
>>>>> yet
>>>>> pretty much about 64B), for cache-coherency, page size (PAGE_SIZE, the
>>>>> system's account of the memory page, mostly 4Kib),
>>>>> then that char_t and byte_t are according to the least-addressible
>>>>> memory location, line-size the least-granular cache-content, and
>>>>> page-size the least-granular virtual memory page used for all
>>>>> purposes,
>>>>> these then being natural "types" according to C.
>>>>>
>>>>>
>>>>> So, any of these, is an integer multiple of the smaller ones,
>>>>> basically
>>>>> making for "slab allocators" the usual enough account, with that about
>>>>> 5% of the lines in the page are housekeeping, rest data, about 64B and
>>>>> 4KiB or 4096B, vis-a-vis, 8B the 64b register-word, and the calling
>>>>> convention of the preserved and scratch registers and what the
>>>>> convention says to do.
>>>>>
>>>>> It's figured that these types according to the processor's "RAM"
>>>>> the LINE_SIZE and system's "RAM" the PAGE_SIZE, are always going
>>>>> to be so, not change for a generation and a half, and otherwise
>>>>> are parametric and parameters, i.e. constants.
>>>>>
>>>>>
>>>>>
>>>>> So, there's an idea to use "*=" and "/=", like "multiply" like "copy"
>>>>> or "divide" like "carve", to make allocation first-class in terms
>>>>> of what were called "glo-calls", globals to process & thread,
>>>>> vis-a-vis,
>>>>> "sys-calls", like malloc & free, or here mostly about alloc_aligned &
>>>>> free, figuring never to call malloc ever again,
>>>>> except that user code can do what it wants since programmer's intent.
>>>>>
>>>>>
>>>>>
>>>> i asked chat gpt what youre talkin about (you see to be definitely my
>>>> team here, needed artifical intelligence as a translator ) and it
>>>> told me
>>>> that you want to heve something like struight acces from code to cache
>>>> lines, ram pages etc but imo it is probably "noob dream" same as
>>>> using arithmetic for strings
>>>>
>>>> cache is overally overhyped probably i sometimes measure my loops/codes
>>>> routines and in all cases i remember it was just all in cache..full
>>>> speed..ths e chache systems just seem to work enough good
>>>>
>>>> maybe if they not giving such kind of commands to cpu would have some
>>>> sense but i doubt if this is present need
>>>>
>>>> hovever some serious logical work on multithreading probably is to be
>>>> done (im not sure hovever probably people did a doze of things here and
>>>> i just dont know it)
>>>
>>>
>>> Tell it "material-implication is un-sound, and prohibited,
>>> holistically".
>>>
>>> Accounts of "proximity" and "affinity" about "coherency"
>>> has that there's a difference between "undefined behavior"
>>> and "unspecified behavior", that the processor environment
>>> very well does "specify" how it works by what it is.
>>>
>>> So, when last year I was talking about proximity & affinity & coherency,
>>> it's totally usual and any self-respecting computer-engineer knows all
>>> about it.
>>>
>>> After "alloc_aligned" has that obviously the operating-system with
>>> memory-protection makes no such notion of "touching the cache-lines"
>>> possible, it's a matter of fact though that pretty much the
>>> operating-system doesn't go vending pages of virtual (as it were)
>>> addressed memory at odd offsets (given the granularity of PAGE_SIZE
>>> mostly,
>>> and about HUGE_SIZE simply enough).
>>>
>>>
>>> I'm still quite unsatisfied with "return value optimization" in C++,
>>> then that the alias -> stall -> branch -> call -> fault -less,
>>> is a natural about "systematic sympathy" and "close to the hardware".
>>>
>>>
>>> Then called-code with dynamic-allocation doesn't much care where the
>>> food comes from, as long as it's at least at large as what's requested,
>>> which is small, and non-zero, which means none left. Then usual accounts
>>> of populating containers can simply make for a caller-fulfilled slab.
>>>
>>> It's allocators and for placement new in C++, then pretty simply
>>> about the process & thread the scope & state the sys-calls and
>>> glo-calls.
>>>
>>> The glo-calls: kind of like glow-plugs, that's though for components.
>>>
>>> Glow-plugs: so your diesel isn't jelly.
>>>
>>>
>> your stories sadly have not much potential to be answered... normally
>> you state some things to adress or answer some problem etc..there is a
>> variety of
>> writing styles but the one you use rather makes some mental
>> dissotiation... i find it rather ositive though not everybody would like
>> it i guess ;c weak potential on answet weak potential for conclusions
>> (yawn)
>>
>
>
>
>
>
>
> I watched a decent video the other day, James Faure's on "Rust ...",
> it helps describe some of these ideas talked about here,
> like "with-function, region-allocators, and fractional-ownership".
> It's at once calm in demeanor yet plain in opinion, and informed
> in relevance. Stroustrup had a good video the other day on
> "Profiles...", I enjoy that guy.
>
>
> One might consider there are two kinds of processes | threads,
> alike long-lived | short-lived, then about that long-lived processes
> basically can manage memory for short-lived processes, and the
> functions and even with the blocks that they have, about the stack,
> LIFO, last-in-first-out, of the execution, FIFO, first-in-first-out. So,
> these are basically "inversions", yet the same world, that LIFO is
> the way functions are entered and exited, while the entries and
> exits are alike FIFO in their encounter.
>
> So, when a function figures that the functions it calls will need
> some memory, particularly for long-running processes or the
> body of the inner routines, when there's room on the stack-segment
> of RAM as it would be, it makes some sense to allocate a large-ish
> buffer for smaller-ish buffers. Then, carving that out, managing
> the "fragmentation", has a simple way to simplify that: only doling
> out one-at-a-time, then that it's upon the users to make that their
> algorithms don't get contiguous buffers.
>
> Here for example mostly about text algorithms, then the idea of
> introducing bounds is pretty simple, about "to_string" for built-in
> types, they basically have a common ceiling, then that in the accounts
> of text algorithms of the simple variety, that callee's can carve out
> and re-use a buffer for sequential uses of a buffer, or, carve out and
> return a buffer, by a pointer to it that the caller already allocated.
>
> To keep functions that require buffers from allocating buffers
> themselves, the idea is that the thread|process has a "global call",
> when the first idea is to just reserve some space on the stack,
> like with alloca or just plain fixed-length or variable-length arrays,
> yet being able to fallback to the heap itself or up the stack, about
> basically that a process pages in a "huge" page ("large" sometimes,
> called "huge" here, 2MiB), then for example a called routine can
> carve itself a "page" of that, about 4KiB most places, then about
> basically "short-strings" and "long-strings", or "names | descs" for
> names or descriptions, with the idea that to_string never allocates
> anything itself, then that what it returns, gets replaced in the larger
> slab that it was from, after it's consumed, for example when it's used
> to format log lines or metrics lines, or otherwise concatenating
> strings, to where the buffers are discardable, then that when the
> function returns that carved a buffer to be sub-carved into buffers, for
> that to roll-up the stack, since any function that calls for an
> allocate1 has allocate1 can simply check the address of the function on
> the stack, and considered reclaim-able everything beneath it, beneath
> the bar, as it were.
>
>
> Then, about long-lived and short-lived objects, basically the idea
> is that the short-lived objects should leave directly near the calling
> function, then about long-lived objects, basically about the stack &
> heap (and, you know, storage), is basically for a simple account of
> formatters and converters what need buffers, and for example servers
> that handle packets or for example flat-files with line-data the
> records, that in accounts of serial routine, to hide all the
> declarations of char buf[16384], and to separate the concerns, while
> providing for the concerns.
>
>
> Then, the "fractional-ownership" bit basically is whether a buffer is
> consumed and passed down, i.e., discardable when the function
> returns, or, preserved and passed up, i.e. returned, then that when
> the calling function returns, about how to make it automatic, that
> basically a "with-function" wraps that, so that all the allocations
> actually drive memory-management-maintenance, then about then
> when inevitably some user code will request too much, side-loading
> that to the heap (again in "increments of allocate1"), then each those
> defining ranges in the process' memory address space with with to
> replace or reclaim the buffers.
>
>
>
> So, this kind of thing, ..., it's a bit of a hybrid approach, between
> caller-allocate and callee-allocate, with the idea that of course
> it's to be re-entrant (thread-safe), then about various considerations
> of that it's more appropriate when there are "fewer" threads or "dinos"
> than "many" threads or "wasps", yet still kind of the same kind of
> account, then that also it's sort of simple to make for locators and so
> on, how to detect more-or-less automatically from when a function
> returns that all its carvings were returned, besides that it doesn't
> much care since it's all reclaimed, figuring that the passed buffers are
> never passed to another thread in the same process space.
>
>
> Then, with that being about these "glo-calls", like about allocation
> and formatting and emitting logs and metrics, serialization &
> deserialization, and usual things that happen in simple accounts of
> "business logic", then making these things modular & testable has its
> own benefits.
>
>
> About the sizes, or the parameters and the parameters as it were,
> then besides LINE | PAGE | HUGE, also gets into the calling convention
> of functions themselves, about how big of a struct can be passed or
> returned by value, for example IABI = 16 and OABI = 16, or as it varies,
> where then the "buffers" are even fungible as "values". Mostly though
> it's about building the sizes of arrays, and objects according to
> sizeof, that are bigger than the built-ins, with their usual sizeof <= 8
> on 64-bit, for example about uint`128_t, yet moreso for something like
> fixed-point, about things like timespec and currency values.
>
>
>
>
>
>
>
>
> These kinds of things, ....
>
>
>
>
>


Of course anything text involved in a wide world of many languages,
has a usual account in one with:

character-sets, system
character-sets, wire
character-set-encodings, system
character-set-encodings, wire
locales and formatting and precision and scale
date formats, quite varied
that leading zero in front of hexadecimal literals
units and markers
char and wchar and int and the system interfaces
"iconv and lconv and ICU and the Unicode Database"

then that accounts like "printf" and "I/O streams and friends" basically
make for "varargs is to be avoided in a safer profile of C" and "the
data type and formatting should live in type-safety with formatters",
then basically with an idea like that string-formatting occurs in sorts
layers instead of the glom, then about whether those are branch-y and
buffer-y, that yet both the code and data gets hot in the cache, and
according to "types" usual languages can erase branches.




This is just for text, for things like "varchar(64)" vis-a-vis
"varchar(2000)" or "clob", euh, then that buffers usually and the most
common use-case in the world of compression and encryption involves RAM
& CPU for compression and CPU and some moving parts for encryption.


It's rather obvious counter-claims to these sorts, for example,
"that's using a bunch more of wasted buffers, and all the formatting
should happen in one function instead of building in layers then
that those functions get involved swapping their buffers",
and it's like, yeah, they do, which are then immediately discarded.

Then, with the idea of always-layered functions for formatting
or "to_string" and then separately "from_string", and about
swapping buffers, is the idea then about when there's the carving
of the buffers, and a few are left over, exchanging the buffers,
so that the larger block is exchanged for a few specific extra buffers
and some copies, releasing the responsibility of the larger block.


Technical Details
Message-ID: <XmqdnSx9b-NhOpT2nZ2dnZfqn_Rj4p2d@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!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> <11e9lje$qt1s$1@raubtier-asyl.eternal-september.org> <tJqcnayyjasu_JX2nZ2dnZfqnPGdnZ2d@giganews.com> <11ea3jv$10vim$1@dont-email.me> <ZH2dne2SrZrIOZX2nZ2dnZfqn_SdnZ2d@giganews.com> <11ea9c3$13cd0$1@dont-email.me> <7KScnTZkpcvyB5T2nZ2dnZfqnPFi4p2d@giganews.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!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 27 Nov 2026 15:55:40 +0000
Subject: Re: C and its present 'ancestors'
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>
 <11e9lje$qt1s$1@raubtier-asyl.eternal-september.org>
 <tJqcnayyjasu_JX2nZ2dnZfqnPGdnZ2d@giganews.com>
 <11ea3jv$10vim$1@dont-email.me>
 <ZH2dne2SrZrIOZX2nZ2dnZfqn_SdnZ2d@giganews.com>
 <11ea9c3$13cd0$1@dont-email.me>
 <7KScnTZkpcvyB5T2nZ2dnZfqnPFi4p2d@giganews.com>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Fri, 27 Nov 2026 07:55:26 -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: <7KScnTZkpcvyB5T2nZ2dnZfqnPFi4p2d@giganews.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <XmqdnSx9b-NhOpT2nZ2dnZfqn_Rj4p2d@giganews.com>
Lines: 413
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-2udKYauzWnEpz98+rLafepiRavDec9LcrF6LsVebxJvw+MRBQIeXb8CovaOZ11Q2OzIxhZvtU9llwxi!UGYazyGIEgSJRj8mc19MsOxElxiLqByd/NVrfzmqZYU71ekem/GRr0fTMn5pTfByArqNgXOxQ33L
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