Perl 7 announced

At today's Virtual Perl Developers Conference announced a Perl 7 project that will smoothly continue the development of the Perl 5 branch without making radical changes. Perl 7 will be similar to the release Perl 5.32.0, except for other default settings better suited to current development practices. Otherwise, Perl 7 will remain the same as Perl 5 and will retain compatibility with previously developed applications.

A significant change in the version number will act as a kind of separator for the transition to a new model for increasing the functionality of the Perl language without a noticeable violation of backward compatibility.
Perl 7 is expected to help attract new developers to use Perl and to streamline the process of adding significant new features to the language while maintaining codebase compatibility with existing projects. The number 7 was chosen because Perl 6 was used in the development of the language, which is now develops under the separate name Raku. The first release of Perl 7 is expected next year. The Perl 5.32 branch will be the last in the Perl 5 series and is planned to be supported for 5 to 10 years.

The most notable change in Perl 7 will be the default "strictβ€œ, implying strict checking of variable declaration, use of symbolic pointers, and assignment of subroutines. Using "use strict" is good practice and is used by most developers. Similarly, by default, they plan to enable warning handling ("use warnings").

Perl 7 also hopes to stabilize and enable by default some already existing experimental features, such as function signatures ("use feature 'signatures'"), which allow, when defining a function, to determine the incoming arguments and automate the check for their number (it will be possible to write "sub foo ($left, $right) {" instead of "sub foo { my($left, $right ) = @_;"). It is planned to include by default also support for the "isa" operator to check whether an object is an instance of the specified class or a class derived from it ("if( $obj isa Package::Name )", as well as postfix dereferencing operations (postderef) "$ sref->$*" instead of "${ $sref }", "$aref->@*" instead of "@{ $aref }" and "$href->%{ ... }" instead of "%$href{ ... } ".

Perl 7 default disable contenders are:

  • Indirect object call notation ("no feature qw(indirect)") is an obsolete way of calling objects that uses a space instead of "->" ("method $object @param" instead of "$object->$method(@param)"). For example, instead of "my $cgi = new CGI" one would always need to use "my $cgi = CGI->new".
  • Bare file descriptors without variable declarations ("no bareword::filehandle") - using constructions like "open FH, $file" will lead to an error, you need to use "open my $fh, $file". The change will not affect the standard file descriptors STDIN, STDOUT, STDERR, ARGV, ARGVOUT, and DATA.
  • Perl 4 style dummy multidimensional arrays and hashes ("no multidimensional").
    For example, specifying "$hash{1, 2}" will result in an error, you need to use an intermediate array, for example "$hash{join($;, 1, 2)}".

  • Declaring prototypes in Perl 4 style (need to use "use :prototype()").

In more distant plans, they expect to enable Unicode support by default, which will save developers from specifying "use utf8" in the code. For modules and scripts that have problems with the new defaults, it is possible to bring back the behavior of Perl 5 by adding "use compat::perl5" to the code. Individual settings are also saved and can be changed individually.

Source: opennet.ru

Add a comment