Talk on D at DORS/CLUC
Lance Bachmeier
no at spam.net
Mon May 20 15:43:46 UTC 2024
On Monday, 20 May 2024 at 08:03:12 UTC, RazvanN wrote:
> Templates are quite cool and they do appeal the inner nerd, but
> the reality is that not so many people use templates. If you're
> not a library writer, chances are you'll stick to using normal
> functions.
The complexity of templates is probably more important (though I
agree with your point). Maybe after years of using the language
they will have uses here and there, but templates are not a
positive when showing off the language. Same for ranges.
> After my talk, some people that were using C++ came to talk to
> me. They're biggest problem was they were having buffer
> overflows which corrupted memory that were not caught by their
> linters. They liked the idea of automatic bounds checks and the
> fact that you can incrementally transition to D, however, they
> were wondering how safe is D when you are not using the GC.
> They also mentioned that they considered using Rust, however,
> it's pretty much an overkill for their use case. I told them
> that for their use case they can simply manually allocate
> memory and then create an array which contains the size
> information. The compiler will then check every access to the
> array for out of bounds indexes, however, they will still need
> to manage the memory manually. All in all, they seemed willing
> to try D, however, we cannot since if they will actually do it.
D has a GC that is the source of many complaints, but it also has
SafeRefCounted. Maybe I don't keep up with the C++ community, but
I thought they were fans of RC, based on the repeated claims that
you should seldom need to do manual memory management in C++.
SafeRefCounted is part of Phobos so it's not like you're relying
on a third-party package author to maintain it.
More information about the Digitalmars-d
mailing list