News for hackers. Stuff that matters.
Re:Perl 11 by ricardobeat on Wednesday October 24, 2018 @03:40AM (#18290409)
There are no “universal” terms. You used hash as an example, that’s already less universal than calling it a dictionary - it’s a hash map/table, and I’ve only ever heard this term from Perl developers.
Re:Perl 11 by rurban on Wednesday October 24, 2018 @04:59AM (#18290781)
That's because perl developers knew lisp and functional languages before and therefore avoided the misleading term "map", which is an operator to apply a function on a vector (=array) or list since the late 50ies. a map vs to map is misleading.

"table" is shorter than "dictionary" and also describes the structure better. A dictionary is mostly a book, or a list of keys (/usr/share/dict). prolog also used the term "table" or "tabling" for its caching of backtrackings, what we would call "memoize" or memoization via a hash table.

Re:Perl 11 by kazinator on Wednesday October 24, 2018 @11:22AM (#18293184)
> perl developers knew lisp and functional languages

It's a practical certainty that the vast majority do not, and its design (up to Perl 5, at least) smacks of total Lisp ignorance.

"Map" is used in mathematics as a kind of synonym for "function", especially from some arbitrary set to another one. If you assign the domain < 1, 2, 3, 4 > to the range < 3, 2, 4, 1 >, that's a map. We can draw it as two bubbles containing labeled dots, and draw arrows between the bubbles.

This sense of "map" is widely used in computing. For instance "keyboard scan codes get mapped to characters" or "a coordinate in the abstract canvas get mapped to the viewport, which is mapped to the screen" or "the temperature sensor is mapped to GPIO-s 13 to 17."

The "map" in Lisp's mapcar is exactly this sense. The map is the function that is being applied: mapcar is using the verb sense: take the car of every cell through the function: i.e. map each domain value to the range. This is called "projection" or "mapping"; "map" is just the verb describing what happens to each individual element.

Re:Perl 11 by kod on Wednesday October 24, 2018 @12:34PM (#18293942)
Re:Perl 11 by rurban on Thursday October 25, 2018 @11:58AM (#18301915)
Yes. If Larry knew how a LISP is implemented, many internals would have looked better. the symtab, the optree, the stack and esp. the lexicals. Just compare to the ruby internals.

But at least he knew the terminology, and got the concepts right. In opposition to php and python which failed miserably.

Re:Perl 11 by kazinator on Thursday October 25, 2018 @10:54AM (#18301334)
"I did dabble in LISP more than I did FORTRAN and it looks like oatmeal with toenail clippings."
Re:Perl 11 by collyw on Wednesday October 24, 2018 @04:11AM (#18290526)
Java always had hash maps as one of their map implementations. (I did use both languages years ago, so maybe that's why I noticed)
Re:Perl 11 by CydeWeys on Wednesday October 24, 2018 @04:24AM (#18290578)
For what it's worth, the three main Java map implementations are HashMap, which does what it says on the time, LinkedHashMap, which has some additional pointers to maintain insertion order (and thus has performance that suffers by a constant factor), and TreeMap, which is really a red/black tree which thus offers logarithmic lookup time instead of constant lookup time (i.e. it's not a hashtable at all).