Perl / perl5

šŸŖ The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 540 forks source link

[PATCH] Remove legacy/dead code from B #14907

Closed p5pRT closed 9 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#126058 (status was 'resolved')

Searchable as RT126058$

p5pRT commented 9 years ago

From @atoomic

Created by @atoomic

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Perl Info ``` Flags: category=library severity=low Type=Patch PatchStatus=HasPatch module=B Site configuration information for perl 5.23.3: Configured by nicolas at Fri Sep 11 07:53:54 CDT 2015. Summary of my perl5 (revision 5 version 23 subversion 3) configuration: Commit id: 2efb8b4b644d5f3c28974a8f577081b4142decd2 Platform: osname=darwin, osvers=14.5.0, archname=darwin-2level uname='darwin nicolass-macbook.local 14.5.0 darwin kernel version 14.5.0: wed jul 29 02:26:53 pdt 2015; root:xnu-2782.40.9~1release_x86_64 x86_64 ' config_args='-des -Dusedevel' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include', optimize='-O3', cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib libs=-lpthread -ldbm -ldl -lm -lutil -lc perllibs=-lpthread -ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong' @INC for perl 5.23.3: lib /Users/nicolas/.dotfiles/perl-must-have/lib /Users/nicolas/perl5/lib/perl5/ /usr/local/lib/perl5/site_perl/5.23.3/darwin-2level /usr/local/lib/perl5/site_perl/5.23.3 /usr/local/lib/perl5/5.23.3/darwin-2level /usr/local/lib/perl5/5.23.3 . Environment for perl 5.23.3: DYLD_LIBRARY_PATH (unset) HOME=/Users/nicolas LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=... PERL5DB=use Devel::NYTProf PERL5LIB=/Users/nicolas/.dotfiles/perl-must-have/lib:/Users/nicolas/perl5/lib/perl5/ PERLBREW_BASHRC_VERSION=0.73 PERLBREW_HOME=/Users/nicolas/.perlbrew PERLBREW_MANPATH=/Users/nicolas/perl5/perlbrew/perls/perl-5.20.2/man PERLBREW_PATH=/Users/nicolas/perl5/perlbrew/bin:/Users/nicolas/perl5/perlbrew/perls/perl-5.20.2/bin PERLBREW_PERL=perl-5.20.2 PERLBREW_ROOT=/Users/nicolas/perl5/perlbrew PERLBREW_VERSION=0.73 PERL_BADLANG (unset) PERL_CPANM_OPT=--quiet SHELL=/bin/bash ```
p5pRT commented 9 years ago

From @atoomic

0001-Remove-legacy-dead-code-from-B.patch ```diff From e41fc8ffc1e02024e7a9bf2f272cf56291da60f5 Mon Sep 17 00:00:00 2001 From: Nicolas R Date: Fri, 11 Sep 2015 09:23:39 -0500 Subject: [PATCH] Remove legacy/dead code from B B was still using some PERL_VERSION checks in multiple places whereas it's part of core. This commit removes this dead code and bump B::VERSION. For archeology we can still use git if we want to know what it looks like in an older version. --- AUTHORS | 1 + ext/B/B.pm | 2 +- ext/B/B.xs | 83 ++------------------------------------------------------------ 3 files changed, 4 insertions(+), 82 deletions(-) diff --git a/AUTHORS b/AUTHORS index b5ef912..b6188e2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -891,6 +891,7 @@ Nick Ing-Simmons Nick Johnston Nick Williams Nicolas Kaiser +Nicolas R. Niels Thykier Nigel Sandever Niko Tyni diff --git a/ext/B/B.pm b/ext/B/B.pm index 0a7727c..706e19a 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -15,7 +15,7 @@ require Exporter; # walkoptree comes from B.xs BEGIN { - $B::VERSION = '1.58'; + $B::VERSION = '1.59'; @B::EXPORT_OK = (); # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK. diff --git a/ext/B/B.xs b/ext/B/B.xs index 016e030..5d15d80 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -22,24 +22,14 @@ typedef FILE * InputStream; static const char* const svclassnames[] = { "B::NULL", -#if PERL_VERSION < 19 - "B::BIND", -#endif "B::IV", "B::NV", -#if PERL_VERSION <= 10 - "B::RV", -#endif "B::PV", -#if PERL_VERSION >= 19 "B::INVLIST", -#endif "B::PVIV", "B::PVNV", "B::PVMG", -#if PERL_VERSION >= 11 "B::REGEXP", -#endif "B::GV", "B::PVLV", "B::AV", @@ -141,11 +131,6 @@ cc_opclass(pTHX_ const OP *o) return ((o->op_private & OPpASSIGN_BACKWARDS) ? OPc_UNOP : OPc_BINOP); if (o->op_type == OP_AELEMFAST) { -#if PERL_VERSION <= 14 - if (o->op_flags & OPf_SPECIAL) - return OPc_BASEOP; - else -#endif #ifdef USE_ITHREADS return OPc_PADOP; #else @@ -618,9 +603,7 @@ typedef SV *B__IV; typedef SV *B__PV; typedef SV *B__NV; typedef SV *B__PVMG; -#if PERL_VERSION >= 11 typedef SV *B__REGEXP; -#endif typedef SV *B__PVLV; typedef SV *B__BM; typedef SV *B__RV; @@ -702,11 +685,7 @@ const struct OP_methods { { STR_WITH_LEN("nextop"), OPp, STRUCT_OFFSET(struct loop, op_nextop), },/*10*/ { STR_WITH_LEN("lastop"), OPp, STRUCT_OFFSET(struct loop, op_lastop), },/*11*/ { STR_WITH_LEN("pmflags"), U32p, STRUCT_OFFSET(struct pmop, op_pmflags),},/*12*/ -#if PERL_VERSION >= 17 { STR_WITH_LEN("code_list"),OPp, STRUCT_OFFSET(struct pmop, op_code_list),},/*13*/ -#else - { STR_WITH_LEN("code_list"),op_offset_special, 0, }, /*13*/ -#endif { STR_WITH_LEN("sv"), SVp, STRUCT_OFFSET(struct svop, op_sv), },/*14*/ { STR_WITH_LEN("gv"), SVp, STRUCT_OFFSET(struct svop, op_sv), },/*15*/ { STR_WITH_LEN("padix"), PADOFFSETp,STRUCT_OFFSET(struct padop, op_padix),},/*16*/ @@ -718,13 +697,8 @@ const struct OP_methods { { STR_WITH_LEN("filegv"), op_offset_special, 0, },/*21*/ { STR_WITH_LEN("file"), char_pp, STRUCT_OFFSET(struct cop, cop_file), },/*22*/ { STR_WITH_LEN("stash"), op_offset_special, 0, },/*23*/ -# if PERL_VERSION < 17 - { STR_WITH_LEN("stashpv"), char_pp, STRUCT_OFFSET(struct cop, cop_stashpv),}, /*24*/ - { STR_WITH_LEN("stashoff"),op_offset_special, 0, },/*25*/ -# else { STR_WITH_LEN("stashpv"), op_offset_special, 0, },/*24*/ { STR_WITH_LEN("stashoff"),PADOFFSETp,STRUCT_OFFSET(struct cop,cop_stashoff),},/*25*/ -# endif #else { STR_WITH_LEN("pmoffset"),op_offset_special, 0, },/*20*/ { STR_WITH_LEN("filegv"), SVp, STRUCT_OFFSET(struct cop, cop_filegv),},/*21*/ @@ -754,17 +728,12 @@ const struct OP_methods { { STR_WITH_LEN("warnings"),op_offset_special, 0, },/*44*/ { STR_WITH_LEN("io"), op_offset_special, 0, },/*45*/ { STR_WITH_LEN("hints_hash"),op_offset_special, 0, },/*46*/ -#if PERL_VERSION >= 17 { STR_WITH_LEN("slabbed"), op_offset_special, 0, },/*47*/ { STR_WITH_LEN("savefree"),op_offset_special, 0, },/*48*/ { STR_WITH_LEN("static"), op_offset_special, 0, },/*49*/ -# if PERL_VERSION >= 19 { STR_WITH_LEN("folded"), op_offset_special, 0, },/*50*/ { STR_WITH_LEN("moresib"), op_offset_special, 0, },/*51*/ { STR_WITH_LEN("parent"), op_offset_special, 0, },/*52*/ -# endif -#endif -#if PERL_VERSION >= 21 { STR_WITH_LEN("first"), op_offset_special, 0, },/*53*/ { STR_WITH_LEN("meth_sv"), op_offset_special, 0, },/*54*/ { STR_WITH_LEN("pmregexp"),op_offset_special, 0, },/*55*/ @@ -773,7 +742,6 @@ const struct OP_methods { # else { STR_WITH_LEN("rclass"), op_offset_special, 0, },/*56*/ # endif -#endif }; #include "const-c.inc" @@ -1108,18 +1076,12 @@ next(o) ret = make_sv_object(aTHX_ (SV *)CopSTASH((COP*)o)); break; #endif -#if PERL_VERSION >= 17 || !defined USE_ITHREADS case 24: /* B::COP::stashpv */ -# if PERL_VERSION >= 17 ret = sv_2mortal(CopSTASH((COP*)o) && SvTYPE(CopSTASH((COP*)o)) == SVt_PVHV ? newSVhek(HvNAME_HEK(CopSTASH((COP*)o))) : &PL_sv_undef); -# else - ret = sv_2mortal(newSVpv(CopSTASHPV((COP*)o), 0)); -# endif break; -#endif case 26: /* B::OP::size */ ret = sv_2mortal(newSVuv((UV)(opsizes[cc_opclass(aTHX_ o)]))); break; @@ -1140,15 +1102,11 @@ next(o) case 30: /* B::OP::type */ case 31: /* B::OP::opt */ case 32: /* B::OP::spare */ -#if PERL_VERSION >= 17 case 47: /* B::OP::slabbed */ case 48: /* B::OP::savefree */ case 49: /* B::OP::static */ -#if PERL_VERSION >= 19 case 50: /* B::OP::folded */ case 51: /* B::OP::moresib */ -#endif -#endif /* These are all bitfields, so we can't take their addresses */ ret = sv_2mortal(newSVuv((UV)( ix == 30 ? o->op_type @@ -1557,13 +1515,7 @@ MODULE = B PACKAGE = B::IV #define PVMG_stash_ix sv_SVp | STRUCT_OFFSET(struct xpvmg, xmg_stash) -#if PERL_VERSION > 18 -# define PVBM_useful_ix sv_IVp | STRUCT_OFFSET(struct xpviv, xiv_u.xivu_iv) -#elif PERL_VERSION > 14 -# define PVBM_useful_ix sv_I32p | STRUCT_OFFSET(struct xpvgv, xnv_u.xbm_s.xbm_useful) -#else -#define PVBM_useful_ix sv_I32p | STRUCT_OFFSET(struct xpvgv, xiv_u.xivu_i32) -#endif +#define PVBM_useful_ix sv_IVp | STRUCT_OFFSET(struct xpviv, xiv_u.xivu_iv) #define PVLV_targoff_ix sv_U32p | STRUCT_OFFSET(struct xpvlv, xlv_targoff) #define PVLV_targlen_ix sv_U32p | STRUCT_OFFSET(struct xpvlv, xlv_targlen) @@ -1589,23 +1541,14 @@ MODULE = B PACKAGE = B::IV #define PVAV_max_ix sv_SSize_tp | STRUCT_OFFSET(struct xpvav, xav_max) #define PVCV_stash_ix sv_SVp | STRUCT_OFFSET(struct xpvcv, xcv_stash) -#if PERL_VERSION > 17 || (PERL_VERSION == 17 && PERL_SUBVERSION >= 3) -# define PVCV_gv_ix sv_SVp | STRUCT_OFFSET(struct xpvcv, xcv_gv_u.xcv_gv) -#else -# define PVCV_gv_ix sv_SVp | STRUCT_OFFSET(struct xpvcv, xcv_gv) -#endif +#define PVCV_gv_ix sv_SVp | STRUCT_OFFSET(struct xpvcv, xcv_gv_u.xcv_gv) #define PVCV_file_ix sv_char_pp | STRUCT_OFFSET(struct xpvcv, xcv_file) #define PVCV_outside_ix sv_SVp | STRUCT_OFFSET(struct xpvcv, xcv_outside) #define PVCV_outside_seq_ix sv_U32p | STRUCT_OFFSET(struct xpvcv, xcv_outside_seq) #define PVCV_flags_ix sv_U32p | STRUCT_OFFSET(struct xpvcv, xcv_flags) #define PVHV_max_ix sv_STRLENp | STRUCT_OFFSET(struct xpvhv, xhv_max) - -#if PERL_VERSION > 12 #define PVHV_keys_ix sv_STRLENp | STRUCT_OFFSET(struct xpvhv, xhv_keys) -#else -#define PVHV_keys_ix sv_IVp | STRUCT_OFFSET(struct xpvhv, xhv_keys) -#endif # The type checking code in B has always been identical for all SV types, # irrespective of whether the action is actually defined on that SV. @@ -1731,18 +1674,6 @@ NV SvNV(sv) B::NV sv -#if PERL_VERSION < 11 - -MODULE = B PACKAGE = B::RV PREFIX = Sv - -void -SvRV(sv) - B::RV sv - PPCODE: - PUSHs(make_sv_object(aTHX_ SvRV(sv))); - -#else - MODULE = B PACKAGE = B::REGEXP void @@ -1766,8 +1697,6 @@ REGEX(sv) PUSHi(PTR2IV(sv)); } -#endif - MODULE = B PACKAGE = B::PV void @@ -1939,9 +1868,7 @@ U32 BmPREVIOUS(sv) B::BM sv CODE: -#if PERL_VERSION >= 19 PERL_UNUSED_VAR(sv); -#endif RETVAL = BmPREVIOUS(sv); OUTPUT: RETVAL @@ -1951,9 +1878,7 @@ U8 BmRARE(sv) B::BM sv CODE: -#if PERL_VERSION >= 19 PERL_UNUSED_VAR(sv); -#endif RETVAL = BmRARE(sv); OUTPUT: RETVAL @@ -2190,8 +2115,6 @@ GV(cv) CODE: ST(0) = make_sv_object(aTHX_ (SV*)CvGV(cv)); -#if PERL_VERSION > 17 - SV * NAME_HEK(cv) B::CV cv @@ -2200,8 +2123,6 @@ NAME_HEK(cv) OUTPUT: RETVAL -#endif - MODULE = B PACKAGE = B::HV PREFIX = Hv STRLEN -- 2.3.2 (Apple Git-55) ```
p5pRT commented 9 years ago

From @jkeenan

On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

This is a bug report for perl from atoomic@​cpan.org\, generated with the help of perlbug 1.40 running under perl 5.23.3.

----------------------------------------------------------------- [Please describe your issue here]

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Can you provide a patch?

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

From @atoomic

James\, a patch was provided in my original message as an attached file

https://rt-archive.perl.org/perl5/Ticket/Attachment/1365405/731807/0001-Remove-legacy-dead-code-from-B.patch

2015-09-14 17​:19 GMT-06​:00 James E Keenan via RT \perlbug\-followup@&#8203;perl\.org :

On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

This is a bug report for perl from atoomic@​cpan.org\, generated with the help of perlbug 1.40 running under perl 5.23.3.

----------------------------------------------------------------- [Please describe your issue here]

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Can you provide a patch?

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

--- via perlbug​: queue​: perl5 status​: new https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126058

p5pRT commented 9 years ago

From @jkeenan

On Mon Sep 14 17​:07​:41 2015\, atoomic@​cpan.org wrote​:

James\, a patch was provided in my original message as an attached file

https://rt-archive.perl.org/perl5/Ticket/Attachment/1365405/731807/0001-Remove- legacy-dead-code-from-B.patch

My error. All tests passing on ordinary Linux build. Comments from people familiar with B and with XS sought.

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 9 years ago

From @iabyn

On Mon\, Sep 14\, 2015 at 11​:10​:33AM -0700\, Nicolas R. wrote​:

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Well I think originally the intention was that that the same code base for B could be shared among the various maintenance releases\, but I think that's more or less dead now. It's too much work to maintain portability across releases\, and we tend to just point-patch maintenance release as when they need it.

So this gets my vote.

-- No man treats a motor car as foolishly as he treats another human being. When the car will not go\, he does not attribute its annoying behaviour to sin\, he does not say\, You are a wicked motorcar\, and I shall not give you any more petrol until you go. He attempts to find out what is wrong and set it right.   -- Bertrand Russell\,   Has Religion Made Useful Contributions to Civilization?

p5pRT commented 9 years ago

From @tonycoz

On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Thanks\, applied as 9ca4b7ea1df2a8085f1c9fc84c5c2a8eebc01f52.

Tony

p5pRT commented 9 years ago

@tonycoz - Status changed from 'open' to 'resolved'

p5pRT commented 8 years ago

From @rurban

On Sep 17\, 2015\, at 2​:24 AM\, Tony Cook via RT \perlbug\-followup@&#8203;perl\.org wrote​: On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Thanks\, applied as 9ca4b7ea1df2a8085f1c9fc84c5c2a8eebc01f52.

Oh my\, what have you done? You hereby added yourself to the list of people who made CPAN worse to maintain.

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures.

The goal is to decrease entropy\, not making it worse.

p5pRT commented 8 years ago

From @atoomic

Hi Reini\, I probably do not have enough deep perl knowledge to have a relevant answer\, but to my mind this seems a strange policy to do not remove dead code for documentation purpose in any software in general.

The main purpose behind this commit was to - provide a lighter code - easier for a newbie to understand it as a whole - easier to maintain

Maybe it's doing more hurt than benefits\, if so I just would like to understand.

Note\, that you can still access these informations from an older version/tag.

I can understand that you would like to know what was the previous behavior for an older version / what was the changes in that version.

But should not you use git to check changes from a previous version ? i.e.> git diff v5.21.0..v5.23.0 ext/B/B.xs

Are you complaining that this commit is going to make the diff more difficult to read ?

Are you asking to convert this to a pod ?

Could you describe some useful cases where having previous behaviors in the source code is helpful.

Maybe reverting this case is the correct thing to do\, but I'm just trying to understand the value of preserving dead code.

Thanks for your precisions. nicolas

On Thu Sep 17 07​:02​:58 2015\, reini.urban@​gmail.com wrote​:

On Sep 17\, 2015\, at 2​:24 AM\, Tony Cook via RT \<perlbug- followup@​perl.org> wrote​: On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Thanks\, applied as 9ca4b7ea1df2a8085f1c9fc84c5c2a8eebc01f52.

Oh my\, what have you done? You hereby added yourself to the list of people who made CPAN worse to maintain.

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures.

The goal is to decrease entropy\, not making it worse.

p5pRT commented 8 years ago

From @toddr

On Thu Sep 17 07​:02​:58 2015\, reini.urban@​gmail.com wrote​:

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures. The git history seems sufficient to me. I don't follow what you're trying to achieve.

The goal is to decrease entropy\, not making it worse. I would argue that removal of dead code reduces entropy. Docs don't belong buried in code. If you feel this documentation is useful to someone\, I would argue it belongs in POD.

p5pRT commented 8 years ago

From @rurban

On Sep 17\, 2015 18​:06\, "Todd Rinaldo via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Thu Sep 17 07​:02​:58 2015\, reini.urban@​gmail.com wrote​:

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures. The git history seems sufficient to me. I don't follow what you're trying to achieve.

No\, it is not. What I want? As I said\, CPAN authors need boilerplate code the keep their modules running for all versions. They need the history of the op and sv changes.

p5p is not able to produce that\, not even talking about not being able to maintain B properly. It got better\, but still is a nightmare. You are actively helping to make it worse. Thanks. CPAN thanks you

The goal is to decrease entropy\, not making it worse. I would argue that removal of dead code reduces entropy. Docs don't belong buried in code. If you feel this documentation is useful to someone\, I would argue it belongs in POD.

I wrote several pods. Was it included? No. Go figure.

And here we need the necessary boilerplate for the type history\, which is now lost. There are several cpan modules which need that.

And please don't interfere with code you have no idea of.

p5pRT commented 8 years ago

From @rcaputo

On Sep 17\, 2015\, at 14​:24\, Reini Urban \reini\.urban@&#8203;gmail\.com wrote​:

On Sep 17\, 2015 18​:06\, "Todd Rinaldo via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Thu Sep 17 07​:02​:58 2015\, reini.urban@​gmail.com wrote​:

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures. The git history seems sufficient to me. I don't follow what you're trying to achieve.

No\, it is not. What I want? As I said\, CPAN authors need boilerplate code the keep their modules running for all versions. They need the history of the op and sv changes.

Inclusion isn't a guarantee of continued relevance or correctness.

To what extent is Perl obligated to include obsolete implementation?

To what extent is Perl obligated to maintain obsolete implementation?

To what extent is Perl obligated to assure the quality of obsolete implementation?

-- Rocco Caputo \rcaputo@&#8203;pobox\.com

p5pRT commented 8 years ago

From @toddr

On Thu Sep 17 11​:24​:49 2015\, reini.urban@​gmail.com wrote​:

On Sep 17\, 2015 18​:06\, "Todd Rinaldo via RT" \perlbug\-followup@&#8203;perl\.org

The goal is to decrease entropy\, not making it worse. I would argue that removal of dead code reduces entropy. Docs don't belong buried in code. If you feel this documentation is useful to someone\, I would argue it belongs in POD.

I wrote several pods. Was it included? No. Go figure.

Can you point to an RT or a mailing list link where you submitted it? I for one would interested in helping it get in.

p5pRT commented 8 years ago

From @ap

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 21​:00]​:

Inclusion isn't a guarantee of continued relevance or correctness.

No\, but exclusion is a guarantee of the opposite.

To what extent is Perl obligated to include obsolete implementation?

To what extent is Perl obligated to maintain obsolete implementation?

To what extent is Perl obligated to assure the quality of obsolete implementation?

Please take http​://neilb.org/tag/cpan-river/ to heart.

The questions you are asking amount to asking to what extent p5p is committed to causing downstream pain.

This must not be turned into a question of whether p5p can lawyer its way out of the fine print in some contract that p5p signed off on and is now bound by. That would be an adversarial stance toward its very users\, which really makes no sense.

There is no easy answer to the question\, primarily due to the fact that resources available to p5p are so utterly scarce. Some pain on some side is inevitable. Defensive lawyering is most plainly not a useful response though.

It should never be ā€œsorry that you are in pain\, but note that I was not under any obligation not to cause itā€.

It should always be ā€œsorry that Iā€™m about to cause some pain\, I tried my best but found no way of preventing (all of) itā€.

Regards\, -- Aristotle Pagaltzis // \<http​://plasmasturm.org/>

p5pRT commented 8 years ago

From @rjbs

* Reini Urban \reini\.urban@&#8203;gmail\.com [2015-09-17T10​:02​:34]

On Sep 17\, 2015\, at 2​:24 AM\, Tony Cook via RT \perlbug\-followup@&#8203;perl\.org wrote​: Thanks\, applied as 9ca4b7ea1df2a8085f1c9fc84c5c2a8eebc01f52.

Oh my\, what have you done? You hereby added yourself to the list of people who made CPAN worse to maintain.

No\, he has applied a commit that was proposed and seconded. You seem unhappy with that because you think it's a bad change. A more constructive reply might have bene just​:

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures.

There\, you make an argument for why it's a bad idea\, without insinuating that somewhere beyond the grave\, Richard Nixon is continuing work on his Enemies List. Except it's all Perl people this time.

nicolas's reply seems quite on point​: he thinks he is improving the code's readability\, which he seems to be\, but acknowledges that what you're describing sounds useful\, too\, and might belong in a more purpose-built document. That seems reasonable\, too.

You said you wrote some documentation on point. Is it still useful? Could you provide a link?

There's no reason to throw out useful information\, but it should be encoded in a way that's easy to use\, rather than left as dead code for each programmer to work out on their own.

-- rjbs

p5pRT commented 8 years ago

From @rcaputo

On Sep 17\, 2015\, at 15​:41\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 21​:00]​:

Inclusion isn't a guarantee of continued relevance or correctness.

No\, but exclusion is a guarantee of the opposite.

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it. Therefore​:

To what extent is Perl obligated to include obsolete implementation?

To what extent is Perl obligated to maintain obsolete implementation?

To what extent is Perl obligated to assure the quality of obsolete implementation?

The questions you are asking amount to asking to what extent p5p is committed to causing downstream pain.

No. The words you're trying to put in my mouth are inflammatory and inequivalent.

There seem to be strong ideological differences at play here. My questions probe these differences and prompt their discussion without trying to lead people to a particular conclusion.

The vast complex web of conflicts between Perl's development priorities and all of CPAN's is a given. The enligtening information is how people individually choose to reconcile those conflicts and what a consensus might be\, assuming anything resembling a consensus exists.

-- Rocco Caputo \rcaputo@&#8203;pobox\.com

p5pRT commented 8 years ago

From @ap

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 23​:45]​:

On Sep 17\, 2015\, at 15​:41\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 21​:00]​:

Inclusion isn't a guarantee of continued relevance or correctness.

No\, but exclusion is a guarantee of the opposite.

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it.

How will it become incorrect if itā€™s for versions of Perl that are no longer being updated? How will it become irrelevant if the versions of Perl it is for continue to exist and continue to be developed against?

You simply state as fact that this will happen; Iā€™m unconvinced without some reasoning why that should be so.

To what extent is Perl obligated to include obsolete implementation?

To what extent is Perl obligated to maintain obsolete implementation?

To what extent is Perl obligated to assure the quality of obsolete implementation?

The questions you are asking amount to asking to what extent p5p is committed to causing downstream pain.

No. The words you're trying to put in my mouth are inflammatory and inequivalent.

They may be so\, but they are not words I was trying to put in your mouth. I claimed that the things you said amount to this other thing I said; but I did not say nor meant to imply that *you* said the thing I drew an equivalence to.

Do you find it fair to characterise your questions as questions in the domain of contractual law?

(I must concede that this is not an open question​: I cannot find a ā€œnoā€ credible\, considering that the questions ask about the _obligations_ of Perl.)

(Who is ā€œPerlā€\, btw? The programming language incarnate does not existā€¦ are you referring to p5p? Or some other group?)

There seem to be strong ideological differences at play here. My questions probe these differences and prompt their discussion without trying to lead people to a particular conclusion.

The vast complex web of conflicts between Perl's development priorities and all of CPAN's is a given. The enligtening information is how people individually choose to reconcile those conflicts and what a consensus might be\, assuming anything resembling a consensus exists.

Fair enough; I did read them as leading questions\, rather than take them simply as open ones. I still believe that theyā€™re the wrong mode of even looking at the problem\, per above\, but I agree that the issues you tried to probe (ultimately) are the ones we need to discuss.

Regards\, -- Aristotle Pagaltzis // \<http​://plasmasturm.org/>

p5pRT commented 8 years ago

From @rurban

On Sep 17\, 2015\, at 11​:44 PM\, Rocco Caputo \rcaputo@&#8203;pobox\.com wrote​:

On Sep 17\, 2015\, at 15​:41\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​: * Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 21​:00]​:

Inclusion isn't a guarantee of continued relevance or correctness.

No\, but exclusion is a guarantee of the opposite.

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it. Therefore​:

This is not dead code. Now it it\, yes. This is/was boilerplate code for all B modules which have to work on OP and SV types. A simple cpan grep would have helped​:

https://github.com/jbenjore/B-Utils/blob/master/Utils.xs#L44 https://github.com/rurban/perl-compiler/blob/master/C.xs#L45 https://github.com/rurban/b-generate/blob/master/Generate.xs#L73

just for the SV classes. And this is just from my local harddisc.

To what extent is Perl obligated to include obsolete implementation?

To what extent is Perl obligated to maintain obsolete implementation?

To what extent is Perl obligated to assure the quality of obsolete implementation?

The questions you are asking amount to asking to what extent p5p is committed to causing downstream pain.

No. The words you're trying to put in my mouth are inflammatory and inequivalent.

"Downstream pain" is not inflammatory and inequivalent.

It would be less pain it p5p would offer help to CPAN authors. But they are not.

There seem to be strong ideological differences at play here. My questions probe these differences and prompt their discussion without trying to lead people to a particular conclusion.

The vast complex web of conflicts between Perl's development priorities and all of CPAN's is a given. The enligtening information is how people individually choose to reconcile those conflicts and what a consensus might be\, assuming anything resembling a consensus exists.

p5pRT commented 8 years ago

From @rurban

On Sep 17\, 2015\, at 5​:11 PM\, Atoomic via RT \perlbug\-followup@&#8203;perl\.org wrote​:

Hi Reini\, I probably do not have enough deep perl knowledge to have a relevant answer\, but to my mind this seems a strange policy to do not remove dead code for documentation purpose in any software in general.

The main purpose behind this commit was to - provide a lighter code - easier for a newbie to understand it as a whole

No\, it is not. A newbie asks himself what types are valid. A newbie is not only interested in blead\, he is interested in perl. perl is not just blead\, even if blead thinks so of itself. If it needs to look good\, look at the documentation. code is technical information.

- easier to maintain

So let the maintainers decide. They did the work to help CPAN authors in the past. If you and Todd now interfere to please the lazy maintainers CPAN authors are punished. From my point of view some outsiders are arguing in favor of the lazy maintainers. You had nothing to do with the maintenance work at all\, and nothing to do with downstream neither.

This does not help perl and not CPAN.

Maybe it's doing more hurt than benefits\, if so I just would like to understand.

Note\, that you can still access these informations from an older version/tag.

Who does? This argumentation is not helpful and wrong. Everything is lost forever in the depths of svn or git\, and nothing was ever successfully resurrected when deleted with that kind of argumentation. The parrot jit was deleted with that kind of argumentation because someone was to lazy or incapable to fix 2 tiny lines for amd64. It is gone\, and thereā€™s no chance to get it back. On the other hand the parrot optimizer could have been resurrected because nobody deleted it yet.

Deleting useful information is never good\, and calling it ā€œdead codeā€ and "legacy" is harmful. Please refrain from doing so. Maintainers are very willing to follow then. And sooner or later the product will be dead. Yes\, it happened.

Are you asking to convert this to a pod?

I have this information in two very popular documentations. But documentation is not code. It is much more work to extract the necessary CPAN code from a doc than from code. And the internal docs Iā€™m maintaining are usually half a year up to a year behind. I never took this code out of some docs\, I always took it out of code. code runs\, documentation is mostly wrong. perl5 does not even SW management to test their pod samples if they are right or broken. We did that with parrot\, but it was still broken all the time. Maintainers rarely care about docs. Outsiders bother them later.

Could you describe some useful cases where having previous behaviors in the source code is helpful.

See my answer of CPAN modules using these parts verbatim. Iā€™m pretty sure thereā€™s more\, that were just the 3 parts on my harddisc.

Anybody who wants to print parts of SVā€™s needs it. B offers no API to do that\, and even if it will offer it in the future\, it will not help CPAN\, because they have to work on older perls also.

Maybe reverting this case is the correct thing to do\, but I'm just trying to understand the value of preserving dead code.

It is NOT DEAD CODE! It lives.

Thanks for your precisions. nicolas

On Thu Sep 17 07​:02​:58 2015\, reini.urban@​gmail.com wrote​:

On Sep 17\, 2015\, at 2​:24 AM\, Tony Cook via RT \<perlbug- followup@​perl.org> wrote​: On Mon Sep 14 11​:10​:32 2015\, atoomic@​cpan.org wrote​:

B is still using some PERL_VERSION checks in multiple places whereas it's part of core\, and I'm not aware of plans to remove it from core.

Removing dead code makes it simpler to read\, and for archeology git is a great tool.

Thanks\, applied as 9ca4b7ea1df2a8085f1c9fc84c5c2a8eebc01f52.

Oh my\, what have you done? You hereby added yourself to the list of people who made CPAN worse to maintain.

Please revert. This is useful information you cannot get anywhere else. p5p maintains not a single useful documentation about the versions of those structures.

The goal is to decrease entropy\, not making it worse.

--- via perlbug​: queue​: perl5 status​: resolved https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126058

p5pRT commented 8 years ago

From @rcaputo

On Sep 18\, 2015\, at 01​:04\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 23​:45]​:

On Sep 17\, 2015\, at 15​:41\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 21​:00]​:

Inclusion isn't a guarantee of continued relevance or correctness.

No\, but exclusion is a guarantee of the opposite.

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it.

How will it become incorrect if itā€™s for versions of Perl that are no longer being updated?

I've been talking about dead code the general sense. It seems like you're discussing something more specific. Any disagreement we may have may stem from us talking about different things.

If what defines correctness changes in an evolving project\, code that must remain correct with respect to the past may no longer be correct in the present. For example\, even dead code must continue to compile and link against new releases. If executed\, it must not fail in novel ways as the things it depends on change.

How will it become irrelevant if the versions of Perl it is for continue to exist and continue to be developed against?

Dead code is irrelevant to the current state of a project by definition[1]. Compiling it into new releases is pointless. Any vestigial value can be preserved by converting it to documentation\, an example program\, a third-party library\, or a comment.

-- Rocco Caputo \rcaputo@&#8203;pobox\.com [1] https://en.wikipedia.org/wiki/Dead_code

p5pRT commented 8 years ago

From @bulk88

On Sat Sep 19 17​:32​:57 2015\, rcaputo wrote​:

How will it become irrelevant if the versions of Perl it is for continue to exist and continue to be developed against?

Dead code is irrelevant to the current state of a project by definition[1]. Compiling it into new releases is pointless. Any vestigial value can be preserved by converting it to documentation\, an example program\, a third-party library\, or a comment.

So would you support a patch that drops support for all Perl versions except blead from Encode on CPAN since all perl except blead is "dead code" and why should Encode support it?

Should every comment with an RT number in blead be deleted since the bug is "dead code" since it doesnt exist anymore?

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @ap

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-20 02​:35]​:

* Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de [2015-09-18 07​:10]​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 23​:45]​:

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it.

How will it become incorrect if itā€™s for versions of Perl that are no longer being updated?

I've been talking about dead code the general sense. It seems like you're discussing something more specific. Any disagreement we may have may stem from us talking about different things.

It seems like Iā€™m discussing something more specific?

Well we seem to be in the thread about perl#126058. Can you guess what specific thing I might be discussing?

If what defines correctness changes in an evolving project\, code that must remain correct with respect to the past may no longer be correct in the present. For example\, even dead code must continue to compile and link against new releases. If executed\, it must not fail in novel ways as the things it depends on change.

The question in perl#126058 is whether whatā€™s being called dead code is even dead code in the first place. That was what my questions were about; since ā€œI seem to be discussing something specificā€ you seem to have missed their thrust entirely and simply responded with a general discussion of the demerits of dead code. However correct the statements you made about dead code\, they have nothing to do with the question of whether the declared-dead code actually qualifies as such.

How will it become irrelevant if the versions of Perl it is for continue to exist and continue to be developed against?

Dead code is irrelevant to the current state of a project by definition[1]. Compiling it into new releases is pointless. Any vestigial value can be preserved by converting it to documentation\, an example program\, a third-party library\, or a comment.

That is all true. It is also irrelevant to the decisions about actual patches that need to be made in this ticket. Do you have any thoughts on that?

Regards\, -- Aristotle Pagaltzis // \<http​://plasmasturm.org/>

p5pRT commented 8 years ago

From @rcaputo

On Sep 21\, 2015\, at 04​:36\, Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de wrote​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-20 02​:35]​:

* Aristotle Pagaltzis \pagaltzis@&#8203;gmx\.de [2015-09-18 07​:10]​:

* Rocco Caputo \rcaputo@&#8203;pobox\.com [2015-09-17 23​:45]​:

Dead code has already been proven irrelevant. It will eventually be incorrect unless someone continues to maintain and QA it.

How will it become incorrect if itā€™s for versions of Perl that are no longer being updated?

I've been talking about dead code the general sense. It seems like you're discussing something more specific. Any disagreement we may have may stem from us talking about different things.

It seems like Iā€™m discussing something more specific?

Well we seem to be in the thread about perl#126058. Can you guess what specific thing I might be discussing?

My side of this discussion has always been about dead code in general. I wanted to address the pattern of a recurring problem instead of the specifics of this instance.

When I recognized my answers to your question were obviously going to be beneath you\, it made me realize we weren't talking about the same thing. I wanted to point out that incongruity before it got out of hand. I seem to have made things worse by doing so. I suppose that's a form of progress.

I apologize for my intrusion. It's obviously unwelcome\, and it wasn't as helpful as I imagined.

-- Rocco Caputo \rcaputo@&#8203;pobox\.com

p5pRT commented 8 years ago

From @rjbs

* bulk88 via RT \perlbug\-followup@&#8203;perl\.org [2015-09-21T02​:48​:31]

On Sat Sep 19 17​:32​:57 2015\, rcaputo wrote​:

Dead code is irrelevant to the current state of a project by definition[1]. Compiling it into new releases is pointless. Any vestigial value can be preserved by converting it to documentation\, an example program\, a third-party library\, or a comment.

So would you support a patch that drops support for all Perl versions except blead from Encode on CPAN since all perl except blead is "dead code" and why should Encode support it?

Should every comment with an RT number in blead be deleted since the bug is "dead code" since it doesnt exist anymore?

This is a false analogy.

Encode is released in a way that makes it possible to install on older perls. B is not.

If you can't install B on perl 5.12\, because B updates only come in new versions of Perl\, then keeping code in B to support 5.12 is not useful. It will not be reached\, so the code is dead.

The value that Reini initially pointed out was that someone who wants to target an older version of perl could look at the B source and see how things changed over time. This is value\, but it has nothing to do with the code still being executed.

Your analogy to Encode is really far off the mark.

-- rjbs