Andrei's list of barriers to D adoption
David via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 6 17:51:45 PDT 2016
On Tuesday, 7 June 2016 at 00:19:27 UTC, Brad Roberts wrote:
> On 6/6/2016 2:16 AM, Walter Bright via Digitalmars-d wrote:
>> On 6/6/2016 1:15 AM, Russel Winder via Digitalmars-d wrote:
>>>> * Safety has holes and bugs.
>>>
>>> Then so does C, C++ and Rust, so this is just a comment made
>>> because it
>>> can be made and sounds bad. Bad enough to salve the
>>> conscience of the
>>> speaker as to why they are not already using D.
>>
>> It's pretty clear when they say that, and then continue using
>> C++ which
>> has no safety, that safety isn't the real reason.
>
> This isn't a small problem, don't dismiss it quite that
> quickly. Safety as a usable subset of D is still pretty
> non-existent and yet is used as a selling point. The language
> still has holes -- I don't have bug report numbers, but others
> have reported them in the past, some closed some not. At the
> library level things are far worse. I've yet to be able to
> write any interesting apps with an @safe main.
>
> Has anyone?
>
> Later,
> Brad
My two cents on what I've read so far (in my week long pursuit of
learning this language), is that D's safety system is the same
old "C++" style philosophy in disguise. Sure if you follow all of
the paradigms and code in an idiomatic way, you will have less
bugs. But my experience is people do things less idiomatic and
more idiotic.
In short, D has an opt in system. Which means it's EXTREMELY easy
to opt out. Which is essentially what C++ has to. You can have a
moderate amount of memory safety if you still to smart pointers
and stray away from manual memory management (sure you have some
things to worry about, such as cross referencing, etc), but
forging a pointer is so easy. And even worse...so convenient at
times.
Languages like Go, C# and Java are far better in this regard
because you have to go WAAAAY out of your way to start doing
silly things. You can. And you can by accident (C# has delegates
that lead to a lot of leaks for instance), but in general the
situation is better.
D has the features...but they are opt in. Which means people
aren't gonna go out of there way. Just like in C++. Just an
observation.
In other news if I had to guess I'd say @safe never was meant to
be slapped on main, but to help give you reasonable guarantees of
where issues are not. However, @unsafe would have probably been
better (so you'd have to opt into the unsafeness) because that is
greppable.
In terms of safety, I don't see how D is any different than C++.
Which is why Rust is probably going to be the tool people reach
for safety. But only have reaching for Go, C# and Java, because
they require so much less of a learning curve.
More information about the Digitalmars-d
mailing list