Hasty Briefsbeta

D as a Better C (2017)

11 days ago
  • #D Programming
  • #Compiler
  • #Better C
  • Walter Bright is the BDFL of the D Programming Language and founder of Digital Mars.
  • D was designed to interface easily with C, providing access to C libraries and OS APIs.
  • C programs cannot interface with D ones due to dependencies on the D runtime library.
  • Better C mode in D subsets the language to remove features requiring the D runtime, making it compatible with C.
  • Features removed in Better C include garbage collection, exceptions, and RAII.
  • Features retained include memory safety, modules, function overloading, and Unicode support.
  • Better C allows gradual conversion of C programs to D, maintaining functionality at each step.
  • Examples show D's Better C mode producing the same executable size as C for equivalent code.
  • Better C improves expressivity, readability, and safety of C programs without sacrificing performance.