Pattern matching is-expressions
uplink.coder at googlemail.com
Wed Aug 19 14:23:16 UTC 2020
On Wednesday, 19 August 2020 at 13:37:54 UTC, Dennis wrote:
> On Wednesday, 19 August 2020 at 12:03:59 UTC, Stefan Koch wrote:
>> Does a limited pattern matching still fulfill a desirable
>> power to complexity ratio though?
> If D were to be rebuilt from the ground up with first-class
> types, things could definitely be simplified. The existence of
> meta-programming libraries wrapping traits and is-expressions
> is a sign that D's introspection is not intuitive or ergonomic.
> However, considering the current template parameter system is
> so deeply ingrained into the D language and is-expressions
> simply leverage most of that, I don't think we should do away
> with is-expressions.
I fully agree.
I want to keep is expressions as they are.
They have their place.
I hope that with the slow introduction of features which
demonstrate first class types we can migrate away from having to
use them for common patterns though.
And also from having to have _costly_ wrapper libraries.
So far the only thing I see which can remove some of the cost of
templates is to provide optimized compiler intrinsics.
More information about the Digitalmars-d