Sujet : Re: logically weird loop
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 22. Nov 2024, 01:04:32
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhohqf$rq03$2@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.160 (Toresk; )
On Thu, 21 Nov 2024 07:06:43 +0100, Janis Papanagnou wrote:
Actually, if you know Simula, coroutines are inherent part of that
language, and they based their yet more advanced process-oriented model
on these. I find it amazing what Simula provided (in 1967!) to support
such things. Object orientation[*], coroutines, etc., all fit together,
powerful, and in a neat syntactical form.
Wirth did include coroutines in Modula-2. And a kind of object orientation
in Oberon, I think it was.
But these are (nowadays) called “stackful” coroutines -- because a control
transfer to another coroutine can happen at any routine call, each
coroutine context needs a full-sized stack, just like a thread.
There is this newer concept of “stackless” coroutines -- not that they
have no stack, but they need less of it, since a control transfer to
another coroutine context can only happen at the point of an “await”
construct, and these are only allowed in coroutine functions, which are
declared “async”. I think Microsoft pioneered this in C♯, but it has since
been copied into JavaScript, Python and other languages.
Yes, Simula pioneered OO. But the concept has gone in different directions
since then. For example, multiple inheritance, metaclasses and classes as
objects -- all things that Python supports.