If D becomes a failure, what's the key reason, do you think?

David Medlock noone at nowhere.com
Fri Jul 7 16:08:23 PDT 2006


Brad Roberts wrote:

> David Medlock wrote:
> 
>> Walter Bright wrote:
>>
>>> Tesuji wrote:
>>>
>>>> In article <e8l426$26o3$1 at digitaldaemon.com>, Don Clugston says...
>>>>
>>>>> It's all in the libraries. D is a fantastic language to write 
>>>>> libraries for. That's where you get the benefit from all the 
>>>>> incremental improvements. If const-by-default enables the creation 
>>>>> of much better libraries, then it's worth the pain. If it doesn't, 
>>>>> don't do it.
>>>>> Ruby had this huge surge in popularity not because of the language, 
>>>>> but because of the library Ruby On Rails. Developing good libraries 
>>>>> requires a stable language, and we don't have that right now. The 
>>>>> protection/module system seems to be completely broken.
>>>>
>>>>
>>>>
>>>> Agreed, in addition I also believe that a const-by-default C++ like 
>>>> reference
>>>> type is needed before any container library (like DTL) can be 
>>>> effectively
>>>> written. Currently D is lacking in this area where C++ is strongest. 
>>>> relying
>>>> solely on built-in array / hash is hardly the solution.
>>>
>>>
>>>
>>> I don't understand why either of these would *prevent* effective 
>>> libraries from being built. Neither enables new programming 
>>> techniques or paradigms, they are just aids to documentation and 
>>> debugging.
>>
>>
>> I feel the same.  Libraries either
>> a) Are passed allocated objects, in which they are allowed to 
>> manipulate them.  No need for const there(that I can see).
>>
>> b) Allocate and return objects/data.  Definitely no need for const there.
>>
>> Java has tons of libraries, as does Ruby, and Perl, and C, and tons of 
>> other libraries without const.  No offenses intended, this is 
>> bordering on an obsession.
>>
>> With garbage collection, I just don't see the HUGE benefits of const....
>> -DavidM
> 
> 
> This seems to only include 'core' type libraries.  Application level 
> libraries often take in business level objects that often should be for 
> 'looking but not touching'.  Even intrinsic types, like strings, fall 
> squarely into that bucket.
> 
> I don't understand the argument against having the concept of const-ness 
>  in a language.  That other languages don't have the concept doesn't 
> make the concept irrelevant.  I can see there being an interesting 
> debate over it being the default state of objects.  I'm personally 
> _very_ interested in trying default const for a few months to see how it 
> feels.
> 
> If it's not obvious, I'm squarely in the camp of language/contractually 
> enforced const is good and I want it.
> 
> Later,
> Brad

I am not *against* it, I just disagree with people who say its a feature 
D cannot succeed/compete without.

I am all for the concept, just not the C++ idea of it.


For a better one how about the _let_ construct in ML languages:

let var = expression in <statements> end

During <statements> the var cannot be modified and the compiler checks 
this.  Note this is *single assignment*, not exactly the same thing as 
the type modifier in C++.

-David



More information about the Digitalmars-d mailing list