Eloquently sums up my feelings about the disadvantages of dynamic typing
simendsjo
simendsjo at gmail.com
Wed Oct 16 04:14:22 PDT 2013
On Wednesday, 16 October 2013 at 10:58:04 UTC, John Colvin wrote:
> On Wednesday, 16 October 2013 at 10:52:47 UTC, simendsjo wrote:
>> On Wednesday, 16 October 2013 at 10:37:28 UTC, Timon Gehr
>> wrote:
>>> On 10/16/2013 08:46 AM, simendsjo wrote:
>>>>
>>>> No.. Give me a language that catches obvious bugs at
>>>> compile-time, makes
>>>> code self-documenting and doesn't let me worry about
>>>> performance.
>>>> ...
>>>
>>> Why just obvious bugs?
>>
>> Hehe. Sure - let the compiler catch *all* my bugs!
>>
>> scope, const, immutable, pure, nothrow, safe, ... D makes it
>> harder to shoot yourself in the foot, but you are aiming at
>> your foot by default..
>>
>> Too bad I have to add a lot of annotations
>> void f(Class i) {}
>> to
>> void f(in Class i) const pure nothrow @safe {}
>>
>> I would rather have to write
>> void f(@(mutable, escapes) Class i) @(impure mutable throws
>> unsafe) {}
>>
>> If @mutable and @impure existed, I could just add some
>> annotations at the top of each module, but it wouldn't help on
>> parameters.
>
> I wonder how easy it would be to write a little pre-processor
> using https://github.com/Hackerpilot/Dscanner that would
> effectively add those keywords.
Even if it were super simple and worked fine, I wouldn't use it.
It would in effect be a custom "Safe D" compiler that isn't
compatible with regular D.
More information about the Digitalmars-d
mailing list