Can you do this in D?

Alex Rønne Petersen alex at lycus.org
Thu Jul 26 22:04:03 PDT 2012


On 27-07-2012 06:56, Walter Bright wrote:
> On 7/26/2012 6:18 PM, Wes wrote:
>> 1. It has *practically forces use of the GC, since turning it off
>> means I can't
>> use many features of the language. This isn't as big of a deal to me
>> as it is to
>> many C++ devs (my assumption). A GC gives the impression of slow
>> managed, even
>> if the language isn't scripted/bytecode.
>
> C++ doesn't have features that would require a GC - not using the GC in
> D does not mean the language is crippled to be less than C++.

new and assert both result in GC allocation and are not easily replaced 
with functions that use manual memory management. You have to replace 
functions in druntime to get the desired effect. druntime isn't part of 
the language specification, so, strictly speaking, not using the GC in D 
/does/ make the language slightly more crippled than C++.

>
>
>> 2. It doesn't have ways of introducing new syntax (e.g. $, @, #
>> operators or
>> different variable attributes like myconst).
>> I don't see this as a major flaw as I don't know of any other language
>> other
>> than scheme/lisp/ratchet that allow this.
>
> We've explicitly decided not to do user defined syntax.
>
>
>> 3. It can't run *all* forms of code at compile time.
>>
>> 4. It doesn't have a simple prettyprint operator. I think .stringof is
>> a big
>> step forward from .ToString() for simplicity, but obviously $variable
>> would be
>> more terse.
>>
>> 5. It doesn't have a way to iterate over every id in scope.
>> I can't think of a good reason to do this anyway.
>
> We try not to add features just because we can - we try to do ones only
> if they have compelling use cases.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list