demerphq kicked off a discussion on blogs.perl.org of the hash APIs that Perl (and perl) provides. The discussion also has a parallel strand on nntp.perl.org.

In my interpretation, the discussion moved on from removing restricted and locked hashes towards realizing that restricted and/or locked hashes can get a different hash implementation in the backend than plain hashes and maybe even plain hashes can get different implementations. This makes me somewhat happy because I really like using locked hashes for DBI query results and don't really care for the (potential) performance overhead.

Other people see a benefit in removing the performance overhead incurred by supporting restricted hashes, which I don't know about. But as these people know more about the internals, I'm inclined to trust them on their judgement as well.

Allowing different implementations of hashes opens up the interesting question of if or how a hash can move from one implementation to another, and personally I expect that only to happen for explicit assignments:

use feature 'superfast_hashes'; my %hash_with_implementation_A = ( foo => 'bar' ); no feature 'superfast_hashes'; my %hash_with_implementation_B = %hash_with_implementation_A;

If you have an opinion either way on the features of locked / restricted hashes, consider participating in the discussion either on nntp.perl.org or blogs.perl.org

choroba points out more discussion on reddit r/perl.


In reply to Are Restricted/Locked Hashes a Failed Experiment? by Corion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.