3 ms·
In regards to sibling replies, does it feel to anyone else like everything (except golang) is converging towards PHP's array() ?
by Izkata 7y ago
In regards to sibling replies, does it feel to anyone else like everything (except golang) is converging towards PHP's array() ?
- masklinn 7y agoInterestingly enough here it was kinda but kinda not the other way around: historically PHP used a closed-addressing hash map and threaded a doubly linked list through it to maintain the insertion order. But the dict TFA talks about doesn't use a doubly linked list, or closed addressing, its ordering is a side-effect of its implementation but not originally a core goal (memory saving and iteration speed were). It'd probably been proposed by others before but it came to wider attention after Raymond Hettinger (a core dev) proposed it a few years back[0]. PHP actually released it first[1], closely followed by pypy[2]. CPython only got around to it some time later[3] [0] https://mail.python.org/pipermail/python-dev/2012-December/123028.html https://mail.python.org/pipermail/python-dev/2012-December/1... [1] https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implem... [2] https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html https://morepypy.blogspot.com/2015/01/faster-more-memory-eff... [3] https://docs.python.org/3/whatsnew/3.6.html?highlight=3.6#whatsnew36-compactdict https://docs.python.org/3/whatsnew/3.6.html?highlight=3.6#wh...