develooper Front page | perl.perl5.porters | Postings from March 2021

Re: RFC / POC - more than 32 features

Thread Previous | Thread Next
From:
=?UTF-8?Q?Branislav_Zahradn=C3=ADk?=
Date:
March 24, 2021 10:15
Subject:
Re: RFC / POC - more than 32 features
Message ID:
CAB=rbOm29SQU44hYw0xi5+pur9zkO2v1uxW2nn2-SZuLs8CE8g@mail.gmail.com
On Wed, 24 Mar 2021 at 00:54, Tony Cook <tony@develop-help.com> wrote:

>
> It's not entired clear without a complete implementation, but going by
> your feature_save() definition it looks like you expect to store
> several new fields in cop_features (which is where the current feature
> bits are stored.)
>

> cop_features is part of every COP, and a COP is currently generated
> for every statement in your code, so this would significantly increase
> the memory usage of a large perl program.
>

True, there is more data to be accessible via cop_features.
It doesn't need to be stored as value, it can be stored as copy-on-write
pointer
(though that's implementation complexity).

On other hand, implementation with bundle only (without protocol parts)
will currently consume exactly one U32, it will just automatically grow.


> The limit on 32-bit features isn't hard, it was mostly laziness (it
> doesn't need to be done right now) and hubris (I can fix it later), my
> intent was always to re-work it to support more feature bits when it
> was needed.
>

32-bit is not only one limit, there is also limit with number of bundles.

This one also adds capability to deprecate and/or prohibit flip from
default value,
depending on bundle / protocol enable order.

For example:
sequence "use v7; use v5.10;" may warn or die on some of v5.10 feature flips
(eg: indirect) and still preserve this warn-or-die configuration.

This approach also allows forward compatible programming (assuming there
will
be one codebase (5,7, ...) tunable with features into proper one), for
example:
(meaning, not implementation) "use preview v8;"

Ad single code base: that is why I'm working on using bison's GLR parser,
where
one can include rule based on feature.

So I guess I have to rephrase my question:


> At this point we're not close to hitting the limit.
>
> Tony
>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About