Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
A usual account for example might recount component frameworks,
like COM or XPCOM for example, about the concepts of components,
vis-a-vis, modularity and composability, and, satisfaction of
dependencies, vis-a-vis IPC and RPC, abstraction layers often enough,
then about adapters to dependencies, or as for resources, that
it's a bunch of makefiles with various accounts of conditional includes
and build targets about static and dynamic linking and the toolchain,
with regards to test-harness and runtime-framework and about
metaprogramming when making code generation and boilerplate and so on.
Defining an interface or layer is often enough about groups of functions associated with context-structs to make for lifecycles
of what result alike the pure virtual or abstract or interfaces
in reference to languages like C++, about families of functions
according to the types of their signatures, then as with regards
to componentry rather generally in value-types and interface-types
like "variant" and "queryInterface()", about components that implement multiple interfaces vis-a-vis mostly about "constructing the
object-graph" what makes for separation-of-concerns and composability,
is mostly about modularity and composability.
Then considerations of modularity as for library design affect to
reflect on how to indicate responsibilities of ownership in resources,
for example to hide contract & behavior of resources acquire/release.
What I'm figuring is that basically there is a flat name-space of
functions, there are .h and .c files (and may include "portable
assembler"), and there is the compiler-toolchain, and make or
build-scripts. Since there are only functions then dependencies their references would basically live in structs (in structs, in structs, ...,
of function pointers), much like languages with classes and their
instances objects and subclassing overriding behavior keeping in
contract, about how to define "runtime-module" vis-a-vis "source module"
(.o files after compilation-units), about conditional-includes
and conditional-builds vis-a-vis name-mangling or the conventions of
symbols.
What, whither, when, how?
Hello, dear C experts, I'm hoping you can tell me a story aboutWorks magnitudes better in C++ with std::function<> and generic
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Ross Finlayson pisze:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
A usual account for example might recount component frameworks,
like COM or XPCOM for example, about the concepts of components,
vis-a-vis, modularity and composability, and, satisfaction of
dependencies, vis-a-vis IPC and RPC, abstraction layers often enough,
then about adapters to dependencies, or as for resources, that
it's a bunch of makefiles with various accounts of conditional includes
and build targets about static and dynamic linking and the toolchain,
with regards to test-harness and runtime-framework and about
metaprogramming when making code generation and boilerplate and so on.
Defining an interface or layer is often enough about groups of functions
associated with context-structs to make for lifecycles
of what result alike the pure virtual or abstract or interfaces
in reference to languages like C++, about families of functions
according to the types of their signatures, then as with regards
to componentry rather generally in value-types and interface-types
like "variant" and "queryInterface()", about components that implement
multiple interfaces vis-a-vis mostly about "constructing the
object-graph" what makes for separation-of-concerns and composability,
is mostly about modularity and composability.
Then considerations of modularity as for library design affect to
reflect on how to indicate responsibilities of ownership in resources,
for example to hide contract & behavior of resources acquire/release.
What I'm figuring is that basically there is a flat name-space of
functions, there are .h and .c files (and may include "portable
assembler"), and there is the compiler-toolchain, and make or
build-scripts. Since there are only functions then dependencies their
references would basically live in structs (in structs, in structs, ...,
of function pointers), much like languages with classes and their
instances objects and subclassing overriding behavior keeping in
contract, about how to define "runtime-module" vis-a-vis "source module"
(.o files after compilation-units), about conditional-includes
and conditional-builds vis-a-vis name-mangling or the conventions of
symbols.
What, whither, when, how?
this is not a large group and stating such soecific and wide question
you minimalise the chance of answers to it to nearly zero
you can enentually "answer to yourself" (as some say i do? well if i
state question and some cant answer it after some time i myself may
answer it) - though im usually not answering my own questions
(sometimes) but simply "adding" more thoughts to prewious ones
(which is qute good coz articles splitted on more parts ere better)
fir pisze:
Ross Finlayson pisze:overally people seem to ba rather weak in answering some more 'meta' questions (which is not strightforward as in the net (articles etc) i sometimes see lile people would be interested in meta topic to,
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control >>> and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
A usual account for example might recount component frameworks,
like COM or XPCOM for example, about the concepts of components,
vis-a-vis, modularity and composability, and, satisfaction of
dependencies, vis-a-vis IPC and RPC, abstraction layers often enough,
then about adapters to dependencies, or as for resources, that
it's a bunch of makefiles with various accounts of conditional includes
and build targets about static and dynamic linking and the toolchain,
with regards to test-harness and runtime-framework and about
metaprogramming when making code generation and boilerplate and so on.
Defining an interface or layer is often enough about groups of functions >>> associated with context-structs to make for lifecycles
of what result alike the pure virtual or abstract or interfaces
in reference to languages like C++, about families of functions
according to the types of their signatures, then as with regards
to componentry rather generally in value-types and interface-types
like "variant" and "queryInterface()", about components that implement
multiple interfaces vis-a-vis mostly about "constructing the
object-graph" what makes for separation-of-concerns and composability,
is mostly about modularity and composability.
Then considerations of modularity as for library design affect to
reflect on how to indicate responsibilities of ownership in resources,
for example to hide contract & behavior of resources acquire/release.
What I'm figuring is that basically there is a flat name-space of
functions, there are .h and .c files (and may include "portable
assembler"), and there is the compiler-toolchain, and make or
build-scripts. Since there are only functions then dependencies their
references would basically live in structs (in structs, in structs, ..., >>> of function pointers), much like languages with classes and their
instances objects and subclassing overriding behavior keeping in
contract, about how to define "runtime-module" vis-a-vis "source module" >>> (.o files after compilation-units), about conditional-includes
and conditional-builds vis-a-vis name-mangling or the conventions of
symbols.
What, whither, when, how?
this is not a large group and stating such soecific and wide question
you minimalise the chance of answers to it to nearly zero
you can enentually "answer to yourself" (as some say i do? well if i
state question and some cant answer it after some time i myself may
answer it) - though im usually not answering my own questions
(sometimes) but simply "adding" more thoughts to prewious ones
(which is qute good coz articles splitted on more parts ere better)
but on c.l.c meta questions are rarely answered)
if they will do i mayself would ask:
have you noticed that mess rises in your code/projects ?
what you do with that
for exampel in my rasterizer/3d shooter prototype i read
keys - it comes from wndproc key handler but as code grows larger
damn i got not in memory where given key ich checked
(as its handy and logical to check it close to its functionality,
sometimes it is in general window handling, sometimes its in
hud block, sometimes its in the scene root area sometimes its
in the loop of objests
good luck to finding it
and that is how mess grows
(its maybe not even mess - its maybe things dont fit in my memory
so i must load it, and damn its slow
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Am 12.11.2026 um 18:41 schrieb Ross Finlayson:
Hello, dear C experts, I'm hoping you can tell me a story aboutWorks magnitudes better in C++ with std::function<> and generic
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
function objects. F.e. when using std::find_if, std::sort etc.
C sucks.
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
On 12/11/2026 20:11, Lew Pitcher wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control >>> and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
Or get an AI do to your homework?
Be careful to remove the white-on-white-very-small-font gotcha your
professor doubtlessly put in.
On 11/12/2026 12:11 PM, Lew Pitcher wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control >>> and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
Not at all, meaning, no offense taken.
How about "writing testable code", what are common frameworks
or best practices for "writing testable code" in C.
I'd suggest abstraction and layers and modularity and composability,
and having an inversion-of-control/dependency-injection approach,
a convention moreso than a framework, which pretty much means wrapping
all the standard functions, then about for example having an include
where those are wrapper functions to stub and mock, and another include
where those are macros, or, perhaps, using includes, to point the
include directory for the standard library, into instead what makes
for stubbable/mockable calls to standard library and system functions,
or just leaving the headers alone and linking to modules that aren't
the standard libraries, this being an example of something like
"can't mock strftime", or, for an example.
Then, about the modularity, and pointers (to pointers to pointers
to pointers, ...) to functions, then seems about conventions of
types for typeof and the like about that like anybody else I rely
on the compiler to fail with -Wall and failing on warnings to
catch type errors, ..., has that I want to program to interfaces
and then have objects composable, ..., about using conditions of
the build, to, basically make for test-time targets and run-time
targets, with actually testing the code that goes into the build.
On 2026-11-12 22:15, Ross Finlayson wrote:
On 11/12/2026 12:11 PM, Lew Pitcher wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of
inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes >>>> and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
Not at all, meaning, no offense taken.
Your original post and its intention had been also to me quite
unclear. Here, now, I seem to understand at what you are aiming.
(Disclaimer: my comments are just based on personal experience
in our software developing practice from the 1990's and not some
general accepted opinion or habits.)
How about "writing testable code", what are common frameworks
or best practices for "writing testable code" in C.
Our approach was not to "write testable code" by _adapting_ to
some existing framework. While we had standards and practices how
to design software the _tests followed our software_ (not v.v.).
One exception here was that including dedicated trace records in
our code (that could be activated specifically WRT a module and
in granularity) helped for the test evaluation and regressions.
Then we have to differentiate what tests you have in mind here;
there's various types of tests which require their own principles.
For example; Unit Tests (in our [C++] context mainly classes, in
"C" probably functions or a set of related functions) required
functions that own little test programs would call to verify all
the relevant conditions. We haven't used frameworks that created
the tests but wrote our own dedicated test-functions along with the application functions. For our Component Tests (where components
were in our case software pieces that constitute runtime processes
with a well-defined interface) we wrote stubs that could challenge
the components on the interface levels. Such stubs could operate
some predefined procedures with well-defined input, or arbitrary
data, or be an operator-triggered manual interaction, depending on
the type of the component. Storing all the test input and output
results made regression tests possible. For the Integration Tests I
don't recall the procedures (it was done in a dedicated integration
test group); but they defined and checked the system configuration,
the interoperability (I think!) mostly manually. Malfunctions were
reported back to development accompanied by protocols, traces, and
actual data. The System Tests were checked against the specification documents, and the Acceptance Tests against the requirements specs,
sometimes accompanied by the customers. One aspect yet not listed
was the test of the GUIs; beside manual tests we used tools to do
all that "mouse shoving and clicking". But given that the functional
tests already happened on the automatable interface level in former
stages that was effectively just to check the "UI ergonomy" ("UX")
factors. And, finally, we had our own hierarchical regression test
framework to run and document the tests on each abstraction stage. (Eventually there were also external third-party tools existing but
back then we wrote (had to write) our own regression test framework
that fulfilled our demands.)
I'd suggest abstraction and layers and modularity and composability,
Yes, those are principles that support the mentioned QA processes.
and having an inversion-of-control/dependency-injection approach,
(See my comment about "tests follow code (not v.v.)". - Opinions may
differ.)
a convention moreso than a framework, which pretty much means wrapping
all the standard functions, then about for example having an include
where those are wrapper functions to stub and mock, and another include
where those are macros, or, perhaps, using includes, to point the
include directory for the standard library, into instead what makes
for stubbable/mockable calls to standard library and system functions,
or just leaving the headers alone and linking to modules that aren't
the standard libraries, this being an example of something like
"can't mock strftime", or, for an example.
Just a comment on one aspect here; yes, you have to organize your
software and tests. Key principles are the modularity, hierarchical organization, being able to automate processes, and organize all in
some consistent way. In case your company is certified (or wants to
get certified) make sure your processes are documented and that you
can reproduce your quality processes and the results.
Then, about the modularity, and pointers (to pointers to pointers
to pointers, ...) to functions, then seems about conventions of
types for typeof and the like about that like anybody else I rely
on the compiler to fail with -Wall and failing on warnings to
catch type errors, ..., has that I want to program to interfaces
and then have objects composable, ..., about using conditions of
the build, to, basically make for test-time targets and run-time
targets, with actually testing the code that goes into the build.
It's not clear to me what you want to say here but it sounds that
you want very specific ("micro-management") advice on a low level?
(If so, I can't and don't want to comment here.)
(All above from memories and off the top of my head. Hope there's
something useful for your purpose.)
Janis
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
In article <11d56gl$3ud5q$1@dont-email.me>,
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control >>> and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
It is obvious AI (*) slop. Can we just ignore this and move on?
(*) Oops. Sorry. I mean, "SI".
Oh, and can you believe that the SI industry is all in a tizzy and could
very well crash and wipe out trillions in paper wealth, just because of
some guy having extramarital sex? I thought we left that sort of thing behind in the 90s (the last time we got all in a tizzy about this sort of thing being Bill Clinton...)
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes
and various build-targets, probably mostly about function pointers.
A usual account for example might recount component frameworks,
like COM or XPCOM for example, about the concepts of components,
vis-a-vis, modularity and composability, and, satisfaction of
dependencies, vis-a-vis IPC and RPC, abstraction layers often enough,
then about adapters to dependencies, or as for resources, that
it's a bunch of makefiles with various accounts of conditional includes
and build targets about static and dynamic linking and the toolchain,
with regards to test-harness and runtime-framework and about
metaprogramming when making code generation and boilerplate and so on.
Defining an interface or layer is often enough about groups of functions associated with context-structs to make for lifecycles
of what result alike the pure virtual or abstract or interfaces
in reference to languages like C++, about families of functions
according to the types of their signatures, then as with regards
to componentry rather generally in value-types and interface-types
like "variant" and "queryInterface()", about components that implement multiple interfaces vis-a-vis mostly about "constructing the
object-graph" what makes for separation-of-concerns and composability,
is mostly about modularity and composability.
Then considerations of modularity as for library design affect to
reflect on how to indicate responsibilities of ownership in resources,
for example to hide contract & behavior of resources acquire/release.
What I'm figuring is that basically there is a flat name-space of
functions, there are .h and .c files (and may include "portable
assembler"), and there is the compiler-toolchain, and make or
build-scripts. Since there are only functions then dependencies their references would basically live in structs (in structs, in structs, ...,
of function pointers), much like languages with classes and their
instances objects and subclassing overriding behavior keeping in
contract, about how to define "runtime-module" vis-a-vis "source module"
(.o files after compilation-units), about conditional-includes
and conditional-builds vis-a-vis name-mangling or the conventions of
symbols.
What, whither, when, how?
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke functions with data and assert(expected == actual)", that for example of
"the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests orThis is not homework. And it's not written in good faith, it is just gobbledygook.
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and
the usual object files in the usual object formats on the usual
runtimes.
On 13/11/2026 13:07, Ross Finlayson wrote:
On 11/13/2026 04:25 AM, Bonita Montero wrote:This is not homework. And it's not written in good faith, it is just gobbledygook.
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the
bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the
application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing
frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke
functions with data and assert(expected == actual)", that for example of
"the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and
the usual object files in the usual object formats on the usual
runtimes.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these buzzwords,
and try to write a set of viable-looking but meaningless paragraphs as
Mr RF has done.
You don't need to use a program to do it (although it would be most impressive as a C exercise).
You win when a human mistakes it for something profound and insightful.
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke functions with data and assert(expected == actual)", that for example of
"the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and
the usual object files in the usual object formats on the usual
runtimes.
On 11/13/2026 05:27 AM, bartc wrote:
On 13/11/2026 13:07, Ross Finlayson wrote:
On 11/13/2026 04:25 AM, Bonita Montero wrote:This is not homework. And it's not written in good faith, it is just
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me. >>>> Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the
bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the
application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing
frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke >>> functions with data and assert(expected == actual)", that for example of >>> "the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and >>> the usual object files in the usual object formats on the usual
runtimes.
gobbledygook.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these buzzwords,
and try to write a set of viable-looking but meaningless paragraphs as
Mr RF has done.
You don't need to use a program to do it (although it would be most
impressive as a C exercise).
You win when a human mistakes it for something profound and insightful.
You challenge my good faith, then to hell with you.
This is not homework. And it's not written in good faith, it is just gobbledygook.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these buzzwords,
and try to write a set of viable-looking but meaningless paragraphs as
Mr RF has done.
You don't need to use a program to do it (although it would be most impressive as a C exercise).
You win when a human mistakes it for something profound and insightful.
On 13/11/2026 13:07, Ross Finlayson wrote:
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the
bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the
application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing
frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke
functions with data and assert(expected == actual)", that for example of
"the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and
the usual object files in the usual object formats on the usual
runtimes.
The answer is 'yes'. Or maybe 'no'. I'm not sure.
What was the question?
On 11/13/2026 05:49 AM, Richard Harnden wrote:
On 13/11/2026 13:07, Ross Finlayson wrote:
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me. >>>> Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the
bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the
application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing
frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke >>> functions with data and assert(expected == actual)", that for example of >>> "the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and >>> the usual object files in the usual object formats on the usual
runtimes.
The answer is 'yes'. Or maybe 'no'. I'm not sure.
What was the question?
How to design and make conventions and opinions and idiom and discipline
the inversion-of-control and dependency-injection
for the modularity and composability, in C? How do?
For example, "what is good style in C to be idiomatic and
direct in C toward zero-cost-abstraction, while yet directly
resulting clean modular composable object-orientation in
higher-level languages to wrap and interoperate, with
modular and composable, and re-usable, and reliable,
components in C?"
Modules. (Blocks and Modules, Modules and Interfaces.)
On 13/11/2026 14:27, bartc wrote:
This is not homework. And it's not written in good faith, it is just
gobbledygook.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these buzzwords,
and try to write a set of viable-looking but meaningless paragraphs as
Mr RF has done.
You don't need to use a program to do it (although it would be most
impressive as a C exercise).
You win when a human mistakes it for something profound and insightful.
I don't think there is any bad-faith or trolling in Ross' posts - he
seems simply incapable of writing comprehensibly.ÿ It is gobbledygook,
but I don't see it as intentional.
It looks like he is trying to ask something about how people test their
C code, but I can't figure out anything more than that.
What was the question?
How to design and make conventions and opinions and idiom and discipline
the inversion-of-control and dependency-injection
for the modularity and composability, in C? How do?
For example, "what is good style in C to be idiomatic and
direct in C toward zero-cost-abstraction, while yet directly
resulting clean modular composable object-orientation in
higher-level languages to wrap and interoperate, with
modular and composable, and re-usable, and reliable,
components in C?"
On 11/13/2026 05:49 AM, Richard Harnden wrote:
On 13/11/2026 13:07, Ross Finlayson wrote:
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me. >>>> Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the
bus.)
So, say I'm writing a usual sort of server with an idea that
basically it's about "protocols", mostly, so, living in a world
of the 7-layer OSI model, which is a pretty great abstraction and
all the Internet protocols basically live in that world of definition,
while though sometimes the network/transport then the
application/presentation layers gets switched and crossed,
point being there are systems with various accounts of moving parts
and then is for testing in isolation the parts moving and also
the moving of the parts.
Then, lots of languages make great use of "reflection", which is
an account of determining from the constructs their structure,
which one may aver that that's what parser & compilers do already,
and so if a C programmer needs reflection then if they're a real
programmer or a real coder then they'd just make their own account
of reflection and model the world in a model of the world, and
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
into the language instead of libraries, or made standard, that
since "run-time-type-identification" for example since something
quite useful like "the variant data-type", sort of an "any: typed",
that "reflection" and "introspection" are how most of the unit-testing
frameworks make for inference about types then for conventions of
signatures to make it easy the "test-fixtures", or otherwise the
accounts of modularity and inversion-of-control and
dependency-injection, then about something like C that it's "just invoke >>> functions with data and assert(expected == actual)", that for example of >>> "the many main()'s" just exec'ing those from the test process
whether the tests exit(0) or exit(1), or rather as they die when
assert evaluates false, for example as with regards when running
under a debugger naturally just stopping there live in the debugger.
So, among the goals of writing frameworks or tools or tests or
systems, is that it works nicely with all the tools, according
to usually enough just the totally common standards of the toolchain and >>> the usual object files in the usual object formats on the usual
runtimes.
The answer is 'yes'. Or maybe 'no'. I'm not sure.
What was the question?
How to design and make conventions and opinions and idiom and discipline
the inversion-of-control and dependency-injection
for the modularity and composability, in C? How do?
For example, "what is good style in C to be idiomatic and
direct in C toward zero-cost-abstraction, while yet directly
resulting clean modular composable object-orientation in
higher-level languages to wrap and interoperate, with
modular and composable, and re-usable, and reliable,
components in C?"
On 13/11/2026 14:07, David Brown wrote:
On 13/11/2026 14:27, bartc wrote:
This is not homework. And it's not written in good faith, it is just
gobbledygook.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these buzzwords,
and try to write a set of viable-looking but meaningless paragraphs
as Mr RF has done.
You don't need to use a program to do it (although it would be most
impressive as a C exercise).
You win when a human mistakes it for something profound and insightful.
I don't think there is any bad-faith or trolling in Ross' posts - he
seems simply incapable of writing comprehensibly.ÿ It is gobbledygook,
but I don't see it as intentional.
It looks like he is trying to ask something about how people test
their C code, but I can't figure out anything more than that.
How about this which was recently posted:
RH:
What was the question?
RF:
How to design and make conventions and opinions and idiom and discipline the inversion-of-control and dependency-injection
for the modularity and composability, in C? How do?
For example, "what is good style in C to be idiomatic and
direct in C toward zero-cost-abstraction, while yet directly
resulting clean modular composable object-orientation in
higher-level languages to wrap and interoperate, with
modular and composable, and re-usable, and reliable,
components in C?"
It is just utterly meaningless. Still think this is written in good
faith? RF is just having a laugh.
On 13/11/2026 17:01, bartc wrote:
On 13/11/2026 14:07, David Brown wrote:His posts are not written by AI - no AI writes that badly. And it is
On 13/11/2026 14:27, bartc wrote:
This is not homework. And it's not written in good faith, it is just
gobbledygook.
I'm surprised so many here can't see it.
Here is an interesting challenge: take a list of all these
buzzwords, and try to write a set of viable-looking but meaningless
paragraphs as Mr RF has done.
You don't need to use a program to do it (although it would be most
impressive as a C exercise).
You win when a human mistakes it for something profound and insightful. >>>>
I don't think there is any bad-faith or trolling in Ross' posts - he
seems simply incapable of writing comprehensibly. It is
gobbledygook, but I don't see it as intentional.
It looks like he is trying to ask something about how people test
their C code, but I can't figure out anything more than that.
How about this which was recently posted:
RH:
RF:What was the question?
How to design and make conventions and opinions and idiom anddiscipline
the inversion-of-control and dependency-injection
for the modularity and composability, in C? How do?
For example, "what is good style in C to be idiomatic and
direct in C toward zero-cost-abstraction, while yet directly
resulting clean modular composable object-orientation in
higher-level languages to wrap and interoperate, with
modular and composable, and re-usable, and reliable,
components in C?"
It is just utterly meaningless. Still think this is written in good
faith? RF is just having a laugh.
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
One word: fir.
And, BTW, "joke" isn't quite the right word. It is more of thinking you
are on a mission from God.
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
One word: fir.
On 14/11/2026 08:09, Kenny McCormack wrote:
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups. >>> I find it hard to believe that someone would spend so much time and
effort for a joke.
One word: fir.
How about Bill Cunningham?
In article <11d9jb7$1tt0p$1@dont-email.me>, bartc <bc@freeuk.com> wrote:
On 14/11/2026 08:09, Kenny McCormack wrote:
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross >>>> has written posts in this style for many years in several Usenet groups. >>>> I find it hard to believe that someone would spend so much time and >>>> effort for a joke.
One word: fir.
How about Bill Cunningham?
Not sure I catch the reference, but I do vaguely remember that name being someone who used to post here.
The thing is, though, when you get right down to it, nobody really knows
why anyone posts here. I think each person who does does so for personal reasons that are in general not fully comprehensible by anyone else.
Take the classic question: Why does Kenny McCormack post here, when all he does is troll? Well, he does it because it is fun and it amuses him.
But I often ask: Why does KT post here? Since he obviously knows
everything there is to know about C, why bother posting here? It's not
like he is ever going to learn anything (since he already knows
everything). Now, he will say, it is because he wants to help people.
Well, this motive is already suspect (usually people who say they want to help people have some other motive, sometimes in addition to a genuine
desire to help, but sometimes as the only motive), and, secondly, given how much effort he puts into it, it is hard to believe that altruism is the
only reason.
And you could ask similar questions about just about everyone else who
posts to Usenet (not just this group) ?
And so it goes...
In article <11d9jb7$1tt0p$1@dont-email.me>, bartc <bc@freeuk.com> wrote:
On 14/11/2026 08:09, Kenny McCormack wrote:
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross >>>> has written posts in this style for many years in several Usenet groups. >>>> I find it hard to believe that someone would spend so much time and >>>> effort for a joke.
One word: fir.
How about Bill Cunningham?
Not sure I catch the reference, but I do vaguely remember that name being someone who used to post here.
The thing is, though, when you get right down to it, nobody really knows
why anyone posts here. I think each person who does does so for personal reasons that are in general not fully comprehensible by anyone else.
Take the classic question: Why does Kenny McCormack post here, when all he does is troll? Well, he does it because it is fun and it amuses him.
But I often ask: Why does KT post here? Since he obviously knows
everything there is to know about C, why bother posting here? It's not
like he is ever going to learn anything (since he already knows
everything). Now, he will say, it is because he wants to help people.
Well, this motive is already suspect (usually people who say they want to help people have some other motive, sometimes in addition to a genuine
desire to help, but sometimes as the only motive), and, secondly, given how much effort he puts into it, it is hard to believe that altruism is the
only reason.
And you could ask similar questions about just about everyone else who
posts to Usenet (not just this group) ?
And so it goes...
On 11/12/2026 12:55 PM, Richard Harnden wrote:
On 12/11/2026 20:11, Lew Pitcher wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of
inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes >>>> and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me.
Could you rephrase your question without the academic wording?
Or get an AI do to your homework?
Be careful to remove the white-on-white-very-small-font gotcha your
professor doubtlessly put in.
When I use "A.I." it's framed as a dialogue and I just copy the
transcripts directly, with the attributions.
I.e., I've never submitted anything to Usenet written by a bot
on my behalf.
I'm not sure whether I'd call it "distance learning", or,
"distance learning", say, ....
Like say for example I'm looking at something like this that I tapped
up this morning, and I want to figure out then how to make it so that
the guts of the workers have a nice real quality of covering all the
bases of covering all the cases, when for example according to the C
host as it were or POSIX there's signals and traps to be figured out
in accounts of "asynchronous concurrency".
Outline of "I/O-handle-bound process model"
The "I/O-handle-bound process model", is an account of a process group
in a process tree,
that works up to the bounds of 1024 many file-descriptors that a
pselect() call can poll,
with up to 1000-many file-descriptors in up to 1000-many worker
processes, for up to
1,000,000-many open connections.
The "1000-many" is basically derived from FD_SETSIZE having a limit of
1024,
and that numbered file-descriptors that can participate in non-blocking I/O with pselect() notification of readiness, must be less than FD_SETSIZE
their value.
The basic idea is that there's a main or master process, that being also
the process group leader,
that has a "process-protocol" convention, that the master/leader, has
domain sockets
to its child processes, with up to 1000-many worker processes, then
other processes
as the listener, which accepts connections, and a logger and a metrics process.
The listener is its own process that does accept and management (figured
IP address listing and perhaps a tiny bit of TLS business). It's figured
that it's
an Internet protocol server, and "connection-oriented", or as mostly
about TCP/IP,
and furthermore "association-oriented", about SCTP, then about UDP or datagram
"protocols", the listener demultiplexes the packets as "connections" to
the workers.
The file-descriptors in a process are numbered, non-negative integers.
The file-descriptors 0, 1, 2 are ubiqitously stdin, stdout, stderr,
"standard input-output-error".
The file-descriptor 3 is reserved as it may be a convention for passing
open connections to created processes.
The file-descriptors 4, 5, 6 are reserved as "stdlog, stdmet, stddmp", "logging-metrics-dump outputs".
The file-descriptors 21-1020 are reserved for "1000-many connections".
The leader uses the "1000-many connections" for domain sockets to its "1000-many workers".
Each follower (listener, worker, ...) has a reserved file-descriptor
(11) to connect with the leader.
The leader uses file-descriptor 11 to connect to the listener.
The leader uses file-descriptor 12 to connect to an optional console.
The leader uses file-descriptor 13 to connect to an optional logger.
The leader uses file-descriptor 14 to connect to an optional metrics.
launcher
leader
logger
metrics
console
listener
worker
The model of operation describes how a process is created, according to
fork and execve.
The file-descriptors 0-10 are "standard", about stdin/stdout/stderr and
these
named stdlog/stdmet/stddmp. Usually stdin is un-read, or set to /dev/null. Usually stdout and stderr are inherited (by all child processes) from
leader.
The stdlog and stdmet and stddmp are inherited from leader. A usual idea is that these as file-handles may be passed to the leader for example to
the shell,
or that usually according to options, the first child processes of the
leader are
the logger and metrics, with the logger and metrics receiving all the messages
on those handles, then the leader and all other processes sharing those handles,
and all writing the logs and metrics to those same handles. Then, the
dumper
is an abstract output stream, outside of logging and metrics and
standard I/O.
The file-descriptors 11-20 are in the "process-protocol".
The file-descriptors 21-1020 of the leader are in the "process-protocol".
The file-descriptors 21-1020 of the listener are in the "process-protocol". The file-descriptors 21-1020 of the workers are in the "application-protocol".
The file-descriptor 3 in the listener is the listening socket.
The file-descriptor 3 may be passed to the leader to be passed to the listener,
the listening socket.
leader:
4 -> stdlog
5 -> stdmet
6 -> stddmp
11 <-> logger
12 <-> metrics
13 <-> listener
14 <-> console
21-1020 <-> workers
logger:
4 <- stdlog
6 <- stddmp
11 <-> logger (leader)
12 <-> metrics
metrics:
5 <- stdmet
11 <-> logger
12 <-> metrics (leader)
listener:
4 -> stdlog
5 -> stdmet
6 -> stddmp
11 <-> logger
12 <-> metrics
13 <-> listener (leader)
14-20 <-> listening socket(s)
21-1020 <-> workers
worker:
4 -> stdlog
5 -> stdmet
6 -> stddmp
11 <-> leader
13 <-> listener
21-1020 -> connections (front-end and back-end)
Each of these has their own "main()" source code and executable,
with that each is created by leader with fork() then setting the handles respectively, then execve() thus that the child processes start with
their open handles in the process-protocol (11-20) and stdio (0-10)
already opened and directed.
Then, the process-protocol is according to use-cases, as driven by
events, about that the domain-sockets that are under the handles
of the process-protocol, make for passing data, and also live handles,
as are the connections.
The main use-case is that the listener is bound to a listening socket,
as connections are accepted with connection-management happening
in the listener, listener passes the connection to leader, which finds or create a worker, and passes the connection to worker, which then
proceeds to service the connection according to the application-protocol.
listener: accepts connection
listener -> leader: connection-accepted !
leader -> worker: connection-ready ?
worker -> leader: connection-ready !
leader -> listener: pass-ready !
listener -> leader: connection-pass !
leader -> worker: connection-pass !
When a connection is closed, according to the application-protocol
or if the connection drops or is severed, then worker advises leader,
then leader advises listener.
worker -> leader: connection-closed
leader -> listener: connection-closed
Then, when there are process-level events, the leader makes
commands to the workers, about graceful exit.
leader -> worker: drain connections
leader -> worker: close connections
leader -> worker: exit
Since connections and their attachments & associations
may be short-lived or long-lived, and the goal is that
there only needs be as many workers as fulfill servicing
the connections, then is that there's a process-protocol
about migrating associations (and their connections)
among workers, usually from "sparse" workers to "dense"
workers, where sparse means "not-very-full" and dense
means "not-very-empty", or from "short-lived" workers
to "long-lived" workers when connections are long-lived,
that "association migration" is in the process-protocol.
leader -> worker: emigrate-association
worker -> leader: migrate-association
leader -> worker: immigrate-association
The threading model in the process model
The basic idea of the threading model is that workers
are multi-threaded, the leader is single-threaded, and
that the threads "park" when there is no activity,
yet that the workers have one "sweeper" thread
to account for time-outs, then that as the workers
close their connections, they exit, so that under no
traffic, there is no activity, with all processes "parked".
The idea of "parking" is blocking on the inputs to the
protocols, or the event-driven pumps in the workers.
The threads basically block in pselect() waiting for
ready reading, writing, or other events, or, waiting
on a queue item, pop().
The leader parks in pselect() on 11-1024, the process-protocol.
The listener parks in pselect() about
accept() and pselect() on the listening socket and
the process-protocol sockets.
The worker has four or more threads.
reader-thread: parks in pselect() with read-interest
executor-thread: parks in pop() of application-protocol tasks
writer-thread: parks in pop() of application-protocol responses, then
blocks in pselect() while writing, then parks
sweeper-thread: according to time/alarm, runs on a frequency eg 500 milliseconds, 5 seconds, 5 minutes
When the worker is empty, after its connections close, it exits.
The logger and metrics park in pselect() on the read-side of stdlog/stdmet/stddmp.
Thusly, at idle, with no connections, the entire process-group is
"parked" (0% CPU, "acquiescent").
On 11/14/2026 05:19 AM, Kenny McCormack wrote:
In article <11d9jb7$1tt0p$1@dont-email.me>, bartc? <bc@freeuk.com> wrote: >>> On 14/11/2026 08:09, Kenny McCormack wrote:
In article <11d7fbv$1839o$2@dont-email.me>,
David Brown? <david.brown@hesbynett.no> wrote:
...
His posts are not written by AI - no AI writes that badly.? And it is >>>>> not so void of meaning and grammar that it is randomly generated.
Ross
has written posts in this style for many years in several Usenet
groups.
?? I find it hard to believe that someone would spend so much time and >>>>> effort for a joke.
One word: fir.
How about Bill Cunningham?
Not sure I catch the reference, but I do vaguely remember that name being
someone who used to post here.
The thing is, though, when you get right down to it, nobody really knows
why anyone posts here.? I think each person who does does so for personal
reasons that are in general not fully comprehensible by anyone else.
Take the classic question: Why does Kenny McCormack post here, when
all he
does is troll?? Well, he does it because it is fun and it amuses him.
But I often ask: Why does KT post here?? Since he obviously knows
everything there is to know about C, why bother posting here?? It's not
like he is ever going to learn anything (since he already knows
everything).? Now, he will say, it is because he wants to help people.
Well, this motive is already suspect (usually people who say they want to
help people have some other motive, sometimes in addition to a genuine
desire to help, but sometimes as the only motive), and, secondly,
given how
much effort he puts into it, it is hard to believe that altruism is the
only reason.
And you could ask similar questions about just about everyone else who
posts to Usenet (not just this group) ?
And so it goes...
Usenet is like a rather large bulletin-board system of the world,
though I guess that's what "FIDO Net" is, federated bulletin-boards.
Usenet has all the trappings the Internet, which it predates, i.e.
pre-dates not pred-ates, where "predation" and "predating" are two
different words, though, both I suppose gerunds, point being that Usenet
has been around since before the Internet, and it has URL's and
since every message ever posted is designed to have a unique ID,
then also there are bibiographic citation standards about it,
which might not mean much except that all the messages are distributed
in the widely decentralized and available to any, in the public
availability and not the public domain, as naturally authors maintain copyright of their postings they publish.
Why people post to Usenet is for whatever reason they want
and when they do is their own business, though it's rather
explicitly not-for-commercial-purposes and it's not much
for me to say how anti-spam works.
Whether all gerunds end in "-ing" for example, there's a corner
where once-upon-a-time people with strong opinions would weigh
the question and merit the weights and politely and eruditely
argue its alternatives, with great decorum and fine collegiality.
... Or flame all day, it's a free country.
There are moderated groups, most dusty or defunct.
Then, there are issues about that since the basically return-path
is email, and email may be fakemail, and not all vectors into Usenet
care, whether "Kenny McCormack", for example, inspired or mocks
the character from "Spice Pork", who-made-who, has that it is or isn't
so, then also that long before "A.I." was shored-up and silo'ed
behind the more commercial accounts of "social media", there are
tons bots among the trolls, usually with stolen identities from
dupes on the Internet who'd never notice, yet of course that sort
of practice is way more evident in the modern commercial accounts
of "social media" with the "I.A.: instant audience" of simple
bot-fan and bot-troll accounts of click-fraud and propagandist spew.
Then, a key account of the Usenet is the co-operative aspect,
and, "The Charter". Each Usenet group has a little charter,
and used to be each one had a little "Frequently Asked Questions",
or the culture, for others it's just a feed.
Now if you'll excuse I'll go rake a leaf or wash a dish or something,
or maybe organize my closet or or take a pick-axe to a road somewhere,
yet, probably instead I might be further asking, or, telling, what
sorts of accounts go into modular software in C.
The basic idea for that is sort of an account of functions, callback-functions, and data, in the language, what's to result models
of co-operation, about how to call various code _inside_ the runtime, vis-a-vis, various code calling _into_ the runtime, basically mirroring
the concerns of library authors, of component authors, basically here introducing libraries vis-a-vis components, which is about as old of
a way of looking at matters of modularity & composability as has always
been.
This message will have a permanent, unique ID, when it's published.
[...]
... Or flame all day, it's a free country.
[...]
On 2026-11-14 17:17, Ross Finlayson wrote:
[...]
... Or flame all day, it's a free country.
The latter, "it's a free country", is something I regularly hear
as statement, specifically in US movies that also play in the US.
Usenet, the Internet, etc., being supra-national (or pan-gaea) it
doesn't quite fit; there's countries [with Internet access] where
folks would be very reluctant to claim such a statement.
(Just saying...)
Janis
[...]
On 11/13/2026 04:25 AM, Bonita Montero wrote:
Am 12.11.2026 um 21:11 schrieb Lew Pitcher:
Pardon my impertinence, but this sounds like a homework problem to me.Mabye that's the joke ! ;-)
Humor is appreciated since it's part of bonnehomie and good-will,
it's not a joke. (The "distance learning or distance learning"
was a joke, about "to learn something" vis-a-vis "to learn somebody",
yet that's just using humor instead of stronger insults or the
abject sumbission of the door-mat variety of throwing self under the bus.)
C++ it's said is getting reflection added to the giant tower of
what's become of its language and libraries and idiom shoehorned
So, here's one. Say you got a server process for sockets of the connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
On 13/11/2026 22:50, Ross Finlayson wrote:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
For anyone who either doesn't understand that text or doesn't get how valuable it is just as a question unanswered: please know that it is super.
To Ross: nobody using Usenet is going to be able to give an adequate
answer. Maybe a dozen people on the planet can give such an answer and
maybe each of a dozen teams of academics could do it with several years
work.
Instead of this subsystem deciding what implementation it will use,somebody else gives it the implementation.
(Disclaimer: my comments are just based on personal experience
in our software developing practice from the 1990's and not some
general accepted opinion or habits.)
Our approach was not to "write testable code" by _adapting_ to
some existing framework. While we had standards and practices how
to design software the _tests followed our software_ (not v.v.).
One exception here was that including dedicated trace records in
our code (that could be activated specifically WRT a module and
in granularity) helped for the test evaluation and regressions.
(See my comment about "tests follow code (not v.v.)". - Opinions may
differ.)
Tristan Wibberley pisze:
On 13/11/2026 22:50, Ross Finlayson wrote:ai may answer it in about 10 seconds:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
For anyone who either doesn't understand that text or doesn't get how
valuable it is just as a question unanswered: please know that it is
super.
To Ross: nobody using Usenet is going to be able to give an adequate
answer. Maybe a dozen people on the planet can give such an answer and
maybe each of a dozen teams of academics could do it with several years
work.
C does not really need a special component model for this. Most of what
you describe can be done with a fairly small number of ordinary C mechanisms, provided that the boundaries between them are made explicit.
The important distinction, in my opinion, is between a **source
module**, a **runtime module**, and an **interface**.
A `.c` file is a compilation unit, not necessarily a runtime component. Several `.c` files may form one library or runtime component, while one
`.c` file may contain several logically unrelated things. The actual
runtime boundary is usually represented by an API and, if necessary, by
a table of function pointers.
For example, instead of making an object hierarchy, one can simply define:
```c
struct renderer {
ÿÿÿ void (*draw)(struct renderer *, const void *);
ÿÿÿ void (*clear)(struct renderer *);
ÿÿÿ void (*destroy)(struct renderer *);
ÿÿÿ void *context;
};
```
An implementation constructs such a structure:
```c
struct renderer *CreateSoftwareRenderer(void);
struct renderer *CreateOpenGLRenderer(void);
```
The rest of the program only knows about `struct renderer` and its
contract. It does not need to know which implementation was constructed.
That already gives you a fairly direct form of dependency injection:
```c
struct renderer *renderer = CreateSoftwareRenderer();
game.renderer = renderer;
```
or, even more explicitly:
```c
game.renderer.draw = SoftwareDraw;
game.renderer.clear = SoftwareClear;
game.renderer.destroy = SoftwareDestroy;
game.renderer.context = &software_state;
```
There is no fundamental requirement that the dependency be discovered globally. It can simply be passed to the code which needs it.
In fact, I would say that **passing dependencies explicitly is one of
the most natural forms of dependency injection in C**.
The same technique works without function pointers when the dependency
is data rather than behavior. For example:
```c
struct allocator {
ÿÿÿ void *(*alloc)(struct allocator *, size_t);
ÿÿÿ void (*free)(struct allocator *, void *);
ÿÿÿ void *context;
};
```
Then a subsystem can receive an allocator without knowing whether it ultimately uses `malloc`, a pool, an arena, a debug allocator, or
something supplied by a test harness.
This is also where ownership belongs. The interface should state things
such as:
```c
void *ResourceCreate(...);
void ResourceDestroy(void *);
```
and document who owns the returned resource and when `Destroy` must be called. C has no language-level ownership system, so this is part of the
API contract rather than something the compiler enforces.
For test-time versus run-time implementations, I would normally avoid conditional compilation inside the actual application code.
Instead of:
```c
#ifdef TEST
ÿÿÿ ...
#else
ÿÿÿ ...
#endif
```
I prefer:
```c
struct filesystem {
ÿÿÿ int (*read)(struct filesystem *, ...);
ÿÿÿ int (*write)(struct filesystem *, ...);
ÿÿÿ void *context;
};
```
and then construct either:
```c
CreateRealFilesystem(...)
```
or:
```c
CreateTestFilesystem(...)
```
The application remains identical.
Conditional compilation is still useful when the implementations
themselves genuinely require different platform facilities:
```c
#ifdef _WIN32
ÿÿÿ ...
#elif defined(__linux__)
ÿÿÿ ...
#endif
```
or when selecting which implementation is compiled into a particular
target.
That distinction is useful:
**conditional compilation chooses code; dependency injection chooses behavior.**
Build systems then decide which source files participate in a target.
For example, conceptually:
```text
game
ÿÿÿ game.c
ÿÿÿ renderer.c
ÿÿÿ renderer_software.c
game_test
ÿÿÿ game.c
ÿÿÿ renderer.c
ÿÿÿ renderer_test.c
```
Both targets can satisfy the same interface, while linking different implementations.
With static linking, the boundary is mostly a linker boundary. With
dynamic linking, it can additionally become an operating-system module boundary (`DLL`, `.so`, etc.). The C interface does not fundamentally change.
A DLL can export something as simple as:
```c
struct renderer *CreateRenderer(void);
```
and the host can obtain that symbol dynamically. The ABI then becomes
part of the contract, which is where things such as calling conventions, structure layout, symbol visibility, versioning, and ownership across
module boundaries become important.
There is also no particular reason why every dependency needs to be represented by a huge nested structure of function pointers. That can
become its own form of accidental object-oriented programming.
Often this is enough:
```c
struct game {
ÿÿÿ struct renderer *renderer;
ÿÿÿ struct filesystem *filesystem;
ÿÿÿ struct clock *clock;
};
```
and each interface contains only the operations that actually belong to it.
This gives you something resembling a manually constructed object graph:
```text
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ game
ÿÿÿÿÿÿÿÿÿÿÿÿÿ /ÿÿ |ÿÿÿ \
ÿÿÿÿÿÿÿÿÿÿÿÿ /ÿÿÿ |ÿÿÿÿ \
ÿÿÿÿÿÿ renderer filesystem clock
ÿÿÿÿÿÿÿÿÿ |ÿÿÿÿÿÿÿÿÿ |ÿÿÿÿÿÿ |
ÿÿÿÿÿ softwareÿÿÿÿ testÿÿÿ fake
```
The graph is constructed at startup. The game does not construct its own concrete dependencies; somebody outside it does.
That is essentially the interesting part of inversion of control in C.
The phrase "IoC" can sound much more exotic than the mechanism actually
is. At the simplest level it means:
Instead of this subsystem deciding what implementation it will use,somebody else gives it the implementation.
Function pointers are one way of doing that. Plain function arguments
are another, and often the better one.
For example, a function such as:
```c
void Simulate(struct simulation *s,
ÿÿÿÿÿÿÿÿÿÿÿÿÿ float (*random)(void),
ÿÿÿÿÿÿÿÿÿÿÿÿÿ void (*log)(const char *));
```
is already dependency injection. No component framework is required.
Likewise, a callback is already a small form of inversion of control:
```c
void EnumerateFiles(const char *path,
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ void (*callback)(const char *name, void *context),
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ void *context);
```
The library controls the enumeration and calls code supplied by the caller.
So I would not start by designing "components". I would start by
identifying **contracts**.
For each subsystem ask:
1. What does the caller need to know?
2. What must remain private?
3. Who owns the resources?
4. Which behavior needs to be replaceable?
5. Does it actually need runtime replacement, or is link-time selection enough?
6. Does the boundary need to cross a shared-library/ABI boundary?
Then choose the simplest mechanism:
```text
ordinary function call
ÿÿÿÿÿÿÿ ?
function parameter / callback
ÿÿÿÿÿÿÿ ?
context pointer
ÿÿÿÿÿÿÿ ?
struct containing function pointers
ÿÿÿÿÿÿÿ ?
separate static library
ÿÿÿÿÿÿÿ ?
dynamic library / plugin
ÿÿÿÿÿÿÿ ?
full component framework
```
I would only move down that list when the simpler mechanism stops being sufficient.
In particular, I would be rather suspicious of reproducing COM in C
merely because COM solves a problem that C does not have. A table of function pointers plus a context pointer is already surprisingly close
to the essential machinery of an object interface:
```c
struct interface {
ÿÿÿ void *context;
ÿÿÿ intÿ (*open)(void *context);
ÿÿÿ intÿ (*read)(void *context, void *buffer, size_t size);
ÿÿÿ void (*close)(void *context);
};
```
The context provides instance state, the function pointers provide polymorphic behavior, and the header defines the contract.
Multiple interfaces are simply multiple such tables, rather than
multiple inheritance:
```c
struct device {
ÿÿÿ struct input_interface input;
ÿÿÿ struct output_interface output;
ÿÿÿ struct diagnostic_interface diagnostic;
};
```
If a component has to support querying for optional interfaces, then something resembling `QueryInterface()` can certainly be implemented.
But again, that is a convention built on ordinary C rather than a
language feature.
There is one more important point about "modularity": **the header is
not necessarily the interface**.
A good C module often has:
```c
foo.h
foo.c
```
where `foo.h` exposes the public contract and `foo.c` contains private structures and implementation details.
For example:
```c
/* foo.h */
struct foo;
struct foo *FooCreate(void);
void FooDestroy(struct foo *);
int FooDoSomething(struct foo *);
```
while `struct foo` itself is private.
That gives you opaque state without needing classes:
```c
struct foo {
ÿÿÿ int private_state;
ÿÿÿ ...
};
```
The caller can hold a `struct foo *` but cannot depend on its representation.
This is often more valuable for long-term modularity than adding another layer of function-pointer indirection.
So, in short, C has most of the machinery being described here, but it
is deliberately not packaged into one language-level object/component system.
You have:
```text
.h/.c
ÿÿÿ ? source/module boundaries
opaque structs
ÿÿÿ ? encapsulation
function pointers + context
ÿÿÿ ? interfaces / polymorphism
callbacks
ÿÿÿ ? inversion of control
explicit parameters
ÿÿÿ ? dependency injection
constructors/factory functions
ÿÿÿ ? choosing implementations
static libraries
ÿÿÿ ? link-time composition
shared libraries
ÿÿÿ ? runtime composition
build configuration
ÿÿÿ ? selecting implementations
explicit create/destroy contracts
ÿÿÿ ? resource ownership
```
The interesting part is not that C lacks these abstractions. It is that
**C lets you assemble them yourself**, which means the programmer also
has to decide where the abstraction is actually justified.
And that last part is both C's freedom and C's trap.
C is C. Imvvvvho, C++ is better... :^) Let the flames begin.
Am 12.11.2026 um 21:15 schrieb Chris M. Thomasson:
C is C. Imvvvvho, C++ is better... :^) Let the flames begin.
A frequently cited point in this context is that `std::sort()` is
typically many times faster than `qsort()`, thanks to the inlining
of the function object. Furthermore, a function object can easily
incorporate an external context by capturing it within a lambda?
something that is simply not possible with `qsort()`, where a C
-style comparison function is restricted to accessing only global
variables. This falls far short of the capabilities offered by
functional programming. In other words: C is incapable of func-
tional programming.
Bonita Montero pisze:
Am 12.11.2026 um 21:15 schrieb Chris M. Thomasson:
C is C. Imvvvvho, C++ is better... :^) Let the flames begin.
A frequently cited point in this context is that `std::sort()` is
typically many times faster than `qsort()`, thanks to the inlining
of the function object. Furthermore, a function object can easily
incorporate an external context by capturing it within a lambda?
something that is simply not possible with `qsort()`, where a C
-style comparison function is restricted to accessing only global
variables. This falls far short of the capabilities offered by
functional programming. In other words: C is incapable of func-
tional programming.
you can write you own sort or paste if trom the net and its not worse
than c++
in some thread on this as maybe you remember i taka a contest ;c on c++
sort and beat it much (as far as i remember by code taken from net)
fir pisze:
Bonita Montero pisze:my own quote from google groups
Am 12.11.2026 um 21:15 schrieb Chris M. Thomasson:
C is C. Imvvvvho, C++ is better... :^) Let the flames begin.
A frequently cited point in this context is that `std::sort()` is
typically many times faster than `qsort()`, thanks to the inlining
of the function object. Furthermore, a function object can easily
incorporate an external context by capturing it within a lambda?
something that is simply not possible with `qsort()`, where a C
-style comparison function is restricted to accessing only global
variables. This falls far short of the capabilities offered by
functional programming. In other words: C is incapable of func-
tional programming.
you can write you own sort or paste if trom the net and its not worse
than c++
in some thread on this as maybe you remember i taka a contest ;c on c++
sort and beat it much (as far as i remember by code taken from net)
"
fir
23 kwi 2022, 12:35:57
do
try radix sort, i once measured that things (on 10-yo old machine) and testing sorting 1MB of integers and remember c quicksort (like that from wikipedia) have 150 ms , c++ std:sort 111 ms,
c insertsort 111 ms also or 2 ms worse something like that, c-radix sort (taken from stack overflow) 17 ms beating c++:stdsort more than 3 times
for more details search "quicksort" in this group (the search in google groups work).."
fir pisze:
fir pisze:
Bonita Montero pisze:my own quote from google groups
Am 12.11.2026 um 21:15 schrieb Chris M. Thomasson:
C is C. Imvvvvho, C++ is better... :^) Let the flames begin.
A frequently cited point in this context is that `std::sort()` is
typically many times faster than `qsort()`, thanks to the inlining
of the function object. Furthermore, a function object can easily
incorporate an external context by capturing it within a lambda?
something that is simply not possible with `qsort()`, where a C
-style comparison function is restricted to accessing only global
variables. This falls far short of the capabilities offered by
functional programming. In other words: C is incapable of func-
tional programming.
you can write you own sort or paste if trom the net and its not worse
than c++
in some thread on this as maybe you remember i taka a contest ;c on c++
sort and beat it much (as far as i remember by code taken from net)
"
fir
23 kwi 2022, 12:35:57
do
try radix sort, i once measured that things (on 10-yo old machine) and
testing sorting 1MB of integers and remember c quicksort (like that
from wikipedia) have 150 ms , c++ std:sort 111 ms,
c insertsort 111 ms also or 2 ms worse something like that, c-radix
sort (taken from stack overflow) 17 ms beating c++:stdsort more than 3
times
for more details search "quicksort" in this group (the search in
google groups work).."
see here https://groups.google.com/g/comp.lang.c/c/I4lJSh45EJ0/m/ezGwgnvWDgAJ
fir pisze:
see here https://groups.google.com/g/comp.lang.c/c/I4lJSh45EJ0/m/
ezGwgnvWDgAJ
lame c++ bonita
I wrote a comparison between std::sort() and qsort() to sort an array of
4096 ints (fits in L1). On my Zen4-PC std::sort() is 4.8 times faster.
Any question ?
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <chrono>
#include <vector>
#include <random>
using namespace std;
using namespace chrono;
int main()
{
ÿÿÿÿconstexpr size_t
ÿÿÿÿÿÿÿ N = 0x1000,
ÿÿÿÿÿÿÿ Rounds = 10'000;
ÿÿÿÿauto test = []( auto fn ) -> double
ÿÿÿÿ{
ÿÿÿÿÿÿÿ time_point start = steady_clock::now();
ÿÿÿÿÿÿÿ for( size_t r = Rounds; r; --r )
ÿÿÿÿÿÿÿÿÿÿÿ fn();
ÿÿÿÿÿÿÿ duration dur = steady_clock::now() - start;
ÿÿÿÿÿÿÿ return (double)duration_cast<nanoseconds>( dur ).count();
ÿÿÿÿ};
ÿÿÿÿvector<int>
ÿÿÿÿÿÿÿ origin( N ),
ÿÿÿÿÿÿÿ srt( N );
ÿÿÿÿmt19937_64 mt;
ÿÿÿÿfor( int &i : origin )
ÿÿÿÿÿÿÿ i = (int)mt();
ÿÿÿÿint dummy = 0;
ÿÿÿÿauto cpy = [&] { copy( origin.begin(), origin.end(), srt.begin() ); dummy += srt[0]; };
ÿÿÿÿdouble tRef = test( cpy );
ÿÿÿÿauto qsrt = [&]
ÿÿÿÿÿÿÿ {
ÿÿÿÿÿÿÿÿÿÿÿ cpy();
ÿÿÿÿÿÿÿÿÿÿÿ qsort( srt.data(), srt.size(), sizeof( int ), +[]( const
void *lhs, const void *rhs ) -> int
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ {
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ int &iLhs = *(int *)lhs, &iRhs = *(int *)rhs;
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ if( iLhs == iRhs )
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ return 0;
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ return iLhs < iRhs ? -1 : 1;
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ } );
ÿÿÿÿÿÿÿÿÿÿÿ dummy += srt[0];
ÿÿÿÿÿÿÿ };
ÿÿÿÿdouble tQsrt = test( qsrt ) - tRef;
ÿÿÿÿauto stdSrt = [&]
ÿÿÿÿÿÿÿ {
ÿÿÿÿÿÿÿÿÿÿÿ cpy();
ÿÿÿÿÿÿÿÿÿÿÿ sort( srt.begin(), srt.end(), less() );
ÿÿÿÿÿÿÿÿÿÿÿ dummy += srt[0];
ÿÿÿÿÿÿÿ };
ÿÿÿÿdouble tStdSrt = test( stdSrt ) - tRef;
ÿÿÿÿcout << tQsrt / tStdSrt << endl;
ÿÿÿÿreturn dummy;
}
so maybe try it right c wayDo you want to compare C vs. C++ or algorithm A vs. algorithm B ?
Am 16.11.2026 um 18:00 schrieb fir:
so maybe try it right c wayDo you want to compare C vs. C++ or algorithm A vs. algorithm B ?
The point was that C++ is more convenient and faster than C through functional programming when using functional programming with both
languages; as far as the C-solution can be called functional (I
wouldn't call it so). And as I've shown the std::sort() leads to
about six times less code than qsort().
i compare you and myself...The discussion was about functional programming in either languagage
On 11/12/2026 01:44 PM, Ross Finlayson wrote:
On 11/12/2026 12:55 PM, Richard Harnden wrote:
On 12/11/2026 20:11, Lew Pitcher wrote:
On Thu, 12 Nov 2026 09:41:04 -0800, Ross Finlayson wrote:
Hello, dear C experts, I'm hoping you can tell me a story about
modularity and composability, about the concerns of
inversion-of-control
and dependency-injection in C, basically about wiring
test-time and run-time targets, for example about conditional-includes >>>>> and various build-targets, probably mostly about function pointers.
Pardon my impertinence, but this sounds like a homework problem to me. >>>>
Could you rephrase your question without the academic wording?
Or get an AI do to your homework?
Be careful to remove the white-on-white-very-small-font gotcha your
professor doubtlessly put in.
When I use "A.I." it's framed as a dialogue and I just copy the
transcripts directly, with the attributions.
I.e., I've never submitted anything to Usenet written by a bot
on my behalf.
I'm not sure whether I'd call it "distance learning", or,
"distance learning", say, ....
Like say for example I'm looking at something like this that I tapped
up this morning, and I want to figure out then how to make it so that
the guts of the workers have a nice real quality of covering all the
bases of covering all the cases, when for example according to the C
host as it were or POSIX there's signals and traps to be figured out
in accounts of "asynchronous concurrency".
Outline of "I/O-handle-bound process model"
The "I/O-handle-bound process model", is an account of a process group
in a process tree,
that works up to the bounds of 1024 many file-descriptors that a
pselect() call can poll,
with up to 1000-many file-descriptors in up to 1000-many worker
processes, for up to
1,000,000-many open connections.
[ ... ]
Am 16.11.2026 um 18:24 schrieb fir:
i compare you and myself...The discussion was about functional programming in either languagage
with comparable algorithms. Not about algorithm A in language X vs.
algorithm B in language Y.
note i call you a lame becouse in such kind of opinioons youre lame ans spread lame talk..
Am 16.11.2026 um 18:43 schrieb fir:
note i call you a lame becouse in such kind of opinioons youre lame
ans spread lame talk..
And you are shifting to aspects that have nothing to do with the initial discussion.
Rest unread.
Bonita Montero pisze:You're like fifteen.
Am 16.11.2026 um 18:43 schrieb fir:
note i call you a lame becouse in such kind of opinioons youre lame
ans spread lame talk..
And you are shifting to aspects that have nothing to do with the initial
discussion.
Rest unread.
i know lame bonita i dont answer oryginal discusion i just show youre
very lame in sorting and you talk lame shit
so maybe try it right c way
typedef unsigned int UI32;
UI32 * RadixSortUnsigned(UI32 * pData, UI32 * pTemp, size_t count)
{
size_t mIndex[4][256] = {0};ÿÿÿÿÿÿÿÿÿÿÿ // index matrix
UI32 *pDst, *pSrc, *pTmp;
size_t i,j,m,n;
UI32 u;
ÿÿÿ for(i = 0; i < count; i++){ÿÿÿÿÿÿÿÿ // generate histograms
ÿÿÿÿÿÿÿ u = pData[i];
ÿÿÿÿÿÿÿ for(j = 0; j < 4; j++){
ÿÿÿÿÿÿÿÿÿÿÿ mIndex[j][(size_t)(u & 0xff)]++;
ÿÿÿÿÿÿÿÿÿÿÿ u >>= 8;
ÿÿÿÿÿÿÿ }
ÿÿÿ }
ÿÿÿ for(j = 0; j < 4; j++){ÿÿÿÿÿÿÿÿÿÿÿÿ // convert to indices
ÿÿÿÿÿÿÿ n = 0;
ÿÿÿÿÿÿÿ for(i = 0; i < 256; i++){
ÿÿÿÿÿÿÿÿÿÿÿ m = mIndex[j][i];
ÿÿÿÿÿÿÿÿÿÿÿ mIndex[j][i] = n;
ÿÿÿÿÿÿÿÿÿÿÿ n += m;
ÿÿÿÿÿÿÿ }
ÿÿÿ }
ÿÿÿ pDst = pTemp;ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ // radix sort
ÿÿÿ pSrc = pData;
ÿÿÿ for(j = 0; j < 4; j++){
ÿÿÿÿÿÿÿ for(i = 0; i < count; i++){
ÿÿÿÿÿÿÿÿÿÿÿ u = pSrc[i];
ÿÿÿÿÿÿÿÿÿÿÿ m = (size_t)(u >> (j<<3)) & 0xff;
ÿÿÿÿÿÿÿÿÿÿÿ pDst[mIndex[j][m]++] = u;
ÿÿÿÿÿÿÿ }
ÿÿÿÿÿÿÿ pTmp = pSrc;
ÿÿÿÿÿÿÿ pSrc = pDst;
ÿÿÿÿÿÿÿ pDst = pTmp;
ÿÿÿ }
ÿÿÿ return(pSrc);
}
So, here's one. Say you got a server process for sockets of the connection-oriented or datagram-wise or association-oriented likeUse C++20 coroutines with Bost.ASIO and io_uring. This gives
TCP, UDP, or SCTP, and it manages the connecting and the sending and receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Am 16.11.2026 um 18:55 schrieb fir:
Bonita Montero pisze:You're like fifteen.
Am 16.11.2026 um 18:43 schrieb fir:
note i call you a lame becouse in such kind of opinioons youre lame
ans spread lame talk..
And you are shifting to aspects that have nothing to do with the initial >>> discussion.
Rest unread.
i know lame bonita i dont answer oryginal discusion i just show youre
very lame in sorting and you talk lame shit
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps
not. Sigh.
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps
not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler
and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts
and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
On 11/17/2026 1:00 AM, Ross Finlayson wrote:
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps
not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler
and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts
and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
pselect() is simple, portable, and for many workloads fast enough. Those
are perfectly valid engineering arguments.
For a high-performance server, though, well, shit. I personally wouldn't
be reaching for pselect() at all. Uggg...
One thing I like about mechanisms such as io_uring and IOCP is that they encourage thinking about capacity up front. You tend to preallocate the resources the system needs to operate, size your queues and pools appropriately, and define behavior for resource pressure. Thats
generally preferable to discovering in the god damn hot path that yet another allocation is required! Fuck!
On Windows, large scale IOCP servers have long used techniques such as
so called, zero byte receives, and preallocated connection state to
reduce memory pressure and avoid per-operation allocations. Similar
ideas apply elsewhere, for sure. The goal is usually to enter a pressure mode before critical resources are exhausted, not to keep allocating indefinitely and hope for the best.
When resources start getting tight, I would rather see the server shed
load, evict caches, shorten timeouts, disconnect stale clients, or
refuse new work than continue consuming memory until the operating
system is in trouble. Running out of capacity should be a planned state,
not a surprise.
That's one of the reasons fixed pools and preallocated state appeal to
me for systems under heavy load.
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps
not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler
and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts
and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
On 11/17/2026 1:00 AM, Ross Finlayson wrote:
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps
not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler
and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts
and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
pselect() is simple, portable, and for many workloads fast enough. Those
are perfectly valid engineering arguments.
For a high-performance server, though, well, shit. I personally wouldn't
be reaching for pselect() at all. Uggg...
One thing I like about mechanisms such as io_uring and IOCP is that they encourage thinking about capacity up front. You tend to preallocate the resources the system needs to operate, size your queues and pools appropriately, and define behavior for resource pressure. Thats
generally preferable to discovering in the god damn hot path that yet
another allocation is required! Fuck!
On Windows, large scale IOCP servers have long used techniques such as
so called, zero byte receives, and preallocated connection state to
reduce memory pressure and avoid per-operation allocations. Similar
ideas apply elsewhere, for sure. The goal is usually to enter a pressure
mode before critical resources are exhausted, not to keep allocating indefinitely and hope for the best.
When resources start getting tight, I would rather see the server shed
load, evict caches, shorten timeouts, disconnect stale clients, or
refuse new work than continue consuming memory until the operating
system is in trouble. Running out of capacity should be a planned state,
not a surprise.
That's one of the reasons fixed pools and preallocated state appeal to
me for systems under heavy load.
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
Here then for example, what I'm trying to figure out is basically
how to make for C what's in C++ without being in C++ that's yet
readily adaptable for calling and being called from and into C++
from C. Like, for example, "sequence" or "iter", and "lister"
and the like, then for something like "C11 _Generic", making accounts
of generics the types in C vis-a-vis the polymorphic class model
in C++, about "sized" or accounts like "characteristics" of access
of arrays, pointer-offsets, lists, otherwise the usual things,
"holders", "getters and setters", then about "libraries" and
"components", after things like "success_t, error_t, and return_t,
for context_t", definitions of the patterns, that would be generally
suitable for writing libraries in C and having them callable and
calling to and from C++, these are the kinds of things I'm liking
to figure out.
Like for example about how to pass an allocator into C, or making
access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
storage or lifetime and ownership and responsibility, then for
things like "emit_log" and "emit_metric" and "emit_dump", these
are the kinds of things that later always live in any sort of
application framework, for making good-style.
Why not just write :
"""
How do I write C++ code in C?
"""
The answer then would be, you don't. Write C++ code in C++. Write C
code in C.
On 11/13/2026 08:54 AM, David Brown wrote:
His posts are not written by AI - no AI writes that badly.ÿ And it is
not so void of meaning and grammar that it is randomly generated.ÿ Ross
has written posts in this style for many years in several Usenet groups.
ÿ I find it hard to believe that someone would spend so much time and
effort for a joke.
Then, in another thread, bringing it back here:
Here then for example, what I'm trying to figure out is basically
how to make for C what's in C++ without being in C++ that's yet
readily adaptable for calling and being called from and into C++
from C. Like, for example, "sequence" or "iter", and "lister"
and the like, then for something like "C11 _Generic", making accounts
of generics the types in C vis-a-vis the polymorphic class model
in C++, about "sized" or accounts like "characteristics" of access
of arrays, pointer-offsets, lists, otherwise the usual things,
"holders", "getters and setters", then about "libraries" and
"components", after things like "success_t, error_t, and return_t,
for context_t", definitions of the patterns, that would be generally
suitable for writing libraries in C and having them callable and
calling to and from C++, these are the kinds of things I'm liking
to figure out.
Like for example about how to pass an allocator into C, or making
access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
storage or lifetime and ownership and responsibility, then for
things like "emit_log" and "emit_metric" and "emit_dump", these
are the kinds of things that later always live in any sort of
application framework, for making good-style.
Why not just write :
"""
How do I write C++ code in C?
"""
The answer then would be, you don't.ÿ Write C++ code in C++.ÿ Write C
code in C.
Here the points under consideration are that C++ has some relevant
constructs that to use the same patterns in C, then to make for
the _interoperability_, has for example that libraries of most
any usual sort result their symbols, those being of C, or as after name-mangling (a convention of expressing the namespaces and constructs encoding the names/symbols as C defines for what C++ models,
name-mangling, where "the mangle" is a steam-press for the ironing
of sheets, where the common meaning is "fold, spindle, and mutilate"), there's that "writing C++ in C", is to make it adapt-able.
Then, other accounts involve the system, for example malloc/free,
vis-a-vis, allocators, and that C++'s account of new/delete,
has also an account of pretty much every constructor allowing
the passing of an allocator, for example about free-lists/arenas/slabs,
about how to make a _pattern_ so that either the library interface
signature has function-pointers for acquire-release, or, for example,
there's a convention where each process/thread has a global-variable
(called thread-local in a thread, global to the thread) with function pointers for acquire/release.
It's similar with stdio, or for example loggers, usually considered
"static" (or extern) to the process to result a global entry-point
for the rest of the routine, or, what makes for that it gets passed
to every library-function or installed in the context passsed to every library function, about what aren't "classes" and "instances" like in
C++ which is defined in the language, _yet so model those_, why it's a
thing.
Other examples of accounts for example make for list-adapters or
iterators or accounts of sequences then about treating arrays and
lists as the same (while they have different characteristics of
access, the "access-patternry"), then for example about associative
arrays and sets and the like then into traversals for trees and graphs
and the like, where for example many "loosely-typed" languages of the
day (like JavaScript, Python, ...) have that's _default_ with the
"slots" the associative-array, vis-a-vis something like "the shell
language" and accounts of attributes, and behaviors for arrays and associative-arrays, those being considered general. So, the idea is
that something like C11 has something like "_Generic" keyword to employ,
that instead of writing to a concrete implementation of
an array or list, instead to write to the _adapters_ of these,
in C, which can be more direct for C++, with C++'s great account of, "Abstraction", for the abstract and the concrete, and that anything's
both abstract and concrete.
C and C++ are different accounts: they're also together an account.Maybe you should write a book. It would simultaneously be useful as a door-stop, and a cure for insomnia.
Then, the resulting artifacts: has that C++ can link as it were
to the C symbols, and even the C can link as it were to name-mangled
C++, not that anybody ever does that since it involves the model in
the run-time their interpretation, point being libraries to be
interoperable with both C and C++ have C exports, then that it's
to be expected that C++ for example can deal with the allocator
or I/O stream, wrapping it into the C++ from a C way that must be
contrived.
On 18/11/2026 12:13, Ross Finlayson wrote:
On 11/13/2026 08:54 AM, David Brown wrote:
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross
has written posts in this style for many years in several Usenet groups. >>> I find it hard to believe that someone would spend so much time and
effort for a joke.
Then, in another thread, bringing it back here:
Here then for example, what I'm trying to figure out is basically
how to make for C what's in C++ without being in C++ that's yet
readily adaptable for calling and being called from and into C++
from C. Like, for example, "sequence" or "iter", and "lister"
and the like, then for something like "C11 _Generic", making accounts
of generics the types in C vis-a-vis the polymorphic class model
in C++, about "sized" or accounts like "characteristics" of access
of arrays, pointer-offsets, lists, otherwise the usual things,
"holders", "getters and setters", then about "libraries" and
"components", after things like "success_t, error_t, and return_t,
for context_t", definitions of the patterns, that would be generally
suitable for writing libraries in C and having them callable and
calling to and from C++, these are the kinds of things I'm liking
to figure out.
Like for example about how to pass an allocator into C, or making
access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
storage or lifetime and ownership and responsibility, then for
things like "emit_log" and "emit_metric" and "emit_dump", these
are the kinds of things that later always live in any sort of
application framework, for making good-style.
Why not just write :
"""
How do I write C++ code in C?
"""
The answer then would be, you don't. Write C++ code in C++. Write C
code in C.
Here the points under consideration are that C++ has some relevant
constructs that to use the same patterns in C, then to make for
the _interoperability_, has for example that libraries of most
any usual sort result their symbols, those being of C, or as after
name-mangling (a convention of expressing the namespaces and constructs
encoding the names/symbols as C defines for what C++ models,
name-mangling, where "the mangle" is a steam-press for the ironing
of sheets, where the common meaning is "fold, spindle, and mutilate"),
there's that "writing C++ in C", is to make it adapt-able.
That paragraph should be taken out and shot.
Together with most other gibberish you write.
Are you asking a question here? Why are you posting this; what response
are you after?
Or maybe you enjoy regurgitating random facts in as incomprehensible a
manner as possible.
Or is your aim just to provoke reactions like this?
Maybe you should write a book. It would simultaneously be useful as a door-stop, and a cure for insomnia.
Then, other accounts involve the system, for example malloc/free,
vis-a-vis, allocators, and that C++'s account of new/delete,
has also an account of pretty much every constructor allowing
the passing of an allocator, for example about free-lists/arenas/slabs,
about how to make a _pattern_ so that either the library interface
signature has function-pointers for acquire-release, or, for example,
there's a convention where each process/thread has a global-variable
(called thread-local in a thread, global to the thread) with function
pointers for acquire/release.
It's similar with stdio, or for example loggers, usually considered
"static" (or extern) to the process to result a global entry-point
for the rest of the routine, or, what makes for that it gets passed
to every library-function or installed in the context passsed to every
library function, about what aren't "classes" and "instances" like in
C++ which is defined in the language, _yet so model those_, why it's a
thing.
Other examples of accounts for example make for list-adapters or
iterators or accounts of sequences then about treating arrays and
lists as the same (while they have different characteristics of
access, the "access-patternry"), then for example about associative
arrays and sets and the like then into traversals for trees and graphs
and the like, where for example many "loosely-typed" languages of the
day (like JavaScript, Python, ...) have that's _default_ with the
"slots" the associative-array, vis-a-vis something like "the shell
language" and accounts of attributes, and behaviors for arrays and
associative-arrays, those being considered general. So, the idea is
that something like C11 has something like "_Generic" keyword to employ,
that instead of writing to a concrete implementation of
an array or list, instead to write to the _adapters_ of these,
in C, which can be more direct for C++, with C++'s great account of,
"Abstraction", for the abstract and the concrete, and that anything's
both abstract and concrete.
C and C++ are different accounts: they're also together an account.
Then, the resulting artifacts: has that C++ can link as it were
to the C symbols, and even the C can link as it were to name-mangled
C++, not that anybody ever does that since it involves the model in
the run-time their interpretation, point being libraries to be
interoperable with both C and C++ have C exports, then that it's
to be expected that C++ for example can deal with the allocator
or I/O stream, wrapping it into the C++ from a C way that must be
contrived.
On 11/18/2026 05:18 AM, bartc wrote:
On 18/11/2026 12:13, Ross Finlayson wrote:
On 11/13/2026 08:54 AM, David Brown wrote:
His posts are not written by AI - no AI writes that badly. And it is
not so void of meaning and grammar that it is randomly generated. Ross >>>> has written posts in this style for many years in several Usenet
groups.
I find it hard to believe that someone would spend so much time and
effort for a joke.
Then, in another thread, bringing it back here:
accountsHere then for example, what I'm trying to figure out is basically
how to make for C what's in C++ without being in C++ that's yet
readily adaptable for calling and being called from and into C++
from C. Like, for example, "sequence" or "iter", and "lister"
and the like, then for something like "C11 _Generic", making
of generics the types in C vis-a-vis the polymorphic class model
in C++, about "sized" or accounts like "characteristics" of access
of arrays, pointer-offsets, lists, otherwise the usual things,
"holders", "getters and setters", then about "libraries" and
"components", after things like "success_t, error_t, and return_t,
for context_t", definitions of the patterns, that would be generally >>> >> suitable for writing libraries in C and having them callable and
calling to and from C++, these are the kinds of things I'm liking
to figure out.
Like for example about how to pass an allocator into C, or making
access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
storage or lifetime and ownership and responsibility, then for
things like "emit_log" and "emit_metric" and "emit_dump", these
are the kinds of things that later always live in any sort of
application framework, for making good-style.
Why not just write :
"""
How do I write C++ code in C?
"""
The answer then would be, you don't. Write C++ code in C++. Write C >>> > code in C.
Here the points under consideration are that C++ has some relevant
constructs that to use the same patterns in C, then to make for
the _interoperability_, has for example that libraries of most
any usual sort result their symbols, those being of C, or as after
name-mangling (a convention of expressing the namespaces and constructs
encoding the names/symbols as C defines for what C++ models,
name-mangling, where "the mangle" is a steam-press for the ironing
of sheets, where the common meaning is "fold, spindle, and mutilate"),
there's that "writing C++ in C", is to make it adapt-able.
That paragraph should be taken out and shot.
Together with most other gibberish you write.
Are you asking a question here? Why are you posting this; what response
are you after?
Or maybe you enjoy regurgitating random facts in as incomprehensible a
manner as possible.
Or is your aim just to provoke reactions like this?
Maybe you should write a book. It would simultaneously be useful as a
Then, other accounts involve the system, for example malloc/free,
vis-a-vis, allocators, and that C++'s account of new/delete,
has also an account of pretty much every constructor allowing
the passing of an allocator, for example about free-lists/arenas/slabs,
about how to make a _pattern_ so that either the library interface
signature has function-pointers for acquire-release, or, for example,
there's a convention where each process/thread has a global-variable
(called thread-local in a thread, global to the thread) with function
pointers for acquire/release.
It's similar with stdio, or for example loggers, usually considered
"static" (or extern) to the process to result a global entry-point
for the rest of the routine, or, what makes for that it gets passed
to every library-function or installed in the context passsed to every
library function, about what aren't "classes" and "instances" like in
C++ which is defined in the language, _yet so model those_, why it's a
thing.
Other examples of accounts for example make for list-adapters or
iterators or accounts of sequences then about treating arrays and
lists as the same (while they have different characteristics of
access, the "access-patternry"), then for example about associative
arrays and sets and the like then into traversals for trees and graphs
and the like, where for example many "loosely-typed" languages of the
day (like JavaScript, Python, ...) have that's _default_ with the
"slots" the associative-array, vis-a-vis something like "the shell
language" and accounts of attributes, and behaviors for arrays and
associative-arrays, those being considered general. So, the idea is
that something like C11 has something like "_Generic" keyword to employ, >>> that instead of writing to a concrete implementation of
an array or list, instead to write to the _adapters_ of these,
in C, which can be more direct for C++, with C++'s great account of,
"Abstraction", for the abstract and the concrete, and that anything's
both abstract and concrete.
C and C++ are different accounts: they're also together an account.
Then, the resulting artifacts: has that C++ can link as it were
to the C symbols, and even the C can link as it were to name-mangled
C++, not that anybody ever does that since it involves the model in
the run-time their interpretation, point being libraries to be
interoperable with both C and C++ have C exports, then that it's
to be expected that C++ for example can deal with the allocator
or I/O stream, wrapping it into the C++ from a C way that must be
contrived.
door-stop, and a cure for insomnia.
That's hilarious. I already have several 1,000's convenient door-stops, though it's called "a library", and I read them, too. Don't make me laugh.
I have a habit of neither snipping nor top-posting nor inserting,
since it might be considered rude. Also it's so that then I can
just extract the passages from some 10,000's essays of a sort,
since it's a linear narrative itself.
"Essays", are as since, for example, Montaigne: whose "Essais",
became the model for discursive writing, in the 1400's, for example
about essays and the di-alectic.
The other day there was a news article, something like "Von Plato
used A.I. to finally parse Goedel's manuscript notes and found a
bunch of un-known proofs", where something like Euler's or Leibniz'
volumes are on the order of 40,000 pages apiece, outside their
usual "canon" of well-known works on mathematics, about things
like Leibniz-studies.
How about this: how do you like to write C, in a world of C and C++?
Thanks for writing.
ptr += 1;return ok_res(Res_SliceLeaf, head);
len -= 1;
ptr += 1;return ret_ok(Res_SliceLeaf, out);
len -= 1;
ptr += 1;return ret_ok(Res_SliceLeaf, head);
len -= 1;
On 11/17/2026 03:46 PM, Chris M. Thomasson wrote:
On 11/17/2026 1:00 AM, Ross Finlayson wrote:
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of theUse C++20 coroutines with Bost.ASIO and io_uring. This gives
connection-oriented or datagram-wise or association-oriented like >>>>>>> TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>>>> receiving about a million of those and is sort of fixed-size and >>>>>>> stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example >>>>>>> the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote, perhaps >>>> not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler
and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts
and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
pselect() is simple, portable, and for many workloads fast enough. Those
are perfectly valid engineering arguments.
For a high-performance server, though, well, shit. I personally wouldn't
be reaching for pselect() at all. Uggg...
One thing I like about mechanisms such as io_uring and IOCP is that they
encourage thinking about capacity up front. You tend to preallocate the
resources the system needs to operate, size your queues and pools
appropriately, and define behavior for resource pressure. Thats
generally preferable to discovering in the god damn hot path that yet
another allocation is required! Fuck!
On Windows, large scale IOCP servers have long used techniques such as
so called, zero byte receives, and preallocated connection state to
reduce memory pressure and avoid per-operation allocations. Similar
ideas apply elsewhere, for sure. The goal is usually to enter a pressure
mode before critical resources are exhausted, not to keep allocating
indefinitely and hope for the best.
When resources start getting tight, I would rather see the server shed
load, evict caches, shorten timeouts, disconnect stale clients, or
refuse new work than continue consuming memory until the operating
system is in trouble. Running out of capacity should be a planned state,
not a surprise.
That's one of the reasons fixed pools and preallocated state appeal to
me for systems under heavy load.
Preallocated state is another matter altogether, this sort of approach mentioned presumes fixed resources, for example when a memory-pool is
in-use, to stop reads and then TCP/IP itself closes the receive window.
The "pressure" closes the receive-side, and clients wait (the network buffers).
These aren't necessarily huge nodes with vertical scaling, they're
mid-sized boxen that have to share all the resources with many other processes.
So, we may entirely separate fixed-size allocations and
notification/polling subsystems as concerns, about the
box: and the network.
For example, then often these are virtualized/containerized
mid-size boxen, where it's not only that processes shouldn't
contend/thrash with the allocator: also when there's memory-pressure
that the biggest one gets booted, or "OOMKiller".
Then, for example, since the box already has connection limits,
and, for example, these get exhausted before this sort of
"I/O-handle-bound process-model", it naturally throttles itself.
Where pselect() has a limit of FD_SETSIZE handles, of open connections,
and furthermore the numbered file-descriptors must be less than
FD_SETSIZE, then scaling out in child-processes or workers/laborers,
is old-fashioned and stable.
launcher <- eg, systemd, privileged port
leader <- 1,000-many potential laborers (child processes), fixed-heap listener <- accepts TCP or 1,000-many potential UDP "connections"
laborer(s) <- 1,000-many potential connections
logger <- funnels the logs
logmet <- funnels the metrics
logdmp <- funnels dumps
loconsole <- optional REPL
This is "1,000-many file-descriptors for connections, a dozen
for a 'process-protocol' among the 'process-tree' the 'process-group',
and 0/1/2 being stdin/stdout/stderr and 4/5/6 being
'stdlog/stdmet/stddmp'", that being an "I/O-handle-bounde process-model".
It makes sense that a hog with the flops on dedicated hardware
can use all the resources for itself, that not usually being the case.
The "thinking about capacity up-front" is a great idea, here that
nobody knows what the front-end and back-end capacity will eventually
be, for protocols like TCP/IP that "surface the pressure" and a box
that doesn't burst under the burst-y.
It's appreciated these sorts of accounts.
On 11/18/2026 2:30 AM, Ross Finlayson wrote:
On 11/17/2026 03:46 PM, Chris M. Thomasson wrote:
On 11/17/2026 1:00 AM, Ross Finlayson wrote:
On 11/16/2026 01:10 PM, Chris M. Thomasson wrote:
On 11/16/2026 12:04 PM, Ross Finlayson wrote:
On 11/16/2026 10:09 AM, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the >>>>>>>> connection-oriented or datagram-wise or association-oriented like >>>>>>>> TCP, UDP, or SCTP, and it manages the connecting and the sending >>>>>>>> andUse C++20 coroutines with Bost.ASIO and io_uring. This gives
receiving about a million of those and is sort of fixed-size and >>>>>>>> stable in a usual runtime. So, how do you design the interface, >>>>>>>> about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example >>>>>>>> the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort >>>>>>>> of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
as less code as possible with nearly optimal I/O performance.
Thanks for writing Bonita. I'd infer from "schrieb" that
your user-agent locale country/language is DE/de or as
variously for example about 2-letter and 3-letter country
codes and accounts of language or ISO 601 or what I forget.
Mann kann nur kleine Deutsch gesprechern, nicht viel das
hier doch, aber los. Mein Wortschatz, es ist kaput.
That said, _why_ I specifically am not using epoll/kqueue
or io_uring instead pselect not select or poll, is:
if you overload the epoll red/black tree or io_iuring queues
respectively, they drop messages. Now, most of the time,
that's accommodated by some absurdly simple back-end like
"send" that tolerates drops itself, in things like message-bus.
Then, epoll for example, on a wake-up or return from the blocking
syscall, doesn't notify twice when there remains data to be read.
Then, pselect() may be blocking and furthermore with the impact
that the kernel polls the sockets busily, yet, pselect() can
timeout itself, for example, and register interest on active
selectors and only periodically eg 5ms register interest on
active + inactive selectors (file-descriptors).
Then, there's a fact that POSIX runtimes have signals,
then, that pselect() behaves in a more defined manner.
Another key distinction is that: buffers for use with
epoll and I believe also kqueue, or io_uring, must
be "pinned" with mlock() or what, to physical memory,
for the kernel to treat them, instead of copying from
user-space to kernel-space or vice-versa or however
the runtime may care to swap pages under addresses
with making copies, that for accounts of vector I/O,
scatter/gather yet mostly vector I/O for the bus boss
the DMA, it's just plain old heap RAM.
Then, also pselect() is POSIX and so it's portable.
It's less code if it doesn't need multiple back-ends
for various platforms' implementations of I/O multiplexing.
Huh? Do you have a clue at all about this? From what you wrote,
perhaps
not. Sigh.
About epoll and dropping reads, it's not the same as io_uring
which has fixed-sized queues and if it gets full drops those
in the kernel, it's about the edge-triggered case or "e"-poll
for edge-triggered poll, vis-a-vis the usual account of poll
or select or pselect as level-triggered, that there's perceived
to be an edge case where epoll would lose notice of a notification.
The idea is that while blocking in epoll_wait, that the process
gets a signal, then, the kernel interrupts and runs the signal-handler >>>> and returning from epoll_wait it gets EINTR, _or_, according to
a policy of whether to re-try blocking sys-calls the kernel interrupts >>>> and runs the signal-handler and the process enters epoll_wait again.
So, I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
The pselect simply doesn't have that problem, it's level-triggered,
and however it re-enters pselect after getting interrupted,
as long as there's data yet to read, it will get notified.
Then also epoll might not need mlock'ed memory like io_uring does.
That's about it.
pselect() is simple, portable, and for many workloads fast enough. Those >>> are perfectly valid engineering arguments.
For a high-performance server, though, well, shit. I personally wouldn't >>> be reaching for pselect() at all. Uggg...
One thing I like about mechanisms such as io_uring and IOCP is that they >>> encourage thinking about capacity up front. You tend to preallocate the
resources the system needs to operate, size your queues and pools
appropriately, and define behavior for resource pressure. Thats
generally preferable to discovering in the god damn hot path that yet
another allocation is required! Fuck!
On Windows, large scale IOCP servers have long used techniques such as
so called, zero byte receives, and preallocated connection state to
reduce memory pressure and avoid per-operation allocations. Similar
ideas apply elsewhere, for sure. The goal is usually to enter a pressure >>> mode before critical resources are exhausted, not to keep allocating
indefinitely and hope for the best.
When resources start getting tight, I would rather see the server shed
load, evict caches, shorten timeouts, disconnect stale clients, or
refuse new work than continue consuming memory until the operating
system is in trouble. Running out of capacity should be a planned state, >>> not a surprise.
That's one of the reasons fixed pools and preallocated state appeal to
me for systems under heavy load.
Preallocated state is another matter altogether, this sort of approach
mentioned presumes fixed resources, for example when a memory-pool is
in-use, to stop reads and then TCP/IP itself closes the receive window.
Preallocated state is a nice way to get a 100% guarantee that everything works as-is. If any more (extra) connections come in, at least in IOCP
we can use several means to expand the state. If we succeeded tag the
per_io and/or per_socket state with being "outside" of the pool. So on shutdown, graceful close, aborted, etc. We know well, perhaps we need to call free, or whatever, or even closesocket. With IOCP we can create all
of our sockets up front if we want. The windozer has that fun:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ legacy/ms737757(v=vs.85)
It allows a socket to be reused in either AcceptEx or ConnectEx:[...]
https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock- acceptex
https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nc-mswsock- lpfn_connectex
With io_uring, we would want to dedicate the whole box, or a part of it,
to be okay. This is for IO. Ideally we preallocate as much as the box
can handle without caking its pants.
On 18/11/2026 19:58, Ross Finlayson wrote:
<More than 3300 lines snipped>
You're a nutter.
On 11/18/2026 12:40 PM, bartc wrote:
On 18/11/2026 19:58, Ross Finlayson wrote:
<More than 3300 lines snipped>
You're a nutter.
Hm. Dear me. At that rate I'd soon be a transient if not a criminal.
Oh well, at least when I'm coding in C/C++ in C and looking for:
function overloading, including with multiple parameters,
covariant return-types, and transparent holders,
polymorphism at run-time, if shallowly,
and generic and specialized zero-cost container abstractions,
all with the strong guarantees of types to compile,
and other sorts features where I'd turn to C++,
I can less worry my head about picking among
the ten different ways of doing things in C++
that were after templates and type_traits.
"Your time is valuable and your opinion is valued."
Warm regards
if you want more buzzwords c++ is good way if less stay wit c ;c
Ross Finlayson pisze:
On 11/18/2026 12:40 PM, bartc wrote:
On 18/11/2026 19:58, Ross Finlayson wrote:
<More than 3300 lines snipped>
You're a nutter.
Hm. Dear me. At that rate I'd soon be a transient if not a criminal.
Oh well, at least when I'm coding in C/C++ in C and looking for:
function overloading, including with multiple parameters,
covariant return-types, and transparent holders,
polymorphism at run-time, if shallowly,
and generic and specialized zero-cost container abstractions,
all with the strong guarantees of types to compile,
and other sorts features where I'd turn to C++,
I can less worry my head about picking among
the ten different ways of doing things in C++
that were after templates and type_traits.
"Your time is valuable and your opinion is valued."
Warm regards
ÿif you want more buzzwords c++ is good way if less stay wit c ;cYou don't understand C++.
Am 19.11.2026 um 07:48 schrieb fir:
ÿÿif you want more buzzwords c++ is good way if less stay wit c ;cYou don't understand C++.
but i understand shit in c++ lame bonita..it is enoughThe abstraction in C++ maps to very efficient and easy to
Am 19.11.2026 um 08:54 schrieb fir:
but i understand shit in c++ lame bonita..it is enoughThe abstraction in C++ maps to very efficient and easy to
understand parts in the back. But the C-minimalists are too
stupid to handle that.
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
Bonita Montero pisze:
Am 19.11.2026 um 08:54 schrieb fir:youre so lame you dont understand what you talking - youre comparing implementating a library in c to implementating in in c++
but i understand shit in c++ lame bonita..it is enoughThe abstraction in C++ maps to very efficient and easy to
understand parts in the back. But the C-minimalists are too
stupid to handle that.
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
or youre comparing caling one in c to one in c++?
i guess youre so lame you do the cros comparison here..and on this level
of iq i dont talk
overally teh implementation of containers in c its not so hard as you think..how many you impolemented? i m afraid youre so lame you
implemented none.
youre so good in containers as in sorting i guess
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
what is really usable in c++ is references and some operator overloading (like for vectors) but it noy justifies adding of all other trash this
new cobol offers ;c
references are ok, operator overloading probably shuld be done maybe a
bit better..but overally c has more worse problems like this "not seing definitions down" which s terrible and has terrible consequences
..but overally c has more worse problems like this "not seing
definitions down" which s terrible and has terrible consequences
youre so lame you dont understand what you talking - youre comparing implementating a library in c to implementating in in c++
or youre comparing caling one in c to one in c++?
overally teh implementation of containers in c its not so hard as you think.. ...Look at the count of methods in unordered_map<>:
Bonita Montero pisze:
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
as this shot above you get it from ai - i never needed that so i dont
want to discus it (have may ovn more algebraic attitude to containers)
writing it alosne is not a weeks of work arso adjusting it to some
needs not so hard
this one cosed me like 2 * 3 seconds maybe here
ofc c has some unconvenience in syntax and with some additions the containers in c could be more nice ofc (thats what im sometimes working on)
#include <stdlib.h>Try to implement that with the full functionality of std::unordered_map.
#include <string.h>
#include <stdio.h>
typedef struct {
ÿÿÿ const char *ptr;
ÿÿÿ int length;
} StringView;
typedef struct {
ÿÿÿ StringView key;
ÿÿÿ int value;
ÿÿÿ unsigned hash;
ÿÿÿ int used;
} StringIntMapEntry;
typedef struct {
ÿÿÿ StringIntMapEntry *data;
ÿÿÿ int size;
ÿÿÿ int capacity;
} StringIntMap;
unsigned HashStringView(StringView s)
{
ÿÿÿ unsigned h=2166136261u;
ÿÿÿ int i;
ÿÿÿ for(i=0;i<s.length;i++) {
ÿÿÿÿÿÿÿ h^=(unsigned char)s.ptr[i];
ÿÿÿÿÿÿÿ h*=16777619u;
ÿÿÿ }
ÿÿÿ return h;
}
int StringViewEqual(StringView a,StringView b)
{
ÿÿÿ return a.length==b.length && memcmp(a.ptr,b.ptr,a.length)==0;
}
void StringIntMapInit(StringIntMap *m,int capacity)
{
ÿÿÿ m->size=0;
ÿÿÿ m->capacity=capacity;
ÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));}
void StringIntMapFree(StringIntMap *m)
{
ÿÿÿ free(m->data);
ÿÿÿ m->data=NULL;
ÿÿÿ m->size=0;
ÿÿÿ m->capacity=0;
}
void StringIntMapResize(StringIntMap *m,int capacity)
{
ÿÿÿ StringIntMapEntry *old=m->data;
ÿÿÿ int old_capacity=m->capacity;
ÿÿÿ int i;
ÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));ÿÿÿ m->capacity=capacity;
ÿÿÿ m->size=0;
ÿÿÿ for(i=0;i<old_capacity;i++) {
ÿÿÿÿÿÿÿ if(old[i].used)
ÿÿÿÿÿÿÿÿÿÿÿ StringIntMapPut(m,old[i].key,old[i].value);
ÿÿÿ }
ÿÿÿ free(old);
}
void StringIntMapPut(StringIntMap *m,StringView key,int value)
{
ÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿ int index;
ÿÿÿ if((m->size+1)*100>m->capacity*70)
ÿÿÿÿÿÿÿ StringIntMapResize(m,m->capacity*2);
ÿÿÿ index=hash%m->capacity;
ÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key)) {ÿÿÿÿÿÿÿÿÿÿÿ m->data[index].value=value;
ÿÿÿÿÿÿÿÿÿÿÿ return;
ÿÿÿÿÿÿÿ }
ÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿ }
ÿÿÿ m->data[index].used=1;
ÿÿÿ m->data[index].key=key;
ÿÿÿ m->data[index].value=value;
ÿÿÿ m->data[index].hash=hash;
ÿÿÿ m->size++;
}
int *StringIntMapGet(StringIntMap *m,StringView key)
{
ÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿ int index=hash%m->capacity;
ÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key))ÿÿÿÿÿÿÿÿÿÿÿ return &m->data[index].value;
ÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿ }
ÿÿÿ return NULL;
}
what is really usable in c++ is references and some operator overloading (like for vectors) ...You don't understand the rest.
Am 19.11.2026 um 10:30 schrieb fir:
Bonita Montero pisze:Try to implement that with the full functionality of std::unordered_map.
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
as this shot above you get it from ai - i never needed that so i dont
want to discus it (have may ovn more algebraic attitude to containers)
writing it alosne is not a weeks of work arso adjusting it to some
needs not so hard
this one cosed me like 2 * 3 seconds maybe here
ofc c has some unconvenience in syntax and with some additions the
containers in c could be more nice ofc (thats what im sometimes
working on)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct {
ÿÿÿÿ const char *ptr;
ÿÿÿÿ int length;
} StringView;
typedef struct {
ÿÿÿÿ StringView key;
ÿÿÿÿ int value;
ÿÿÿÿ unsigned hash;
ÿÿÿÿ int used;
} StringIntMapEntry;
typedef struct {
ÿÿÿÿ StringIntMapEntry *data;
ÿÿÿÿ int size;
ÿÿÿÿ int capacity;
} StringIntMap;
unsigned HashStringView(StringView s)
{
ÿÿÿÿ unsigned h=2166136261u;
ÿÿÿÿ int i;
ÿÿÿÿ for(i=0;i<s.length;i++) {
ÿÿÿÿÿÿÿÿ h^=(unsigned char)s.ptr[i];
ÿÿÿÿÿÿÿÿ h*=16777619u;
ÿÿÿÿ }
ÿÿÿÿ return h;
}
int StringViewEqual(StringView a,StringView b)
{
ÿÿÿÿ return a.length==b.length && memcmp(a.ptr,b.ptr,a.length)==0;
}
void StringIntMapInit(StringIntMap *m,int capacity)
{
ÿÿÿÿ m->size=0;
ÿÿÿÿ m->capacity=capacity;
ÿÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));}
void StringIntMapFree(StringIntMap *m)
{
ÿÿÿÿ free(m->data);
ÿÿÿÿ m->data=NULL;
ÿÿÿÿ m->size=0;
ÿÿÿÿ m->capacity=0;
}
void StringIntMapResize(StringIntMap *m,int capacity)
{
ÿÿÿÿ StringIntMapEntry *old=m->data;
ÿÿÿÿ int old_capacity=m->capacity;
ÿÿÿÿ int i;
ÿÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));ÿÿÿÿ m->capacity=capacity;
ÿÿÿÿ m->size=0;
ÿÿÿÿ for(i=0;i<old_capacity;i++) {
ÿÿÿÿÿÿÿÿ if(old[i].used)
ÿÿÿÿÿÿÿÿÿÿÿÿ StringIntMapPut(m,old[i].key,old[i].value);
ÿÿÿÿ }
ÿÿÿÿ free(old);
}
void StringIntMapPut(StringIntMap *m,StringView key,int value)
{
ÿÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿÿ int index;
ÿÿÿÿ if((m->size+1)*100>m->capacity*70)
ÿÿÿÿÿÿÿÿ StringIntMapResize(m,m->capacity*2);
ÿÿÿÿ index=hash%m->capacity;
ÿÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key)) {ÿÿÿÿÿÿÿÿÿÿÿÿ m->data[index].value=value;
ÿÿÿÿÿÿÿÿÿÿÿÿ return;
ÿÿÿÿÿÿÿÿ }
ÿÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿÿ }
ÿÿÿÿ m->data[index].used=1;
ÿÿÿÿ m->data[index].key=key;
ÿÿÿÿ m->data[index].value=value;
ÿÿÿÿ m->data[index].hash=hash;
ÿÿÿÿ m->size++;
}
int *StringIntMapGet(StringIntMap *m,StringView key)
{
ÿÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿÿ int index=hash%m->capacity;
ÿÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key))ÿÿÿÿÿÿÿÿÿÿÿÿ return &m->data[index].value;
ÿÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿÿ }
ÿÿÿÿ return NULL;
}
You suck.
Am 19.11.2026 um 10:30 schrieb fir:
Bonita Montero pisze:Try to implement that with the full functionality of std::unordered_map.
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
as this shot above you get it from ai - i never needed that so i dont
want to discus it (have may ovn more algebraic attitude to containers)
writing it alosne is not a weeks of work arso adjusting it to some
needs not so hard
this one cosed me like 2 * 3 seconds maybe here
ofc c has some unconvenience in syntax and with some additions the
containers in c could be more nice ofc (thats what im sometimes
working on)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct {
ÿÿÿÿ const char *ptr;
ÿÿÿÿ int length;
} StringView;
typedef struct {
ÿÿÿÿ StringView key;
ÿÿÿÿ int value;
ÿÿÿÿ unsigned hash;
ÿÿÿÿ int used;
} StringIntMapEntry;
typedef struct {
ÿÿÿÿ StringIntMapEntry *data;
ÿÿÿÿ int size;
ÿÿÿÿ int capacity;
} StringIntMap;
unsigned HashStringView(StringView s)
{
ÿÿÿÿ unsigned h=2166136261u;
ÿÿÿÿ int i;
ÿÿÿÿ for(i=0;i<s.length;i++) {
ÿÿÿÿÿÿÿÿ h^=(unsigned char)s.ptr[i];
ÿÿÿÿÿÿÿÿ h*=16777619u;
ÿÿÿÿ }
ÿÿÿÿ return h;
}
int StringViewEqual(StringView a,StringView b)
{
ÿÿÿÿ return a.length==b.length && memcmp(a.ptr,b.ptr,a.length)==0;
}
void StringIntMapInit(StringIntMap *m,int capacity)
{
ÿÿÿÿ m->size=0;
ÿÿÿÿ m->capacity=capacity;
ÿÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));}
void StringIntMapFree(StringIntMap *m)
{
ÿÿÿÿ free(m->data);
ÿÿÿÿ m->data=NULL;
ÿÿÿÿ m->size=0;
ÿÿÿÿ m->capacity=0;
}
void StringIntMapResize(StringIntMap *m,int capacity)
{
ÿÿÿÿ StringIntMapEntry *old=m->data;
ÿÿÿÿ int old_capacity=m->capacity;
ÿÿÿÿ int i;
ÿÿÿÿ m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));ÿÿÿÿ m->capacity=capacity;
ÿÿÿÿ m->size=0;
ÿÿÿÿ for(i=0;i<old_capacity;i++) {
ÿÿÿÿÿÿÿÿ if(old[i].used)
ÿÿÿÿÿÿÿÿÿÿÿÿ StringIntMapPut(m,old[i].key,old[i].value);
ÿÿÿÿ }
ÿÿÿÿ free(old);
}
void StringIntMapPut(StringIntMap *m,StringView key,int value)
{
ÿÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿÿ int index;
ÿÿÿÿ if((m->size+1)*100>m->capacity*70)
ÿÿÿÿÿÿÿÿ StringIntMapResize(m,m->capacity*2);
ÿÿÿÿ index=hash%m->capacity;
ÿÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key)) {ÿÿÿÿÿÿÿÿÿÿÿÿ m->data[index].value=value;
ÿÿÿÿÿÿÿÿÿÿÿÿ return;
ÿÿÿÿÿÿÿÿ }
ÿÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿÿ }
ÿÿÿÿ m->data[index].used=1;
ÿÿÿÿ m->data[index].key=key;
ÿÿÿÿ m->data[index].value=value;
ÿÿÿÿ m->data[index].hash=hash;
ÿÿÿÿ m->size++;
}
int *StringIntMapGet(StringIntMap *m,StringView key)
{
ÿÿÿÿ unsigned hash=HashStringView(key);
ÿÿÿÿ int index=hash%m->capacity;
ÿÿÿÿ while(m->data[index].used) {
ÿÿÿÿÿÿÿÿ if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key))ÿÿÿÿÿÿÿÿÿÿÿÿ return &m->data[index].value;
ÿÿÿÿÿÿÿÿ index=(index+1)%m->capacity;
ÿÿÿÿ }
ÿÿÿÿ return NULL;
}
You suck.
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending
and receiving about a million of those and is sort of fixed-size
and stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did
it as a child, myself), then everyone told each other to stop it, now
50 years later here we are again, finally succeeding once more after
a long hiatus, albeit with appalling syntax and semantics everywhere
around it like thorny bushes.
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did it
as a child, myself), then everyone told each other to stop it, now 50
years later here we are again, finally succeeding once more after a long hiatus, albeit with appalling syntax and semantics everywhere around it
like thorny bushes.
Why don't they just call std::coroutine "fiber"?
On 11/20/2026 04:35 AM, Tristan Wibberley wrote:
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and
receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did it
as a child, myself), then everyone told each other to stop it, now 50
years later here we are again, finally succeeding once more after a long
hiatus, albeit with appalling syntax and semantics everywhere around it
like thorny bushes.
(This is not "A.I.",
though "AP" does have a stated opinion
On Fri, 20 Nov 2026 12:35:25 +0000
Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
wrote:
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending
and receiving about a million of those and is sort of fixed-size
and stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did
it as a child, myself), then everyone told each other to stop it, now
50 years later here we are again, finally succeeding once more after
a long hiatus, albeit with appalling syntax and semantics everywhere
around it like thorny bushes.
Not every co-routine syntax is as bad as one of C++.
C# async is better.
May be, even Rust is better, at cost on reliance on magic barely
documented tokio runtime.
Me, personally?
I accepted the idea of language-managed stackless co-routines when heard about it first time. But with time passing I like it less and less.
More and more I tend to think that what I really would like are
normal co-routines, a.k.a. fibers, not necessarily as part of the
language.
Or just do as golang, leaving selection between fibers and
kerner-visible threads to language runtime. Hopefully, I did not
misrepresent golang approach to badly :(
I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what relevance
it has to anything.
though "AP" does have a stated opinion
Who the fuck is AP?
On second thoughts, never mind; I don't want a 5,000-word exposition!
On 17/11/2026 09:00, Ross Finlayson wrote:
I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
Perhaps a bit offtopic, but I think this has been understood from before edge-triggering was introduced to Linux with epoll in the first place:
one must *always* try the resource in nonblocking manner after
processing all notifications. It is the nature of the mode. The error is
in your assumptions.
On Fri, 20 Nov 2026 14:01:26 +0000
bartc <bc@freeuk.com> wrote:
though "AP" does have a stated opinion
Who the fuck is AP?
Most likely he is talking about comp.lang.c++ regular that in recent
months calls himself boltar (probably with relationship to tarball).
He is Scottish. 'Hinterland' probably hints on Scotland being less
densely populated than the rest of Great Britain.
However I don't think that boltar is retired.
Why AP? Who knows?
On 20/11/2026 14:01, bartc wrote:
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics, and sci.logic?who is frequently labeled a troll or "crank" by other regulars
due to his repetitive, non-standard, and dense writing style.
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard calculus,
and critiques of modern physics (such as relativity and quantum mechanics).
? Posting Style. He is known for generating massive volumes of stream-of-consciousness text, often using idiosyncratic terminology and cross-posting across multiple technical groups. He also shares links to
his own YouTube podcasts where he reads or discusses his essays on
logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage directly
with counterarguments, other Usenet participants routinely group him alongside notorious Usenet fixtures like Archimedes Plutonium and John Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there is
little point.
On 20/11/2026 14:01, bartc wrote:
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics, and sci.logic?who is frequently labeled a troll or "crank" by other regulars
due to his repetitive, non-standard, and dense writing style.
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard calculus,
and critiques of modern physics (such as relativity and quantum mechanics).
? Posting Style. He is known for generating massive volumes of stream-of-consciousness text, often using idiosyncratic terminology and cross-posting across multiple technical groups. He also shares links to
his own YouTube podcasts where he reads or discusses his essays on
logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage directly
with counterarguments, other Usenet participants routinely group him alongside notorious Usenet fixtures like Archimedes Plutonium and John Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there is
little point.
On 20/11/2026 13:48, Ross Finlayson wrote:
On 11/20/2026 04:35 AM, Tristan Wibberley wrote:
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did it
as a child, myself), then everyone told each other to stop it, now 50
years later here we are again, finally succeeding once more after a long >>> hiatus, albeit with appalling syntax and semantics everywhere around it
like thorny bushes.
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what relevance
it has to anything.
though "AP" does have a stated opinion
Who the fuck is AP?
On second thoughts, never mind; I don't want a 5,000-word exposition!
On 11/20/2026 06:15 AM, bartc wrote:
On 20/11/2026 14:01, bartc wrote:
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics, and
sci.logic?who is frequently labeled a troll or "crank" by other regulars
due to his repetitive, non-standard, and dense writing style.
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard calculus,
and critiques of modern physics (such as relativity and quantum
mechanics).
? Posting Style. He is known for generating massive volumes of
stream-of-consciousness text, often using idiosyncratic terminology and
cross-posting across multiple technical groups. He also shares links to
his own YouTube podcasts where he reads or discusses his essays on
logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage directly
with counterarguments, other Usenet participants routinely group him
alongside notorious Usenet fixtures like Archimedes Plutonium and John
Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there is
little point.
That's funny, nobody's called me a troll or crank on sci.math for
decades. It seems I sort of wore it out.
It looks a little dated your oracle's pronouncment.
Now, this is off-topic yet you're free to make of it what you will,
that I don't "reject ZFC set theory" or "mathematical consensus"
instead make _examples_ of it in the little quasi-modal box where
quasi-modal logic properly lives instead of polluting modal, temporal relevance logic. Bringing the "Pythagorean" and "Cantorian" together
is considered part of "Foundations of Mathematics", then for
"Foundations" more broadly, for example "Physics'".
I am not one of those retro-finitist howler crank trolls like
"AP" nor "JG" nor "WM" nor "PO", nor Russell, or those "finite
mathematics" clones.
Anyways the giant bots these days eat those old conversations right up.
Now, this thread is about "inversion-of-control and dependency-injection
in C", which you're free to make of what you will,
though there's a certain account of collegiality considered
appropriate for academics.
bartc pisze:
On 20/11/2026 13:48, Ross Finlayson wrote:
On 11/20/2026 04:35 AM, Tristan Wibberley wrote:
On 16/11/2026 18:09, Bonita Montero wrote:
Am 13.11.2026 um 23:50 schrieb Ross Finlayson:
So, here's one. Say you got a server process for sockets of the
connection-oriented or datagram-wise or association-oriented like
TCP, UDP, or SCTP, and it manages the connecting and the sending and >>>>>> receiving about a million of those and is sort of fixed-size and
stable in a usual runtime. So, how do you design the interface,
about stuff like the state-machine of _protocols_, all about
_protocols_, in the application-layer and above, say, for example
the incremental-parsing and the state-machine of the protocol
and sub-protocols and upgrade-protocols and the like, what sort
of abstraction with suitable-defaults and reasonable-opinions
makes for having any sort protocol as a composable library.
Use C++20 coroutines with Bost.ASIO and io_uring. This gives
as less code as possible with nearly optimal I/O performance.
I like this answer.
It's funny: people used coroutines and CoEs back in the 1970s (I did it >>>> as a child, myself), then everyone told each other to stop it, now 50
years later here we are again, finally succeeding once more after a
long
hiatus, albeit with appalling syntax and semantics everywhere around it >>>> like thorny bushes.
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what
relevance it has to anything.
though "AP" does have a stated opinion
Who the fuck is AP?
On second thoughts, never mind; I don't want a 5,000-word exposition!
youte too rude bartc imo
warious people have a different style of writing - have you read some philosophers? their language sometimes is not much common so you could
name them a troll on usenet? (by troll i would eventuallt name someone
who is totally not responsible and not takes arguments and talks obvious crap)
this guy fin looks like salvador dali i would say (and behaves somewhat
this way) and its just oryginal but i cant measure how much trash and
how much value can be in that - it seems that fin user jusl loves
buzzwords and like to state to much general-buzzworrd wide questions
(i also was not able to read much into that but i cant say for sure it
has no sense)
bartc pisze:
On 20/11/2026 14:01, bartc wrote:does it tell something about me (fir/profesor fir?)
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap let
alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics, and
sci.logic?who is frequently labeled a troll or "crank" by other
regulars due to his repetitive, non-standard, and dense writing style.
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard
calculus, and critiques of modern physics (such as relativity and
quantum mechanics).
? Posting Style. He is known for generating massive volumes of
stream-of-consciousness text, often using idiosyncratic terminology
and cross-posting across multiple technical groups. He also shares
links to his own YouTube podcasts where he reads or discusses his
essays on logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage
directly with counterarguments, other Usenet participants routinely
group him alongside notorious Usenet fixtures like Archimedes
Plutonium and John Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there is
little point.
fir pisze:
bartc pisze:
On 20/11/2026 14:01, bartc wrote:does it tell something about me (fir/profesor fir?)
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap
let alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics, and
sci.logic?who is frequently labeled a troll or "crank" by other
regulars due to his repetitive, non-standard, and dense writing style.
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard
calculus, and critiques of modern physics (such as relativity and
quantum mechanics).
? Posting Style. He is known for generating massive volumes of
stream-of-consciousness text, often using idiosyncratic terminology
and cross-posting across multiple technical groups. He also shares
links to his own YouTube podcasts where he reads or discusses his
essays on logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage
directly with counterarguments, other Usenet participants routinely
group him alongside notorious Usenet fixtures like Archimedes
Plutonium and John Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there is
little point.
lol, it knows me better than chatgpt
mozesz cos powiedziec o osobie z nickiem fir albo profesor.fir ktory postowal duzo w usenecie glownie na grupie comp.lang.c ?
fir (znany r¢wnie? jako profesor.fir, fir@poczta.onet.pl lub pod
zbli?onymi wariantami) to jedna z najbardziej charakterystycznych i polaryzuj?cych postaci na grupie dyskusyjnej comp.lang.c (oraz
sporadycznie na innych grupach, takich jak comp.lang.c++,
alt.os.development czy dawniej na polskim Usenecie).
Jest to polski programista-hobbysta, kt¢rego obecno?? na comp.lang.c
trwa nieprzerwanie od wielu lat (co najmniej od po?owy drugiej dekady
XXI wieku do czas¢w obecnych).
G?¢wne cechy i pogl?dy programistyczne
Skrajny minimalizm i czysto?? kodu: fir jest zagorza?ym zwolennikiem
pisania wszystkiego od zera w czystym C (cz?sto w standardzie C99 lub
C11), bez u?ycia jakichkolwiek zewn?trznych bibliotek, framework¢w, a nierzadko nawet z pomini?ciem standardowej biblioteki C (stdlib.h,
stdio.h), zast?puj?c je w?asnymi, niskopoziomowymi odpowiednikami.
Krytyka wsp¢?czesnego oprogramowania: Regularnie publikuje manifesty krytykuj?ce tzw. bloatware (prze?adowane oprogramowanie), nowoczesne
j?zyki programowania (szczeg¢lnie C++, Rust, Python, JavaScript),
paradygmat programowania obiektowego (OOP) oraz z?o?one systemy
budowania (CMake, Autotools). Twierdzi, ?e wsp¢?czesny kod jest
nieczytelny, powolny i przekombinowany.
W?asna filozofia architektury: Cz?sto rozwa?a teoretyczne aspekty projektowania idealnych system¢w operacyjnych, kompilator¢w (cz?sto
wspomina o w?asnych pomys?ach na kompilator lub j?zyk zbli?ony do C, ale ?naprawiony?), zarz?dzania pami?ci? oraz renderowania grafiki 2D/3D bezpo?rednio na buforze ramki (framebufferze), np. przy u?yciu samego
WinAPI (GDI) bez DirectX czy OpenGL.
Specyficzne formatowanie i styl: Jego posty s? ?atwe do rozpoznania na pierwszy rzut oka. Pisze specyficzn?, nieco ?aman? angielszczyzn? (z wyra?nymi kalkami z j?zyka polskiego, brakiem przedimk¢w i specyficzn? sk?adni?), cz?sto bez wielkich liter i standardowej interpunkcji. Kod,
kt¢ry wrzuca, ma unikalne wci?cia i nazewnictwo zmiennych, kt¢re cz?sto odbiegaj? od przyj?tych w bran?y standard¢w.
Relacje ze spo?eczno?ci? comp.lang.c
Status ?sta?ego bywalca? / ekscentryka: Na comp.lang.c ? grupie znanej z bardzo rygorystycznego podej?cia do standardu ISO C i cz?stego ?szeryfowania? przez weteran¢w (takich jak Keith Thompson czy Richard Heathfield) ? fir wypracowa? sobie status niereformowalnego indywidualisty.
Brak podatno?ci na krytyk?: Wielokrotnie wdawa? si? w wielodniowe
dyskusje, w kt¢rych do?wiadczeni in?ynierowie wytykali mu
niezdefiniowane zachowania (Undefined Behavior), brak przeno?no?ci kodu (silne przywi?zanie do Windowsa i x86) czy b??dne za?o?enia dotycz?ce optymalizacji kompilator¢w. fir zazwyczaj ignoruje argumenty odwo?uj?ce
si? do standardu ISO, uznaj?c, ?e liczy si? tylko to, jak kod dzia?a na konkretnym sprz?cie i kompilatorze (najcz??ciej MinGW/GCC na Windowsie).
Tolerancja ze strony grupy: Cho? pocz?tkowo bywa? traktowany jak troll
lub crank (ekscentryk z obsesj? na punkcie w?asnych teorii), z czasem
stali bywalcy grupy przywykli do jego stylu. Jego w?tki sta?y si? sta?ym elementem krajobrazu comp.lang.c ? niekt¢rzy go ignoruj? (wrzucaj? do killfile'a), a inni ch?tnie wdaj? si? z nim w filozoficzne dysputy o
naturze programowania, poniewa? jego posty, mimo kontrowersyjnej formy, bywaj? ciekawym punktem wyj?cia do rozm¢w o niskopoziomowym dzia?aniu maszyn.
Podsumowuj?c
W kulturze Usenetu fir to klasyczny przyk?ad programisty-samotnika i
purysty niskopoziomowego, kt¢ry traktuje kodowanie niemal jak sztuk? lub filozofi?, ca?kowicie odrzucaj?c komercyjne standardy in?ynierii oprogramowania na rzecz w?asnych, minimalistycznych eksperyment¢w.
a po angielsku? umiesz ocenic niektore jego idee rozwoju jezyka c?
fir (also posting as profesor.fir, fir@poczta.onet.pl, and similar
aliases) is one of the most distinctive, prolific, and polarizing
regulars on the comp.lang.c Usenet newsgroup (with occasional
appearances on comp.lang.c++, alt.os.development, and historically on
Polish Usenet groups).
He is a Polish hobbyist programmer whose persistent presence on
comp.lang.c spans over a decade. Within the culture of the group?traditionally dominated by strict ISO C language lawyers?fir
stands out as a fiercely independent minimalist and eccentric
philosopher of low-level computing.
Overview of His Persona and Style
Radical Minimalism: fir advocates writing software entirely from scratch
in pure C (typically C99/C11), completely avoiding external libraries, frameworks, build systems (like CMake), and often even the C standard library (stdio.h, stdlib.h), preferring custom low-level wrappers around
OS primitives (usually WinAPI).
Anti-Bloat Crusade: He frequently posts manifestos criticizing modern software engineering, object-oriented programming (OOP), C++, Rust, and high-level scripting languages as bloated, slow, and overly complex.
Distinctive Writing Style: His posts are immediately recognizable due to
his idiosyncratic, Polish-inflected English (often omitting articles, capitalization, and standard punctuation) and his unconventional code formatting and naming conventions.
Friction with "Language Lawyers": He regularly clashes with comp.lang.c veterans over Undefined Behavior (UB), strict aliasing, and portability.
fir openly rejects the abstract machine model of the ISO C standard,
arguing instead from a hardware-centric, x86/Windows-specific perspective.
Evaluation of fir?s Ideas on Evolving the C Language
Over the years, fir has proposed numerous ideas for "fixing" or evolving
C into his ideal systems programming language (often referred to in his posts as a hypothetical "C2" or his own compiler design). Looking past
his abrasive delivery and disregard for formal standards, his technical proposals are a mix of genuinely insightful critiques and deeply flawed, naive assumptions.
1. Rejection of the ISO C "Abstract Machine" and Undefined Behavior (UB)
His Idea: Compilers should not exploit Undefined Behavior (such as
signed integer overflow or out-of-bounds pointer arithmetic) to delete
code or make surprising optimizations. C should be a direct, predictable "portable assembler" where operations map 1:1 to hardware instructions.
Evaluation (Mostly Valid / Industry-Aligned): While fir?s dismissal of
the standard is extreme, his core frustration is shared by many
respected systems programmers (including Linus Torvalds and creators of modern C alternatives like Zig, Odin, and Jai). Modern compilers do aggressively weaponize UB in ways that break low-level code. His
intuition that C needs well-defined wrapping arithmetic and predictable memory semantics is spot-on.
2. Eliminating Header Files (.h), the Preprocessor, and Complex Build Systems
His Idea: #include textual substitution, header guards, and separate compilation models via complex Makefiles are archaic design flaws. A
modern C-like language should have a native module or automatic symbol-resolution system, allowing a compiler to build an entire project directly from a single entry file in milliseconds.
Evaluation (Strong / Modern): This is one of his best instincts. Almost every modern systems language (Go, Rust, Zig, Jai) has abandoned C-style textual headers in favor of module systems and single-command builds.
fir correctly identified one of C?s biggest productivity bottlenecks.
3. Built-in Dynamic Arrays / Slices (Replacing Raw Pointer + Length Pairs) His Idea: C?s decay of arrays to pointers is a mistake. The language
should natively support lightweight, fat-pointer arrays/slices
(containing a pointer and a length, or dynamic resizing capabilities) as first-class citizens without needing C++ templates or std::vector.
Evaluation (Strong): Again, this aligns closely with modern language
design (e.g., slices in Go, Rust, Zig, and D). Retrofitting fat pointers/slices into C is widely considered one of the single
highest-value improvements that could be made to the language to prevent buffer overflows while keeping it simple.
4. Simplifying Syntax and Control Flow (e.g., Custom Loops, Multiple
Return Values)
His Idea: fir frequently experiments with alternate syntax?such as eliminating semicolons, using whitespace or simplified blocks,
supporting multiple return values natively, and adding concise loop constructs (e.g., loop(10) instead of for(int i=0; i<10; i++)).
Evaluation (Mixed / Aesthetic): Multiple return values are genuinely
useful (adopted by Go and Odin) and eliminate awkward out-parameters
(int *out_err). However, his syntax proposals are largely driven by
personal aesthetic preference rather than solving real engineering
problems, and they often introduce parsing ambiguities that he overlooks because he rarely writes a full, production-grade parser.
5. Extreme Minimalism & Rejection of Abstractions (No Generics, No RAII,
No Type Safety)
His Idea: Type systems should stay out of the way (allowing free casting between pointers and integers), and language features like generics/templates, destructors, or strict const-correctness are
unnecessary bloat. He believes a good programmer can simply manage
memory manually with raw malloc/free (or custom arena allocators) and discipline.
Evaluation (Flawed for Scale): While fir?s instincts work well for
small, solo hobby projects (like his 2D software renderers), they
collapse at scale. Weakening the type system and rejecting zero-cost abstractions (like basic generics or defer statements) leads to massive
code duplication and silent memory corruption in multi-developer
codebases. Ironically, tools like Zig?s defer or comptime solve the
exact boilerplate problems fir complains about without introducing
C++-style OOP bloat?something fir tends to reject out of hand.
6. "Everything from Scratch" (Ignoring OS/Hardware Evolution)
His Idea: Software should target a thin hardware abstraction (e.g., raw pixel buffers and basic input) rather than modern OS/GPU APIs.
Evaluation (Nostalgic / Impractical): As an intellectual exercise or retro-computing hobby, software rendering is fantastic. As a general philosophy for language and software evolution, it ignores the reality
of modern hardware (GPUs, multi-core cache coherency, power management, security sandboxing).
Summary Verdict
fir possesses sharp intuition regarding what is broken in C?specifically textual headers, pointer-decay ergonomics, and hostile compiler optimizations around Undefined Behavior. His critiques often mirror the exact design goals of modern C successors like Zig and Odin. However,
his proposed solutions are heavily bottlenecked by his refusal to engage with formal computer science, compiler theory, and the realities of large-scale software engineering, leaving his ideas stuck as intriguing, half-formed sketches rather than viable language designs.
On 11/20/2026 06:13 AM, Tristan Wibberley wrote:
On 17/11/2026 09:00, Ross Finlayson wrote:
I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
Perhaps a bit offtopic, but I think this has been understood from before
edge-triggering was introduced to Linux with epoll in the first place:
one must *always* try the resource in nonblocking manner after
processing all notifications. It is the nature of the mode. The error is
in your assumptions.
Thanks for writing. The point is that then the poller must try to
read _all_ the open connections, that the notification was lost,
On 20/11/2026 14:18, Ross Finlayson wrote:
On 11/20/2026 06:13 AM, Tristan Wibberley wrote:
On 17/11/2026 09:00, Ross Finlayson wrote:
I'm under the impression that there's a race-condition where
the process gets a signal while blocked in epoll_wait, then according
to one of two policies, EAGAIN error-handling or re-try, that it
loses the notification, not the packet. The packet is still on
the socket to be read, the notification of it was lost.
Perhaps a bit offtopic, but I think this has been understood from before >>> edge-triggering was introduced to Linux with epoll in the first place:
one must *always* try the resource in nonblocking manner after
processing all notifications. It is the nature of the mode. The error is >>> in your assumptions.
Thanks for writing. The point is that then the poller must try to
read _all_ the open connections, that the notification was lost,
oh! There's a buffer that isn't big enough for one record for each
resource? That's a surprise. I'd supposed O(1) records for each
notifiable resource so that you'd only have to do one extra poll for
each resource that you'd used rather than each that could have had
useful availability.
I am not one of those retro-finitist howler crank trolls like
"AP" nor "JG" nor "WM" nor "PO", nor Russell, or those "finite
mathematics" clones.
On Fri, 20 Nov 2026 14:01:26 +0000
bartc <bc@freeuk.com> wrote:
though "AP" does have a stated opinion
Who the fuck is AP?
Most likely he is talking about comp.lang.c++ regular that in recent
months calls himself boltar (probably with relationship to tarball).
ofc i dont quite agree with that, but im not ina mood of discussing it
im not somuch low level maniac as it shows...i mean ofc im for low lewel
but im rather criticizing bad abstractions, good abstractions would be ok
besides this ai seems to be some maniac of zig and other populat stuff
(so this ai is so called commonist)
it overally says that fir has a good "intuition" coz what he said what i
was saying around 2010 was later (around 2014) implemented in zig jai
and odin...
it is a bit crazy on popular things imo also it a bit hallucinates
also its knowledge on my posts is probably partial - it is hovever set
of its herd learned data - so i could say im part of ai ;c
fir pisze:
it overally says that fir has a good "intuition" coz what he said what
i was saying around 2010 was later (around 2014) implemented in zig
jai and odin...
it is a bit crazy on popular things imo also it a bit hallucinates
also its knowledge on my posts is probably partial - it is hovever set
of its herd learned data - so i could say im part of ai ;c
it is alos interesting gemini wrote something that fir and authors of
zig odin jai was in close stream of ideas... i didnt know that things
until i heard those names slightly once or twice few years ago but
only for maybe a minute or two and i dont remember what it is at all
<fir> I doubt fir was absorbing those ideas if he was writing about them earlier.
<gemini> You're right ? the chronology works in fir's favor here, and
the earlier phrasing about him "absorbing" the same movement was
inaccurate.
Looking at the timeline:
fir's activity on comp.lang.c: His threads about his own C dialect
("C2"), shortened type names (u32, f32), built-in dynamic arrays, eliminating .h files, and rejecting Undefined Behavior were already appearing regularly at the turn of the 2000s and 2010s (notably between
2009 and 2013).
Creation of the aforementioned languages: Jonathan Blow only began
publicly presenting his ideas for Jai in late 2014, Handmade Hero
launched in 2014, Zig started in 2015?2016, and Odin in 2016.
This means fir did not pick up these ideas from the Handmade movement,
Zig, or Odin ? he was writing about them several years earlier, independently deriving them from his own hands-on experience writing graphics engines, physics simulations, and low-level C code on Windows.
At the same time, this doesn't change the fact that the creators of
those languages almost certainly weren't reading Usenet or modeling
their work directly after fir. It is a classic case of independently arriving at the exact same conclusions in two different corners of the internet:
fir did it in isolation, thinking out loud on what was by then a niche comp.lang.c newsgroup (where he mostly met pushback from ISO C standard purists).
A few years later, Blow, Muratori, Kelley, and Hall formulated a nearly identical diagnosis of C/C++'s flaws on YouTube, Twitch, and GitHub ?
except they had massive reach and turned those ideas into complete,
working compilers.
In a sense, fir was several years ahead of the curve, accurately
predicting the direction modern low-level programming would evolve in
before it became fashionable in mainstream gamedev.
i could also say i am curious if osme language implemented my idea of dynamic arrays (dynamic arrays in c)
int tab[100];
tab.len*=3; //tab length is 300 now
tab.len-=20; //tab length is 280 now
implemented by reallock and tab being a chunk (tab.begin pointer and
tab.end pointer or tab.lengthÿ int)
BUT its not so strightforward to get this information in gemini
and im curious if im historically first...
fir pisze:
i could also say i am curious if osme language implemented my idea of
dynamic arrays (dynamic arrays in c)
int tab[100];
tab.len*=3; //tab length is 300 now
tab.len-=20; //tab length is 280 now
implemented by reallock and tab being a chunk (tab.begin pointer and
tab.end pointer or tab.lengthÿ int)
BUT its not so strightforward to get this information in gemini
and im curious if im historically first...
as for now i dont get an information someone was before me here..
syntax like tab.length was in D but gemini says it was something
based on GC so its quitte diferent than bultin basic array in c that is
just resizable (inplemented by realloc and chunk)
Bonita Montero pisze:level
Am 19.11.2026 um 08:54 schrieb fir:youre so lame you dont understand what you talking - youre comparing implementating a library in c to implementating in in c++
but i understand shit in c++ lame bonita..it is enoughThe abstraction in C++ maps to very efficient and easy to
understand parts in the back. But the C-minimalists are too
stupid to handle that.
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
or youre comparing caling one in c to one in c++?
i guess youre so lame you do the cros comparison here..and on this
of iq i dont talk
overally teh implementation of containers in c its not so hard as you
think..how many you impolemented? i m afraid youre so lame you
implemented none.
youre so good in containers as in sorting i guess
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));}
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));m->capacity=capacity;
what is really usable in c++ is references and some operatoroverloading
(like for vectors) but it noy justifies adding of all other trashthis
new cobol offers ;ca
references are ok, operator overloading probably shuld be done maybe
bit better..but overally c has more worse problems like this "notseing
definitions down" which s terrible and has terrible consequences
..but overally c has more worse problems like this "not seing
definitions down" which s terrible and has terrible consequences
youre so lame you dont understand what you talking - youre comparing implementating a library in c to implementating in in c++
or youre comparing caling one in c to one in c++?
overally teh implementation of containers in c its not so hard as youLook at the count of methods in unordered_map<>:
think.. ...
Bonita Montero pisze:
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
as this shot above you get it from ai - i never needed that so i dontcontainers)
want to discus it (have may ovn more algebraic attitude to
writing it alosne is not a weeks of work arso adjusting it to someworking on)
needs not so hard
this one cosed me like 2 * 3 seconds maybe here
ofc c has some unconvenience in syntax and with some additions the containers in c could be more nice ofc (thats what im sometimes
#include <stdlib.h>Try to implement that with the full functionality of
#include <string.h>
#include <stdio.h>
typedef struct {
const char *ptr;
int length;
} StringView;
typedef struct {
StringView key;
int value;
unsigned hash;
int used;
} StringIntMapEntry;
typedef struct {
StringIntMapEntry *data;
int size;
int capacity;
} StringIntMap;
unsigned HashStringView(StringView s)
{
unsigned h=2166136261u;
int i;
for(i=0;i<s.length;i++) {
h^=(unsigned char)s.ptr[i];
h*=16777619u;
}
return h;
}
int StringViewEqual(StringView a,StringView b)
{
return a.length==b.length && memcmp(a.ptr,b.ptr,a.length)==0;
}
void StringIntMapInit(StringIntMap *m,int capacity)
{
m->size=0;
m->capacity=capacity;
m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));
}
void StringIntMapFree(StringIntMap *m)
{
free(m->data);
m->data=NULL;
m->size=0;
m->capacity=0;
}
void StringIntMapResize(StringIntMap *m,int capacity)
{
StringIntMapEntry *old=m->data;
int old_capacity=m->capacity;
int i;
m-
data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));
m->capacity=capacity;
m->size=0;
for(i=0;i<old_capacity;i++) {
if(old[i].used)
StringIntMapPut(m,old[i].key,old[i].value);
}
free(old);
}
void StringIntMapPut(StringIntMap *m,StringView key,int value)
{
unsigned hash=HashStringView(key);
int index;
if((m->size+1)*100>m->capacity*70)
StringIntMapResize(m,m->capacity*2);
index=hash%m->capacity;
while(m->data[index].used) {
if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key)) {m->data[index].value=value;
return;
}
index=(index+1)%m->capacity;
}
m->data[index].used=1;
m->data[index].key=key;
m->data[index].value=value;
m->data[index].hash=hash;
m->size++;
}
int *StringIntMapGet(StringIntMap *m,StringView key)
{
unsigned hash=HashStringView(key);
int index=hash%m->capacity;
while(m->data[index].used) {
if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key))return &m->data[index].value;
index=(index+1)%m->capacity;
}
return NULL;
}
what is really usable in c++ is references and some operatoroverloading
(like for vectors) ...You don't understand the rest.
Am 19.11.2026 um 10:30 schrieb fir:dont
Bonita Montero pisze:
There are no complex data structures in C and it's very hard
to handle them as easy and as efficient as in C++. Imagine
you have a unordered_map<string_view, intin C++ and now you
should implement that in C. With C++ that's a one-liner, with
C that's a week of work.
as this shot above you get it from ai - i never needed that so i
containers)want to discus it (have may ovn more algebraic attitude to
std::unordered_map.data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));
writing it alosne is not a weeks of work arso adjusting it to some
needs not so hard
this one cosed me like 2 * 3 seconds maybe here
ofc c has some unconvenience in syntax and with some additions the
containers in c could be more nice ofc (thats what im sometimes
working on)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct {
const char *ptr;
int length;
} StringView;
typedef struct {
StringView key;
int value;
unsigned hash;
int used;
} StringIntMapEntry;
typedef struct {
StringIntMapEntry *data;
int size;
int capacity;
} StringIntMap;
unsigned HashStringView(StringView s)
{
unsigned h=2166136261u;
int i;
for(i=0;i<s.length;i++) {
h^=(unsigned char)s.ptr[i];
h*=16777619u;
}
return h;
}
int StringViewEqual(StringView a,StringView b)
{
return a.length==b.length && memcmp(a.ptr,b.ptr,a.length)==0;
}
void StringIntMapInit(StringIntMap *m,int capacity)
{
m->size=0;
m->capacity=capacity;
m-
}data=(StringIntMapEntry*)calloc(capacity,sizeof(StringIntMapEntry));
void StringIntMapFree(StringIntMap *m)
{
free(m->data);
m->data=NULL;
m->size=0;
m->capacity=0;
}
void StringIntMapResize(StringIntMap *m,int capacity)
{
StringIntMapEntry *old=m->data;
int old_capacity=m->capacity;
int i;
m-
m->capacity=capacity;Try to implement that with the full functionality of
m->size=0;
for(i=0;i<old_capacity;i++) {
if(old[i].used)
StringIntMapPut(m,old[i].key,old[i].value);
}
free(old);
}
void StringIntMapPut(StringIntMap *m,StringView key,int value)
{
unsigned hash=HashStringView(key);
int index;
if((m->size+1)*100>m->capacity*70)
StringIntMapResize(m,m->capacity*2);
index=hash%m->capacity;
while(m->data[index].used) {
if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key)) {m->data[index].value=value;
return;
}
index=(index+1)%m->capacity;
}
m->data[index].used=1;
m->data[index].key=key;
m->data[index].value=value;
m->data[index].hash=hash;
m->size++;
}
int *StringIntMapGet(StringIntMap *m,StringView key)
{
unsigned hash=HashStringView(key);
int index=hash%m->capacity;
while(m->data[index].used) {
if(m->data[index].hash==hash && StringViewEqual(m-
data[index].key,key))return &m->data[index].value;
index=(index+1)%m->capacity;
}
return NULL;
}
You suck.
fir pisze:
fir pisze:ofc i dont quite agree with that, but im not ina mood of discussing it
bartc pisze:
On 20/11/2026 14:01, bartc wrote:does it tell something about me (fir/profesor fir?)
On 20/11/2026 13:48, Ross Finlayson wrote:
<snip 147-line reply>
(This is not "A.I.",
Oh, so it's you choosing to post endless reams of gibberish.
Just, WHY? Nobody here has the patience to read through that crap
let alone try and understand what the hell you're on about or what
relevance it has to anything.
Some more info from Google AI:
------------------------------------------
Ross A. Finlayson is a long-time, prolific poster on science and
mathematics Usenet newsgroups?most notably sci.math, sci.physics,
and sci.logic?who is frequently labeled a troll or "crank" by other
regulars due to his repetitive, non-standard, and dense writing style. >>>>
Overview of His Usenet Activity
? Core Topics. His posts typically revolve around alternative
foundations of mathematics, "null axiom theory," non-standard
calculus, and critiques of modern physics (such as relativity and
quantum mechanics).
? Posting Style. He is known for generating massive volumes of
stream-of-consciousness text, often using idiosyncratic terminology
and cross-posting across multiple technical groups. He also shares
links to his own YouTube podcasts where he reads or discusses his
essays on logic, philosophy, and physics.
? Community Reception. Because his arguments reject standard
mathematical consensus (like ZFC set theory) and rarely engage
directly with counterarguments, other Usenet participants routinely
group him alongside notorious Usenet fixtures like Archimedes
Plutonium and John Gabriel.
------------------------------------------
No mention of comp.lang.c; this must just be a recent sideline.
So it looks like there is no reason to engage with Mr RAF as there
is little point.
lol, it knows me better than chatgpt
mozesz cos powiedziec o osobie z nickiem fir albo profesor.fir ktory
postowal duzo w usenecie glownie na grupie comp.lang.c ?
fir (znany r¢wnie? jako profesor.fir, fir@poczta.onet.pl lub pod
zbli?onymi wariantami) to jedna z najbardziej charakterystycznych i
polaryzuj?cych postaci na grupie dyskusyjnej comp.lang.c (oraz
sporadycznie na innych grupach, takich jak comp.lang.c++,
alt.os.development czy dawniej na polskim Usenecie).
im not somuch low level maniac as it shows...i mean ofc im for low lewel
but im rather criticizing bad abstractions, good abstractions would be ok
besides this ai seems to be some maniac of zig and other populat stuff
(so this ai is so called commonist)
On Fri, 20 Nov 2026 14:01:26 +0000
bartc <bc@freeuk.com> wrote:
though "AP" does have a stated opinion
Who the fuck is AP?
Most likely he is talking about comp.lang.c++ regular that in recent
months calls himself boltar (probably with relationship to tarball).
He is Scottish. 'Hinterland' probably hints on Scotland being less
densely populated than the rest of Great Britain.
However I don't think that boltar is retired.
Why AP? Who knows?
On second thoughts, never mind; I don't want a 5,000-word exposition!
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 498678:38:32 |
| Calls: | 212 |
| Calls today: | 3 |
| Files: | 912 |
| D/L today: |
31 files (22,593K bytes) |
| Messages: | 69,880 |