Reimplementing the bulk of std.meta iteratively

bachmeier no at spam.net
Tue Sep 29 18:43:23 UTC 2020


On Tuesday, 29 September 2020 at 14:07:14 UTC, Andrei 
Alexandrescu wrote:
> On 9/29/20 9:38 AM, bachmeier wrote:
>> On Tuesday, 29 September 2020 at 12:02:21 UTC, Patrick 
>> Schluter wrote:
>> 
>>> Your AA example is a good one. If it wasn't in the language, 
>>> it would be the same issue with AA as in any other language 
>>> that defines it in libraries: several different incompatible 
>>> restricted implementations.
>> 
>> That's a good example. IMO there's a difference between a 
>> language and bits and pieces that can be put together to call 
>> random libraries.
>
> There is no doubt to Walter or myself that the way built-in AAs 
> were done in D is a resounding failure.

If so, it's a pretty good resounding failure, because I like them 
and they would most likely not be available to me now if they 
hadn't been built into the language. Long ago when I used Common 
Lisp, there was the incredible FSet library that provided 
functional collections kind of like Clojure. Unfortunately few 
people knew about them or used them, and it doesn't look like 
anything has been done with them in a long time: 
https://common-lisp.net/project/fset/ Sometimes a library 
solution works, but it's in general a risky proposition to rely 
on libraries for such a fundamental feature.

If AAs had been introduced as a library in 2012, the repo would 
probably have a couple hundred open issues and the last 
development would have been in 2017.

> The way they should have been done was a templated library type 
> AssociativeArray!(K, V) with the V[K] type syntax sugar on top. 
> That would have allowed the implementation to improve along 
> with the rest of the language and its library.

Does anything prevent the introduction of a new library solution? 
If it's good enough, it can eventually be added to the language.

I'm not going to pretend to be a language designer. My experience 
as a language user is that a big set of core functionality works 
better than a small set plus libraries. It's possible I don't 
understand your proposal.


More information about the Digitalmars-d mailing list