Who favors the current D1 situation?

Kris foo at bar.com
Thu Mar 6 22:35:24 PST 2008


"Jarrett Billingsley" <kb3ctd2 at yahoo.com> wrote
[snip]
> Furthermore I'm not entirely sold on const and until that _actually_ gets 
> sorted I'd like to stay away from D2.   God only knows how long _that_ 
> will take.  A D1 + extras version of the compiler would be nice but that 
> seems like a special provision that would only make it harder for compiler 
> implementors and library users to conform to.
>
> I'll be contributing to Dil as much as I can over the rest of the semester 
> and the summer break, undoubtedly also contributing to the D2 side of 
> development, but I can't promise that I'll be switching to D2 any time 
> soon. Before D1 came out, I really didn't have a choice as to which 
> version of D to use, but now that D1 has been partially (mostly) 
> stabilized, I'd rather stick to it than to the ever-changing D2.


As one of the early proponents of const (actually, a subset of const), I 
have to admit to being disappointed with the current D2 mechanisms. Have 
avoided commentry in the past, because D2 has been positioned as merely 
experimental. However, from what I understand, Walter is feeling like the 
const design is almost baked.

My original beef was not being able to protect a return value (such as a 
char[]) from being abused without having to copy the returned content 
instead of returning a slice. At the time, the 'in' modifier provided 
suitable intent and control for read-only parameters, so the /hope/ was for 
something reasonbly simple (to the user) in order to handle the return-value 
aspect.

While I understand how things can sometimes quickly become complex while 
trying to support a simple notion, there's nothing trivial at all about 
using or comprehending the D2 const mechanisms. A claim has been made that 
one does not have to use or be aware of const or invariant to use D2 ... 
unfortunately that does not appear to be the case in practice, and the added 
complexity makes D2 harder to work with than D1.

At least for now, D1 is the language of choice for me. New features are nice 
enough, but they're not nearly sufficient to outweight the current 
const/invariant difficulties.

2c





More information about the Digitalmars-d mailing list