Mailing List Archive

Re: Robin Hood Hashing for the perl core -- examples for 5.16?
On 2021/08/03 13:58, Philip R Brenan wrote:
> If the proposed new hash function is "better" than the existing
> function then the existing hash function is not "the best" which
> raises the possibility that there might be other "better" hash
> functions to choose from. One such possibility might use multi way
> trees: https://metacpan.org/dist/Tree-Multi

In addition to the above, that req'd:
Data-Table-Text-20210915

..neither would compile under 5.16.3. with both having needless
incompats from 5.26
required.

IF we are talking about algorithms for perl-core, can they at least be
compat w/previous perl?

It looks like both could if "incompatible expressions were not used,
like

define ? $_ : undef;
instead of
define $_ ? $_ : undef; # (and another w/similar syntax)...

Also one that was (expr)->%* (or something like that,
worked better as %(expr), due to a $$h in front that wouldn't parse
right under 5.16....
-----

It looked interesting enough for me to try to download try it out, and
trying to figure out why it wouldn't compile under 5.16.3...
Re: Robin Hood Hashing for the perl core -- examples for 5.16? [ In reply to ]
L A Walsh writes:

> On 2021/08/03 13:58, Philip R Brenan wrote:
>
> > If the proposed new hash function is "better" than the existing function
> > then the existing hash function is not "the best" which raises the
> > possibility that there might be other "better" hash functions to choose
> > from. One such possibility might use multi way trees:
> > https://metacpan.org/dist/Tree-Multi
>
> In addition to the above, that req'd:
> Data-Table-Text-20210915
>
> ..neither would compile under 5.16.3.
>
> IF we are talking about algorithms for perl-core, can they at least be
> compat w/previous perl?

No. Or, rather, yes.

At the language design level, _of course_ Perl's hashes will remain
backwards compatible with previous versions, because ... well, because
not doing so would be ridiculous, and basically put and end to Perl
being Perl.

But it doesn't make sense to say that a feature's internal
implementation is deemed compatible (or indeed incompatible) with other
versions: the internal algorithm isn't implemented _in_ Perl; it's part
of perl. There's no way that any new internal implementation of a
feature can be made to run on older versions of perl, because those
versions of perl already exist and, by necessity, their internals don't
use the implementation that didn't exist when they were released.

Furthermore, it's already been stated (in other replies to the message
you quoted) that this thread is specifically for discussing the Robin
Hood algorithm, as proposed. Please do not continue to post in this
thread about anything which is not related to that specific proposal.
Thanks.

Smylers