Re:Python 3.11 beta vs. 3.10 benchmark
by SemanticStrengh on Wednesday May 18, 2022 @08:14AM
(#31421800)
BTW It'd be nice if python implemented support for tail call recursive or even better, a growable/segmented stack in order to allow arbitrary pythons functions be stack overflow safe.
e.g. https://gcc.gnu.org/wiki/SplitStacks#:~:text=Split%20Stacks%....
[ Parent
| on HN ]
There was once stackless python that did this (Eve online was built in it), I don’t know if it still exists though.
Re:Python 3.11 beta vs. 3.10 benchmark
by bqmjjx0kac on Wednesday May 18, 2022 @09:18AM
(#31422396)
Neat! https://en.wikipedia.org/wiki/Stackless_Python
Sadly, it isn't true parallelism, more like green threads. And they didn't manage to kill the GIL.
Re:Python 3.11 beta vs. 3.10 benchmark
by FreakLegion on Thursday May 19, 2022 @12:35AM
(#31430818)
With Python it's possible to do tail-call optimization yourself. See this all-time great Stack Overflow answer and the linked repo for details (the actual code is quite short): https://stackoverflow.com/a/18506625.
If Python doesn't depend on the C stack anymore (for most of its work), that's basically what you'll have for free.
Python's own stackframes are heap-allocated and chained (so each function has its own stack, in essence), so its use of a single unified allocation space for stack is already an implementation detail of the interpreter.
Re:Python 3.11 beta vs. 3.10 benchmark
by SemanticStrengh on Wednesday May 18, 2022 @04:02PM
(#31426992)
nice