D

From RogueBasin
Jump to navigation Jump to search

Introduction

D is static, compiled language influenced by C++. It was created by Walter Bright, author of the first C++ compiler to compile directly to machine code.[citation needed]

D has an imperative core, but is a multi-paradigm language that includes support for object-orientated, functional, and generic programming.

Advantages

  • Fast language, with performance comparable to C++ while still being garbage collected by default.
  • Interfaces well with C libraries, without writing boilerplate or using a foreign function interface, though cannot import headers unmodified - see http://www.digitalmars.com/d/2.0/htomodule.html . Although C++ interfacing is more limited, it is available (see D Programming Language Specification: Chapter 33).
  • Has a modern module system, no need to write header files or deal with a preprocessor.
  • Syntax is familiar to C, C++, C#, Java etc programmers.
  • Supports the functional programming paradigm better than other C-like languages, with features such as closures, delegates, transitive immutability, higher order functions, anonymous functions, and the ability to write compiler enforced pure functions.
  • D2 tries to do the template metaprogramming thing, which C++ supports without really meaning to, in a way that's actually sane to use.
  • DMD builds code incredibly fast, making compile-edit-run cycles comparable to dynamic languages. Build automation tools like make, etc. are used in the same way as they are used in C/C++ projects.
  • Knowledgeable, helpful community (including the D.learn forum for asking questions).
  • Unicode native - call the ☃.melt() function, or instantiate a 💡!T; the basic string type is UTF-8.
  • A package registry (http://code.dlang.org/)

Disadvantages

  • There aren't as many libraries available if you want pure D implementations.
  • The language is mostly stable, but still has breaking changes on rare occasion.
  • Documentation sometimes abstruse or lacking examples; paucity of beginner learning resources.

Compilers/Tooling

Roguelike Libraries

D Roguelikes

Links