> On Dec 27, 2023, at 2:03 PM, Chet Ramey via austin-group-l at The Open Group > <[email protected]> wrote: > > On 12/27/23 11:26 AM, Andrew Pennebaker via austin-group-l at The Open Group > wrote: >> Many programs depend on hashmaps in order to work. >> awk is not an answer. >> The lack of hashmaps forces people to use less efficient algorithms, such as >> linear search. >> The bash family implements it. Simply acknowledging bash associative array >> syntax, would instantly improve the scalability of sh scripts. > > That's not the intent of the standard. The standard is supposed to give > users an idea about what they can rely on for portable scripts (and, to a > lesser extent, interactive use). While bash and ksh93 implement associative > arrays, that's not enough for a standard. zsh also has associative arrays. That's at least 3 shells with associative arrays. The dash developers typically don't add functionality until it's been added to the standard first, so it's pointless to wait until dash adds it. That's the wrong order. I'm supportive (in principle) of adding hashmaps / associative arrays to shell. Rationale: * Implementation effort in shells is relatively small * It's a useful general-purpose ability for many cases. * Many people write simple shell scripts; switching languages just to do this makes little sense. * It's already implemented in at least 3 widely-used shells. I don't know how different the bash / ksh93 / zsh shells are in this regard; someone would have to do that research. However, someone has to do the work of doing the analysis of existing implementations, creating the proposal, etc. That's no guarantee of acceptance of course :-). --- David A. Wheeler
Re: Request: Standard hashmaps in sh
David A. Wheeler via austin-group-l at The Open Group Wed, 27 Dec 2023 14:13:16 -0800
- Request: Standard h... Andrew Pennebaker via austin-group-l at The Open Group
- Re: Request: S... Oğuz via austin-group-l at The Open Group
- Re: Reques... Andrew Pennebaker via austin-group-l at The Open Group
