Remix.run Logo
lstodd 2 days ago

idk stackless dates back to 2005 at least, most likely earlier.

greenlet which is sort of minimal stackless .. before 2008

pycoev which is on one hand greenlets without memmove()s, on the other hand sort of io-scheduled m:n threading I wrote myself in 2009.

so, at least idk, 20 years?

It was first needed. Then 10 years passed, people got around to pushing it through the process aaand by the time it was done it was already not needed. so it all stalled. Same with Rust.

Nowadays server-side async is handled very differently. And client-side is dominated by that abomination called JS.

fulafel 2 days ago | parent | next [-]

Also back then multicore wasn't as prevalent, it made sense to multiplex a zillion things onto one CPU process. Whereas now servers have hundreds of cores / SMT vCPUs [1] and running a lot of processes makes much more sense.

[1] https://www.tomshardware.com/pc-components/cpus/amd-announce...

toolslive 2 days ago | parent | prev [-]

I never understood why stackless wasn't more popular. It was rather nice, clean and performant (well, it's still python but it provide(d) proper concurrency)

lstodd 2 days ago | parent [-]

It was memmove() on each task switch. So you could forget about d-cache. And that killed performance on anything but benchmarks.

ack_complete 2 days ago | parent [-]

Also caused subtle bugs. I once had to debug a crash in C++ code that turned out to be due to Stackless Python corrupting stack state on Windows. OutputDebugString() would intermittently crash because Stackless had temporarily copied out part of the stack and corrupted the thread's structured exception handling chain. This wasn't obvious because this occurred in a very deep call stack with Stackless much higher up, and it only made sense if you knew that OutputDebugString() is implemented internally by throwing a continuable exception.

The more significant problem was that Stackless was a separate distribution. Every time CPython updated, there would be a delay until Stackless updated, and tooling like Python IDEs varied in whether they supported Stackless.

lstodd 2 days ago | parent [-]

We never ran stackless/greenlet under windows. And pycoev was setcontext(3)-based, so no windows either.

But I can imagine what that code did there...