develooper Front page | perl.perl5.porters | Postings from July 2020

On actually implementing core features [was: Re: Dual-life perl5-or-7 code and prototypes - impossible?]

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
July 2, 2020 18:38
Subject:
On actually implementing core features [was: Re: Dual-life perl5-or-7 code and prototypes - impossible?]
Message ID:
20200702193840.10418b17@shy.leonerd.org.uk
On Thu, 2 Jul 2020 13:03:37 -0400
Chris Prather <chris@prather.org> wrote:

> If the Perl community has taught me anything it's consensus building
> takes *way* longer than 3-5 years. Moose is now 14 years old and
> based on the conversations around Cor there is still not a full
> consensus about the need for a core object system beyond bless(), and
> we're just barely (say the last 3-5 years) into a majority consensus
> that Moose is probably a reasonably good idea as long as you remove
> about 50% of it, without a real agreement on which 50% should be
> removed.

I'm not sure that's really true these days. I think most of the core
folks are relatively clear on the fact that several things are missing:

 * try/catch
 * proper exceptions to go along with theabove
 * an object and class system
 * a better thing than given/when/smartmatch

Up until now there has been much talk and very little real activity.
People sometimes come along and suggest an idea or so, but very few
concrete implementations of real code ever turn up. I know because
until quite recently I have been very guilty of this - I'll suggest
"Hey, it would be great if ..." and nobody objects, but then nothing
ever happens. You can't just suggest a feature and expect that "someone
else" will implement it.


Midway through 5.31.x I was given a commit bit, and took it upon myself
to add the `isa` feature, as I saw it was a) necessary and b) a gateway
to gaining quite a few of the above features. All of them, in fact.

It is very much my intention to keep going; through 5.33.x I hope to
address some of the above - at the very least, arriving at having a
properly stable try/catch syntax, in core, by the time a 5.34 would be
released (summertime next year). I don't think it's realistic to aim at
having the object system in by then, but provided nothing too major
ends up getting in my way, I would expect that within a year's time you
could

  use feature 'try';

  try {
    foo();
  }
  catch ($e isa My::App::Exception) {
    say "Oopsie, you did ", $e->detail;
  }
  catch ($e) {
    say "Oopsie, something went bad: $e";
  }

and maybe also

  use feature 'match';

  match(bar()->colour : eq) {
    case ("red") {
      say "It was red";
    }
    case ("green", "blue") {
      say "It was green or blue";
    }
    default {
      say "It was some other colour";
    }
  }

-- 
Paul "LeoNerd" Evans

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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About