3 ms·
The article's thesis relies on the idea that a genuinely primitive traversal action exists, in the way that a for-loop is primitive and widely applicable, or ad
by lutusp 1y ago
The article's thesis relies on the idea that a genuinely primitive traversal action exists, in the way that a for-loop is primitive and widely applicable, or adding two floats is common enough to justify building it into the language (or processor).
But tree traversal doesn't have this universal property. There are too many methods and purposes for traversing a tree, sufficient that IMHO no single primitive embodiment could materially improve a language. Also, modern compilers efficiently break down high-level traversal code so well that expressing the idea at a high level incurs no serious penalty compared to having a primitive for that purpose, or a series of them.
- fngjdflmdflg 1y agoI read a similar argument for graphs in general,[0] where this is more obviously true. [0] https://www.hillelwayne.com/post/graph-types/ https://www.hillelwayne.com/post/graph-types/ and https://news.ycombinator.com/item?id=39592444 https://news.ycombinator.com/item?id=39592444