mixin + CTFE, to big a hammer??
Don Clugston
dac at nospam.com.au
Fri Mar 2 08:43:02 PST 2007
Mikola Lysenko wrote:
> kris Wrote:
>> D mixin, in it's current guise, is about equivalent to crack-cocaine.
>> Easily the worst thing that happened to the language, IMO.
>>
>> Just say no
>
> However, there are simply too many hazards with the mixin statement.
> Mixins are not lexically closed - you can very easily mess with names from the exterior scope. They suffer many of the problems encountered in the C preprocessor.
> Excessive use of mixins and metaprogramming causes compile times to balloon to ridiculous lengths, far exceeding even the horrors of C++.
That's a *huge* claim! Have you got examples of this?
I've done some very nasty things with mixins and metaprogramming, and
I've never seen a compile time that was longer than for a "Hello World"
windows C++ app!
I'm inclined to agree that the new string mixins are not adequately
constrained. But I feel the effects on compile times are exaggerated.
The net effect is that they undo many of the advantages D once held.
>
> My belief is that the basic problems with mixins result from their reliance on string manipulation for meta programming - rather than syntactic and structural concepts. If we want to create mixin like behaviors (and I think that ultimately it is a good goal) they need to be presented in the logical context of a program manipulator - not a text processor. The current mixin syntax needs to be aborted before we go any farther down this line of thought. The longer it sticks around in the language, the harder it is going to be to kill.
>
> I vote it gets axed in the next release.
>
> -Mik
More information about the Digitalmars-d-announce
mailing list