This is the first in a series of a half dozen responses to Vadim's AttrX::Moo post that replace a couple earlier failed attempts to post here. I apologize if there end up being repeats or my following up with several responses is inappropriate.
Hi Vadim. I'm making this my first post because it assumes the approach you've taken is the thing to focus on first. But imo some of my later posts will be much more important and may render this one moot. Please bear this in mind as you read this. I expect to have posted all the posts within the next hour if this one gets through. > First of all, I wanted to make the module as transparent for a user a possible. It basically means that one should not be worried much about using 'is mooish' trait and what side effects would it cause to his code. That sounds simple and wise. > This is why Proxy is used as an attribute container. It allows for using of auto-generated accessors or user-provided ones without extra headache of how to deal with conflicts. It's being said that Proxy is problematic in many aspects, but it would be eventually fixed, wouldn't it? So far it does the job for me. The primary problem I was alluding to is that, at least last time I investigated, Proxy semantics reserve the right to repeat FETCH calls multiple times per single read and likewise STORE calls per single write and in reality this happens a lot, or at least used to. I think the number of repeats was improved in recent years but that repeat calls were not entirely eliminated. To the degree this might be considered something to be fixed, I think it's been known for 5-10 years and, aiui (as I understand it), there's no urgency felt, nor or even a long term commitment, to fully fixing it. There are also some reported bugs on RT https://rt.perl.org/Public/Search/Simple.html?q=proxy and GH https://github.com/rakudo/rakudo/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+proxy+ That said, P6 is driven forward by its users interacting with the community and/or ecosystem. If you create test cases covering functionality that matters to you and/or your company and get them added to roast, the suite of tests that officially define P6, you can directly and formally influence prioritizing of attention to P6's and Rakudo's capabilities and bugs. > What is confusing me is that it's the second time I get advised against use of Proxy because of its problems. Is it a first-class member of Perl6 class family or is it just a play toy? Aiui it's first class. Current Proxy semantics are that it is allowed to repeat FETCHs and/or STOREs multiple times per single read and/or write. That's fine for some things and a pain for others. Perhaps this limitation, in combination with P6 being slow, has led to less use of it than might be expected and that in turn has led to low pressure on fixing the bugs listed earlier. That's just speculation on my part though. -- raiph