Sujet : Re: Threads across programming languages
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.c++ comp.lang.cDate : 03. May 2024, 00:21:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v1176k$4at1$3@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Thu, 2 May 2024 05:45:29 +0200, Bonita Montero wrote:
Am 01.05.2024 um 22:34 schrieb Lawrence D'Oliveiro:
No, it is actually mostly C, with Rust making inroads these days.
C++ has superseeded C with that for a long time with Job offers.
Rust is a language a lot of people talk about and no one actually uses.
Fun fact: the Linux kernel (the world’s most successful software project),
originally entirely C-based, is now incorporating Rust-based development.
It never accepted C++.
And you don’t have to be doing “system-level” programming to be needing
event-driven paradigms.
If you make asnychronous I/O you need performance, and this isn't
possible with Python.
I/O performance certainly is possible with Python, and it has the high-
performance production-quality frameworks to prove it.
No they aren’t. You cannot easily define a C++ function that returns a
general function or class as a result, just for example.
function<void ()> fn();
Try it with something that has actual lexically-bound local variables in
it:
def factory(count : int) :
def counter() :
nonlocal count
count += 1
return count
#end counter
#begin
return counter
#end factory
f1 = factory(3)
f2 = factory(30)
print(f1())
print(f2())
print(f1())
print(f2())
output:
4
31
5
32
Remember, we’re talking about maximizing I/O throughput here, so CPU is
not the bottleneck.
With io_uring you can easily handle millions of I/Os with a single
thread, but not with Python.
Debunked above.