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

Re: RFC / POC - more than 32 features

Thread Previous | Thread Next
Tony Cook
March 23, 2021 23:55
Re: RFC / POC - more than 32 features
Message ID:
On Mon, Mar 22, 2021 at 10:25:38PM +0100, Branislav ZahradnĂ­k wrote:
> Hi,
> I prepared quick draft of new feature.[ch] -
> I hope it's enough to show an idea and evaluate usability.
> Doing more involves modification in regen/ which I don't want to
> start without some kind of consensus that it's a good idea (being stuck
> with glr parser I need some relax ...)
> This mechanism
> - supports unlimited number of features
> - supports deprecated and prohibited flip
> - supports bundle (or better, protocol) composition - ie, doesn't use
> cop_hints
> - supports different defaults per bundle
> * deprecated and prohibited flip
> For example, should feature "indirect" be deprecated since 5.38 and
> prohibited in 7.0 (default "off" in both), then sequences
> use v5.38;
> use v5.10; # can raise warning "indirect is deprecated"
> use v7.0
> use v5.10; # can die "indirect is prohibited"
> * composition
> Here I'm not sure how it should behave
> - for feature manually set it's possible to preserve it's value
> - it's possible for bundle/protocol to say "i don't care about this feature"
> Example, it's possible to implement, that after this (as an example with
> known feature)
> use feature 'fc';
> use v5.10;
> one can still use fc

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.

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.

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


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About