Front page | perl.perl5.porters |
Postings from July 2020
Re: Announcing Perl 7
Thread Previous
|
Thread Next
From:
Paul "LeoNerd" Evans
Date:
July 3, 2020 16:53
Subject:
Re: Announcing Perl 7
Message ID:
20200703175305.2aede577@shy.leonerd.org.uk
On Sat, 27 Jun 2020 01:20:06 -0700
Darren Duncan <darren@darrenduncan.net> wrote:
> My central proposal is that we should be happy with a small amount of
> well thought out file boilerplate, and that a goal of having
> absolutely zero boilerplate is a worse option.
>
> I feel that, for precedents and examples, we should not be looking to
> what is typical with programming languages, but rather to what is
> typical for data file or interchange or message formats or
> communication protocols or the like.
>
> We should be conceiving a Perl program as a message and that message
> should have explicit metadata describing itself so that it can be
> understood in the most unambiguous manner possible. This would be
> the boilerplate.
Yes - some excellent thoughts there. I entirely agree. More things
should be upfront and explicit about versioning. Even our good old
friend HTTP starts off with
GET / HTTP/1.1
So I don't think it's a bad model to consider.
> I propose that we retain and utilize the classic "use N;" (where N is
> a number) as the simplest form of this metadata, and make that
> declaration mandatory at the outermost scope of each file, which is
> to say it appears above all entity declarations in the file.
Cautiously agree. Obviously this is going to require a fair amount of
deprecation time before it becomes mandatory, but I could foresee a
world in which every .pm file starts off with "use N" for some N, and
that would be no bad thing.
> Explicit versioning in the Perl code provides greater stability and
> forwards/backwards compatibility than having no version declaration.
> Anyone looking at it always knows what they're dealing with, what the
> author's intent was.
+1
> There is no reason that Baby Perl can't include the 1-liner "use N",
> that gets people used to explicit versioning right from the start.
> We just need to explain to users that the number has an actual
> meaning and higher numbers generally mean more features, and that it
> isn't just some opaque constant that you set once and never change.
> Later on, they can increase the numbers at the same time they
> discover the existence of new features that require it; any news or
> teachable moment that informs on the existence of a new feature also
> says what dialect/Perl version is needed at a minimum to obtain it.
>
> So making "use 5" mandatory is no worse than requiring "use
> compat::perl5" but its more terse and more future-proof and also a
> lot of code would already conform.
...
> Now the existing tools and plans to help with migration of Perl code
> to the version 7 dialect or tools to help deal with CPAN modules can
> all still happen as proposed.
>
> But the idea of zero boilerplate should be abandoned, and the simple
> "use N" boilerplate be made mandatory instead.
So much more +1.
I overall agree with everything you've said. I've trimmed the above
reply to only the most relevant parts, but a lot of good stuff there.
I'm sorry I missed it first time around but I discovered it on
re-reading the list a second time.
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
Thread Previous
|
Thread Next