cperl icon indicating copy to clipboard operation
cperl copied to clipboard

mro: switch from dfs to c3 as default

Open rurban opened this issue 9 years ago • 2 comments

The default MRO needs to switch from the old DFS (depth-first-search) to the recommended and perl6/Moose C3 algorithm, which was previously optional. All object systems based on inheritence need to use C3 to avoid the diamond problem. And this change speeds it up, avoiding run-time loading of ext/mro, and avoids having the old dfs in memory.

If it's not possible to fix all the internal and cpan modules, just use C3 for the new classes.

rurban avatar Oct 13 '16 06:10 rurban

This change needs to export sv_sethek to be visible to CORE extensions. Xp => EXpd

And the ISA order for some classes changed now. Need to adjust some fragile tests, and even some yet unknown c3 bugs (#251)

  • run/switchDBG.t for -DC
Inconsistent hierarchy during C3 merge of class 'Math::BigInt::Subclass':
	current merge results [
		Math::BigInt::Subclass,
	]
	merging failed on 'Exporter' at t/Math/BigInt/Subclass.pm line 17

Full list of regressions (~1 or 2 bugs):

	../cpan/Math-BigInt/t/inf_nan.t
	../cpan/Math-BigInt/t/isa.t
	../cpan/Math-BigInt/t/sub_ali.t
	../cpan/Math-BigInt/t/sub_mbf.t
	../cpan/Math-BigInt/t/sub_mbi.t
	../cpan/Math-BigInt/t/sub_mif.t
	../cpan/Math-BigInt/t/upgradef.t
	../cpan/NEXT/t/actual.t
	../cpan/NEXT/t/actuns.t
	../cpan/NEXT/t/unseen.t
	../cpan/libnet/t/ftp.t
	../cpan/libnet/t/require.t

zlib is also broken, but probably related to the attempted broken zlib-1.2.11 update.

rurban avatar Feb 12 '17 10:02 rurban

Testing CPAN with c3, and submitting tickets. Maybe we need a backcompat Configure setting -Dmro=dfs, but better not.

Fixed problems in CORE:

On CPAN:

  • CPAN-SQLite #120241
  • NetAddr-IP
  • Text-CSV

Blocked by:

  • EUMM http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/91 (my c3-wip branch)

rurban avatar Feb 14 '17 12:02 rurban