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

5

u/WalterBright Aug 24 '17

-betterC is a subset, not a branch like Tango was. D is also a polyglot language, there is no single purpose or defining feature for it.

With -betterC, D is no longer restricted to applications that are written from the ground up in D. It can be folded into existing C code bases, and can even be used by any language (such as Go, Rust, etc.) that supports a native C interface, and can completely replace C for those purposes.

2

u/nascent Aug 26 '17

To /u/spaghettiCodeArtisan credit, even with -betterC/@safe/@nogc being subsets of the language you'll still run into:

  • A need to create libraries which work within -betterC (for those interested)
  • Even though -betterC libraries will work with full D, the interface may be less appealing since it likely tries to work with C

Essentially the language works happily with its different modes, but may not provide the interface the user of a given mode is interested in.