News for hackers. Stuff that matters.
Re:Free-threaded CPython is ready to experiment with by stavros on Friday July 12, 2024 @06:37PM (#40950091)
I feel you. I know asyncio is "the future", but I usually just want to write a background task, and really hate all the gymnastics I have to do with the color of my functions.
Re:Free-threaded CPython is ready to experiment with by BugsJustFindMe on Friday July 12, 2024 @06:43PM (#40950129)
I feel like "asyncio is the future" was invented by the same people who think it's totally normal to switch to a new javascript web framework every 6 months.
Re:Free-threaded CPython is ready to experiment with by hot_gril on Friday July 12, 2024 @07:01PM (#40950243)
JS had an event loop since the start. It's an old concept that Python seems to have lifted, as did Rust. I used Python for a decade and never really liked the way it did threads.
Re:Free-threaded CPython is ready to experiment with by zo1 on Saturday July 13, 2024 @01:12PM (#40955328)
Python's reactor pattern, or event loop as you call it, started with the "Twisted" framework or library. And that was first published in 2003. That's a full 6 years before Node.js was released which I assume was the first time anything event-loopy started happening in the JS world.

I forgot to mention that it came into prominence in the Python world through the Tornado http server library that did the same thing. Slowly over time, more and more language features were added to give native or first-class-citizen support to what a lot of people were doing behind the scenes (in sometimes very contrived abuses of generator functions).

Re:Free-threaded CPython is ready to experiment with by hot_gril on Monday July 15, 2024 @01:00PM (#40969570)
Yeah, this pattern is old. But JS is the only common language (at least today) that went so all-in with it.
Re:Free-threaded CPython is ready to experiment with by stavros on Friday July 12, 2024 @07:05PM (#40950268)
I agree, I find Go's way much easier to reason about. It's all just functions.