News for hackers. Stuff that matters.
Re:Breaking Up with Long Tasks or: how I learned to group lo... by mikepurvis on Saturday January 04, 2025 @12:39AM (#42592721)
Is this a JS specific issue? I find python is decently friendly to having little pockets of async where it makes sense in what is otherwise a regular synchronous program.
Re:Breaking Up with Long Tasks or: how I learned to group lo... by Too on Saturday January 04, 2025 @02:38AM (#42593187)
I'd say it's the other way around. In JS, async is just syntax sugar on Promises, they still execute within the same event loop. So regardless of if you are in async or not, you always have to think about not blocking. This becomes a lot easier to reason about, because all code is from the beginning made to be non blocking. Whereas in python if you call a blocking sync function from async world you are up for trouble. The problem solved in the OP is the unusual case where you need to do some big sync computation.
Re:Breaking Up with Long Tasks or: how I learned to group lo... by Yoric on Saturday January 04, 2025 @04:55AM (#42593777)
My experience is that Python is worse at async than JavaScript. At least, the debugging experience quickly scales up to nightmarish.