3 ms·
interesting. Python doesn't use tagged pointers? I would think most dynamic languages would store immediate char/float/int in a single tagged 32-bit/64-bit word
by deckard1 4y ago
interesting. Python doesn't use tagged pointers? I would think most dynamic languages would store immediate char/float/int in a single tagged 32-bit/64-bit word. That's some crazy overhead.
- acdha 4y agoThis has been talked about for years but I believe it's still complicated by C API compatibility. The most recent discussion I see is here: https://github.com/faster-cpython/ideas/discussions/138 https://github.com/faster-cpython/ideas/discussions/138 Victor Stinner's experiment showed some performance regressions, too: https://github.com/vstinner/cpython/pull/6#issuecomment-656135551 https://github.com/vstinner/cpython/pull/6#issuecomment-6561...
- nneonneo 4y agoAbsolutely everything in CPython is a PyObject, and that can’t be changed without breaking the C API. A PyObject contains (among other things) a type pointer, a reference count, and a data field; none of these things can be changed without (again) breaking the C API. There have definitely been attempts to modernize; the HPy project (https://hpyproject.org/ https://hpyproject.org/), for instance, moves towards a handle-oriented API that keeps implementation details private and thus enables certain optimizations.
- deleted 4y ago[deleted]
- justinlloyd 4y agoI love Python as a language, and all its packages, and have been using it since the late 90's, but Python's legacy decisions are one step away from causing the language to being found face down in a dirty ditch after an all night bender.
- eru 4y agoI do appreciate the backwards incompatible changes that Python 3 brought. Those were (mostly) good, and it was brave of them to go for it. I wish they'd had another go. Call it Python 4. But getting most people away from Python 2 to Python 3 already took a really long time.