Top all-time · #3546
Laurent Luce
Personal blog · laurentluce.comprogrammingsystems
Laurent Luce's personal blog at laurentluce.com covers programming and systems. Since 2011, 22 different Hacker News readers have linked it 24 times, most often “Python's Dictionary Implementation”. The last post was in 2020, but the archive is still widely read.
Too few sampled comments (8) to say how often HN recommends it.?
Why HN links it
HN readers link Laurent Luce's posts on CPython internals, such as integer objects, the list implementation, PyObject and the dictionary implementation, as references for how Python works under the hood.
Summarised by Claude from a sample of 8 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- Python's Dictionary Implementation4 people · 4 mentions · first linked 2013-04-15
- Twitter sentiment analysis using Python and NLTK3 people · 3 mentions · first linked 2012-01-05
- Solving mazes using Python: Simple recursivity and A* search2 people · 2 mentions · first linked 2011-03-11
- Python Dictionary Implementation2 people · 2 mentions · first linked 2022-04-02
What Hacker News says?
These kinds of diagrams are OK for the most basic introduction to data structures, but they're not much help when it comes to creating an efficient implementation. Learning about data structure implementation without using a relatively low-level language that allows pointers seems to be a recipe for confusion. Hence, one is probably always better off using the built-ins or libraries for any data structure in a highe…
Comment linking /posts/python-dictionary-implementation/
on “Data Structures Sketches”Submitted Twitter sentiment analysis using Python and NLTK as a story · 79 points
HN discussionSo likely thinking of it in terms of checking a tree based on characters instead of hashes of full words. Which is more viable would likely depend on what kind of memory constraints and dictionary size was being considered. Also very implementation dependent, what's the size of the hashes generated? Edit: curiosity got me looking at this for Python, with an answer of "it depends, and both have correct aspects" based…
Comment linking /posts/python-dictionary-implementation/
on “How to conduct a good programming interview”Submitted Python Locks, RLocks, Semaphores, Conditions, Events and Queues as a story · 33 points
HN discussionPython statically allocates small integers (-5 to 256), so you're not actually creating a new object unless you're creating one outside that range. http://www.laurentluce.com/posts/python-integer-objects-impl...
Comment linking /posts/python-integer-objects-implementation/
on “Why Python is Slow: Looking Under the Hood”Submitted Solving mazes using Python: Simple recursivity and A* search as a story · 14 points
HN discussionHere is blog post about python list implementation, one of 2 main data structures used internally: http://www.laurentluce.com/posts/python-list-implementation/
Comment linking /posts/python-list-implementation/
on “Python Internals: PyObject”Submitted Python’s dictionary implementation as a story · 8 points
HN discussionRaw source: http://svn.python.org/view/%2acheckout%2a/python/tags/r266/O... Walkthrough of the implementation: http://www.laurentluce.com/posts/python-dictionary-implement...
Comment linking /posts/python-dictionary-implementation/
on “Read your Standard Libraries”Submitted Twitter sentiment analysis using Python and NLTK (2012) as a story · 3 points
HN discussionMy gut-ballpark was going to be around an order of magnitude, not two. Here's are two naive comparisons (granted, from the late aughts and not a direct comparison but a more general one) that show ~7-8x[0,1]. The overhead of PyStringObject is not trivial[2] (though the implementation details likely have changed between Py2.x and Python 3). For things like building accumulators a set of data/log parsing rather than d…
Comment linking /posts/python-string-objects-implementation/
on “The 2016 Top Programming Languages”Submitted Twitter sentiment analysis using Python and NLTK as a story · 3 points
HN discussionSince there isn't any traversal when looking up an element n, I guess the best "short hand" would be to call it an array - it's an array of pointers to objects on the heap. https://www.laurentluce.com/posts/python-list-implementation... As for collections within collections, python allows for that in "lists" (arrays) and "dictionaries" (maps).
Comment linking /posts/python-list-implementation/
on “MISC: A homoiconic language based on maps”Submitted Python’s list implementation as a story · 3 points
HN discussionIt's puzzling that "x is 17" should work but then "1000 + 1 is 1001" doesn't. The reason is that Python pre-allocates 262 numbers at initialization (-5 to 256) and the allocation uses a different method/structure for bigger numbers. >>> x = 256 >>> x is 256 True >>> id(x) 94900419138400 >>> id(256) 94900419138400 >>> x = 257 >>> x is 257 False >>> id(x) 94900419504344 >>> id(257) 94900419504368 Reference: https://ww…
Comment linking /posts/python-integer-objects-implementation/
on “Python’s misleading readability”Submitted Python Dictionary Implementation as a story · 2 points
HN discussionSubmitted Python String Objects Implementation as a story · 2 points
HN discussionSubmitted Python's Dictionary Implementation as a story · 2 points
HN discussionSubmitted Solving mazes using Python: Simple recursivity and A* search as a story · 2 points
HN discussionSubmitted Create a Debian package for your Django application (2010) as a story · 1 points
HN discussionSubmitted Python Dictionary Internal Implementation as a story · 1 points
HN discussionSubmitted Python and cryptography with pycrypto as a story · 1 points
HN discussionSubmitted Geo data of the Massachusetts elementary school districts using Python as a story · 1 points
HN discussionSubmitted Python, Twitter statistics and the 2012 French presidential election as a story · 1 points
HN discussion