Reimplementing the bulk of std.meta iteratively
Steven Schveighoffer
schveiguy at gmail.com
Tue Sep 29 19:30:58 UTC 2020
On 9/29/20 2:43 PM, bachmeier wrote:
> On Tuesday, 29 September 2020 at 14:07:14 UTC, Andrei Alexandrescu wrote:
>> 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.
I think there's some disconnect here -- AAs as a language feature are a
resounding success. They way they are implemented in the language is
not. I wouldn't call it a failure, but it definitely is not as useful as
a fully supported library type could be.
-Steve
More information about the Digitalmars-d
mailing list