Perl 7 will smoothly continue the development of Perl 5 without breaking backwards compatibility

The Perl Project Governing Council outlined plans for further development of the Perl 5 branch and the creation of a Perl 7 branch. During the discussions, the Governing Council agreed that it is not acceptable to break compatibility with code already written for Perl 5, unless breaking compatibility is necessary to fix vulnerabilities. The Council also concluded that the language should evolve and new features should be promoted more intensively, while making emerging innovations easier to access and encouraging adoption.

Unlike the original intentions of allowing changes that break backwards compatibility to be included by default in the Perl 7 branch, the new plan is to gradually transition the Perl 5 branch into Perl 7 without breaking backward compatibility with existing code. The Perl 7.0 release will be conceptually no different from the next Perl 5.xx branch.

The development of new releases of Perl 5 will continue as before - new features added to the branch that are incompatible with the old code will, as before, be included only if the “use version” or “use feature feature” pragma is explicitly specified in the code. For example, Perl 5.010 introduced a new keyword "say", but since existing code could use functions named "say", support for the new keyword was enabled only by explicitly specifying the "use feature 'say'" pragma.

New syntax added to the language, which when processed in previous releases led to an error, becomes immediately available without the need to specify special pragmas. For example, Perl 5.36 will introduce a simplified syntax for processing multiple list values ​​at once (“foreach my ($key, $value) (%hash) {”) that will be immediately available, even in code without the “use v5.36” pragma.

In its current form, Perl 5.36 uses the "use v5.36" pragma to enable 13 interoperability-breaking features ('say', 'state', 'current_sub', 'fc', 'lexical_subs', 'signatures', 'isa', ' bareword_filehandles', 'bitwise', 'evalbytes', 'postderef_qq', 'unicode_eval' and 'unicode_strings'), enable the “use strict” and “use warnings” modes by default and disable support for the legacy indirect notation for calling objects (when instead of “- >" uses a space) and Perl 4 style multidimensional arrays and hashes ("$hash{1, 2}").

When enough changes have accumulated, instead of the next release of Perl 5.x, a version of Perl 7.0 will be generated, which will become a kind of state snapshot, but will remain fully backward compatible with Perl 5. To enable changes and settings that break compatibility, you will need to explicitly add the “use v7” pragma to the code. . Those. code with the "use v7" pragma can be treated as "modern Perl", in which compatibility-breaking language changes are available, and without - "conservative Perl", which will remain fully backwards compatible with past releases.

Source: opennet.ru

Add a comment