Moving forward on `v7`

TL;DR - lets try "use v7" for now as a way to experiment incrementally
  on a per-file basis before we flip the world


I've been thinking on two separate problems and I think we can solve
them all in one go. Please bear with me.

There's quite a bit of consternation at the moment regarding the v7
plan, specifically on whether we will require files to begin "use v7"
or not. There's many plausible-sounding words on both sides, but very
little hard data. Meanwhile, I don't really feel that there's much of
concrete way to test it out yet for real in real-life situations, so
there's no way to obtain that data. I think we can fix both together.

Why don't we make a little change such that we can

  use v7;

anyway for now, even if we still aim that an eventual perl7 won't
*require* that in every file.=20

This way, we can test out what it feels like to put that in every file.
We can also work incrementally. I verymuch doubt we will be able to
*atomically* adapt every single `.pm` file that ships with core into 7
support in one giant leap. Instead, we can work in small incremental
steps - adding a `use v7;` line piecewise to each individual file that
we find works fine with it, gradually whittling down the files still
missing it, but knowing that at any point along the way we still have a
consistent tree that actually works.

If we get to the end of the process and every single file in the perl
core source tree now contains `use v7;` then great - we'll know we core
at least can support 7 mode. At that point we could just flip a few
bits in the core binary to have it start by default in that mode and
ship it as perl 7. It won't matter that every file still contains
`use v7` at that point, because when loaded by a perl7 binary that will
be a no-op, and if perl5 attempts to load it it will complain loudly
anyway. So we'll be good all round.

But *until* then, we still have a playground to work with
incrementally, seeing what works and what doesn't.

I for one am keen to start trying out this v7 mode on a purely opt-in
basis in some of my files anyway, so I'd hate to have to switch the
entire world at one go just to start experimenting in a few places.

In addition, I do hope that "use v7" is at least allowed in such files,
and becomes relatively normal to do so because I again I want to
re=C3=AFterate my point about syntax highlight. It would be great if github,
vim/emacs/etc.. could highlight perl 7 code correctly. It needs *a*
signal to do so, and it can't take that from the filename alone. There
is precedent for being able to use in-file clues to do that - "use v7"
can easily be such a clue. Even if "use v7" becomes optional to the
perl7 binary, I will still continue to declare "use v7" in all my code
so as to get the correct highlighting and other editor semantics when
working on it.

--=20
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/
0
leonerd
6/27/2020 11:42:39 PM
perl.perl5.porters 48122 articles. 1 followers. Follow

6 Replies
16 Views

Similar Articles

[PageSpeed] 4

PiBUTDtEUiAtIGxldHMgdHJ5ICJ1c2UgdjciIGZvciBub3cgYXMgYSB3YXkgdG8gZXhwZXJpbWVu
dA0KPiBpbmNyZW1lbnRhbGx5DQo+ICAgb24gYSBwZXItZmlsZSBiYXNpcyBiZWZvcmUgd2UgZmxp
cCB0aGUgd29ybGQNCg0KVGhpcyBpcyBzb29vLi4uLiBpbXByb3Blcg0KDQpGb3IgdGhlIGxhc3Qg
MjAgeWVhcnMgIm1vZGVybiBwZXJsIiB3YXMgInVzZSBzdHJpY3Q7IHVzZSB3YXJuaW5nczsiIGlu
IGV2ZXJ5IGZpbGUuDQpJIGNhbiBlYXQgdGhhdCwgYWx0aG91Z2ggdGhpcyBpc24ndCAiY29vbCIN
Cg0KQnV0IGlmIHdlJ3JlIHN3aXRjaGluZyBub3cgdG8gIm1vZGVybiBwZXJsIiA9PT0gInVzZSB2
NzsiIGluIGV2ZXJ5IGZpbGUgLSB0aGlzIGlzIA0KZXZlbiBtb3JlIHN0dXBpZA0KDQpJTU8gbW9k
ZXJuIHBlcmwgaXNuJ3QgdGhhdC4NCg==
0
Vadim
6/28/2020 9:18:45 AM
On Sun, 28 Jun 2020 09:18:45 +0000, "Konovalov, Vadim"
<Vadim.Konovalov@dell.com> wrote:

> > TL;DR - lets try "use v7" for now as a way to experiment
> > incrementally
> >   on a per-file basis before we flip the world  
> 
> This is sooo.... improper
> 
> For the last 20 years "modern perl" was "use strict; use warnings;"
> in every file. I can eat that, although this isn't "cool"
> 
> But if we're switching now to "modern perl" === "use v7;" in every
> file - this is even more stupid
> 
> IMO modern perl isn't that.

The other approach would be to add

 use p5; # or use v5

to *every* perl-file and remove it on a per-file basis as then

 use p7; # or use v7

is default and unneeded (for CORE)

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.31      porting perl5 on HP-UX, AIX, and Linux
https://useplaintext.email  https://tux.nl  http://www.test-smoke.org
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
0
perl5
6/28/2020 9:23:05 AM
-----Original Message-----
From: H.Merijn Brand=20

