🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1694

Re: Inversion-of-control and dependency-injection in C

#1694
From: Tristan Wibberley
Date: Fri, 20 Nov 2026 12:35
38 lines
3633 bytes
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.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Technical Details
Message-ID: <11dpeqd$35ddj$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com> <11d56gl$3ud5q$1@dont-email.me> <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org> <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com> <11d738r$ru7a$1@dont-email.me> <11d75i7$spj0$1@dont-email.me> <11d7c8k$173nk$1@dont-email.me> <11d7fbv$1839o$2@dont-email.me> <nrecnTdvuvbACWr3nZ2dnZfqn_adnZ2d@giganews.com> <11dfgtf$3pj6i$1@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
Newsgroups: comp.lang.c
Subject: Re: Inversion-of-control and dependency-injection in C
Date: Fri, 20 Nov 2026 12:35:25 +0000
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <11dpeqd$35ddj$1@dont-email.me>
References: <yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com>
 <11d56gl$3ud5q$1@dont-email.me>
 <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org>
 <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com>
 <11d738r$ru7a$1@dont-email.me> <11d75i7$spj0$1@dont-email.me>
 <11d7c8k$173nk$1@dont-email.me> <11d7fbv$1839o$2@dont-email.me>
 <nrecnTdvuvbACWr3nZ2dnZfqn_adnZ2d@giganews.com>
 <11dfgtf$3pj6i$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 20 Nov 2026 12:35:26 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3323315"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/fu55nV2dQbV18wEQoB5gan9tOwfQNtNsiDP5CaYftYA=="; posting-host="81c55cb3b1d01a17eb136b8d36eaef7e"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OKDfrcjigkRleAaJ6b44m3cNT4s= sha256:sMhjRG5a4E9v0t32K5GG7hvuDf5kVezi+HPsCq/6J54=
	sha1:gg0tHUhxdnxBmtZeUvgh+HMKsvo= sha256:RCkbsCg31q9d32GdouMr1qR553yIkzcdrAebRd27h6g=
Content-Language: en-GB
In-Reply-To: <11dfgtf$3pj6i$1@raubtier-asyl.eternal-september.org>