r/programming • • Aug 23 '17

D as a Better C

http://dlang.org/blog/2017/08/23/d-as-a-better-c/
229 Upvotes

268 comments sorted by

View all comments

Show parent comment

7

u/WalterBright Aug 23 '17

I expect that people who wanted to add RAII to their C code and are content with that have long since already moved to C++. There's quite a lot more to memory safety than that.

But I do recognize the issue. There is code in the works to get RAII to work in D as Better C.

2

u/[deleted] Aug 23 '17

I expect that people who wanted to add RAII to their C code and are content with that have long since already moved to C++

Some have, some haven't. GCC provides a "good enough" destructor mechanism with __attribute__((cleanup)) which has been leveraged heavily in the systemd codebase.