> On Sun, 28 Jun 2020 09:18:45 +0000, "Konovalov, Vadim"
> <Vadim.Konovalov@dell.com> wrote:
>=20
> > > TL;DR - lets try "use v7" for now as a way to experiment incrementall=
y
> > >   on a per-file basis before we flip the world
> >=20
> > This is sooo.... improper
> >=20
> > For the last 20 years "modern perl" was "use strict; use warnings;"
> > in every file. I can eat that, although this isn't "cool"
> >=20
> > But if we're switching now to "modern perl" =3D=3D=3D "use v7;" in ever=
y=20
> > file - this is even more stupid
> >=20
> > IMO modern perl isn't that.
>=20
> The other approach would be to add
>=20
>  use p5; # or use v5
>=20
> to *every* perl-file and remove it on a per-file basis as then
>=20
>  use p7; # or use v7
>=20
> is default and unneeded (for CORE)

*every* perl-file within CORE?

I can't catch the idea, but "default and unneeded" sounds to me much
better compared to the requirement on "use v7" everywhere
0
Vadim
6/28/2020 10:40:37 AM
On Sun, 28 Jun 2020 10:40:37 +0000, "Konovalov, Vadim"
<Vadim.Konovalov@dell.com> wrote:

> -----Original Message-----
> From: H.Merijn Brand
> 
> > On Sun, 28 Jun 2020 09:18:45 +0000, "Konovalov, Vadim"
> > <Vadim.Konovalov@dell.com> wrote:
> >  
>  [...]  
> > >
> > > This is sooo.... improper
> > >
> > > For the last 20 years "modern perl" was "use strict; use
> > > warnings;" in every file. I can eat that, although this isn't
> > > "cool"
> > >
> > > But if we're switching now to "modern perl" === "use v7;" in every
> > > file - this is even more stupid
> > >
> > > IMO modern perl isn't that.  
> >
> > The other approach would be to add
> >
> >  use p5; # or use v5
> >
> > to *every* perl-file and remove it on a per-file basis as then
> >
> >  use p7; # or use v7
> >
> > is default and unneeded (for CORE)  
> 
> *every* perl-file within CORE?
> 
> I can't catch the idea, but "default and unneeded" sounds to me much
> better compared to the requirement on "use v7" everywhere

If "use p5;" (or whatever) makes the file behave as perl-5.32.0 on
whatever is changed in defaults for perl7, changing - as a start - all
default headers from

--8<---
use strict;
use warnings;
-->8---

to

--8<---
use strict;
use warnings;
use p5;
-->8---

so nothing changes on changing defaults, we can then change to

--8<---
-->8---

yes, no calls whatsoever, for all files that meet the new defaults,
which imply strict and warnings: sane defaults.

Just an idea

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.31      porting perl5 on HP-UX, AIX, and Linux
https://useplaintext.email  https://tux.nl  http://www.test-smoke.org
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
0
perl5
6/28/2020 5:41:31 PM
=D0=B2=D1=81, 28 =D0=B8=D1=8E=D0=BD. 2020 =D0=B3. =D0=B2 02:42, Paul "LeoNe=
rd" Evans <leonerd@leonerd.org.uk>:
> TL;DR - lets try "use v7" for now as a way to experiment incrementally
>   on a per-file basis before we flip the world

This would not change the current situation for better at all - perl X
still would have to be backward compatible with perl 5, at least on
source-parsing level. But if we treat all files as "use v7" by
default, this is no longer required, so we can actually remove all the
mis-feature bloat accumulated over years.

Best regards,
Sergey Aleynikov
0
sergey
6/28/2020 6:17:16 PM
--0000000000005bc16105a92900b0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 28, 2020 at 2:17 PM Sergey Aleynikov <sergey.aleynikov@gmail.co=
m>
wrote:

> =D0=B2=D1=81, 28 =D0=B8=D1=8E=D0=BD. 2020 =D0=B3. =D0=B2 02:42, Paul "Leo=
Nerd" Evans <leonerd@leonerd.org.uk
> >:
> > TL;DR - lets try "use v7" for now as a way to experiment incrementally
> >   on a per-file basis before we flip the world
>
> This would not change the current situation for better at all - perl X
> still would have to be backward compatible with perl 5, at least on
> source-parsing level. But if we treat all files as "use v7" by
> default, this is no longer required, so we can actually remove all the
> mis-feature bloat accumulated over years.
>

This does not follow logically. Making it default has no effect on what can
be removed.

-Dan

--0000000000005bc16105a92900b0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Sun, Jun 28, 2020 at 2:17 PM Sergey Al=
eynikov &lt;<a href=3D"mailto:sergey.aleynikov@gmail.com">sergey.aleynikov@=
gmail.com</a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid=
 rgb(204,204,204);padding-left:1ex">=D0=B2=D1=81, 28 =D0=B8=D1=8E=D0=BD. 20=
20 =D0=B3. =D0=B2 02:42, Paul &quot;LeoNerd&quot; Evans &lt;<a href=3D"mail=
to:leonerd@leonerd.org.uk" target=3D"_blank">leonerd@leonerd.org.uk</a>&gt;=
:<br>
&gt; TL;DR - lets try &quot;use v7&quot; for now as a way to experiment inc=
rementally<br>
&gt;=C2=A0 =C2=A0on a per-file basis before we flip the world<br>
<br>
This would not change the current situation for better at all - perl X<br>
still would have to be backward compatible with perl 5, at least on<br>
source-parsing level. But if we treat all files as &quot;use v7&quot; by<br=
>
default, this is no longer required, so we can actually remove all the<br>
mis-feature bloat accumulated over years.<br></blockquote><div><br></div><d=
iv>This does not follow logically. Making it default has no effect on what =
can be removed.</div><div><br></div><div>-Dan=C2=A0</div></div></div>

--0000000000005bc16105a92900b0--
0
grinnz
6/28/2020 6:20:23 PM
Reply: