Mailing List Archive

Re: Stack Traces (was Data::Printer in core)
On 2/8/24 11:54, Dan Book wrote:
> On Thu, Feb 8, 2024 at 11:29?AM Michael Conrad <mike@nrdvana.net> wrote:
>
> (Semi-related, the other big debugging feature missing from core
> perl is Carp::Always.  How on earth are new developers supposed to
> realize that the way to get an extended stack trace is a CPAN
> module named "Carp::Always"???)
>
> My recommendation for inclusion in core for this purpose would be
> Devel::Confess.
>
> -Dan
I was sort of meaning the name as well.  "carp" "cluck" "croak"
"confess" are all fun quirky perl-isms, but anyone coming from another
language is going to search for "stack trace"
i.e. what if you could actually control how many lines of stack trace
get appended to a 'die' or 'warn'?
    perl --stacktrace=full
    perl --stacktrace=10
Re: Stack Traces (was Data::Printer in core) [ In reply to ]
On Thu, Feb 8, 2024 at 6:03?PM Michael Conrad <mike@nrdvana.net> wrote:

> I was sort of meaning the name as well. "carp" "cluck" "croak" "confess"
> are all fun quirky perl-isms, but anyone coming from another language is
> going to search for "stack trace"
> i.e. what if you could actually control how many lines of stack trace get
> appended to a 'die' or 'warn'?
> perl --stacktrace=full
> perl --stacktrace=10
>

IMHO until we have proper exception objects any work in that area is going
to be painful and deficient. We shouldn't be thinking about going there
until we have better foundations.

Leon
Re: Stack Traces (was Data::Printer in core) [ In reply to ]
On 2/8/24 13:27, Leon Timmermans wrote:
> On Thu, Feb 8, 2024 at 6:03?PM Michael Conrad <mike@nrdvana.net> wrote:
>
> I was sort of meaning the name as well.  "carp" "cluck" "croak"
> "confess" are all fun quirky perl-isms, but anyone coming from
> another language is going to search for "stack trace"
> i.e. what if you could actually control how many lines of stack
> trace get appended to a 'die' or 'warn'?
>     perl --stacktrace=full
>     perl --stacktrace=10
>
>
> IMHO until we have proper exception objects any work in that area is
> going to be painful and deficient. We shouldn't be thinking about
> going there until we have better foundations.
>
> Leon

Considering the overhead that would add to every single 'die'... will we
ever go there?  meanwhile every developer needs to see stack traces on a
daily basis, and newcomers to the language need them twice as much.

It could even be forward-looking, as essentially just an extra
configuration parameter to the default die/warn implementation:

    perl --stacktrace=My::ExceptionClass

   { local ${^STACKTRACE}= 'My::ExceptionClass';
     ...
   }
  { local ${^STACKTRACE}= 0; # fastest exceptions
     ...
   }
Re: Stack Traces (was Data::Printer in core) [ In reply to ]
On Thu, 8 Feb 2024 19:27:05 +0100
Leon Timmermans <fawaka@gmail.com> wrote:

> IMHO until we have proper exception objects any work in that area is
> going to be painful and deficient. We shouldn't be thinking about
> going there until we have better foundations.

+1

--
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/