The OpenD programming language

D is a general-purpose, high-level, multi-paradigm programming language. It was first released by Walter Bright in 2001 as a direct competitor to C++. It retains the familiarity of C-like syntax; however it is not backwards-compatible with C at the source code level. This decision (among others) has allowed D to avoid many of the problems which plague C and C++ to this day.

D is powerful and expressive, yet elegant and readable. Although it does not command a significant market share, it is a mature and dependable option for 2026 and beyond. OpenD is a variant of D with a less bureaucratic development model, saner defaults and fewer regressions than upstream D. It has replaced C for most new programs that I write, including the dynamic backend which served this page.

Advantages

Disadvantages

Getting started

The easiest way to get started is to download OpenD and read Ali Çehreli's book. It was written for upstream D, but most of the content is still relevant to OpenD. You may also find this Makefile template useful:


DC := ldc2

DEBUG := -unittest

AMD64_HARDEN := -fcf-protection=full
AARCH64_HARDEN := -mbranch-protection=standard
HARDEN := -relocation-model=pic

LD_HARDEN := -Xcc=-pie \
-L=-z -L=nodlopen \
-L=-z -L=noexecstack \
-L=-z -L=relro \
-L=-z -L=now \
-L=--as-needed \
-L=--no-copy-dt-needed-entries

DFLAGS := -O2 \
-g \
-d-debug \
--boundscheck=on \
--enable-asserts \
--enable-contracts \
-preview=nosharedaccess

LDFLAGS := 
OUT := a.out
CONFIG := $(DFLAGS) $(HARDEN) $(AMD64_HARDEN)

OBJS := $(patsubst src/%.d, obj/%.o, $(wildcard src/*.d))

.PHONY: all prepare clean

all: $(OUT)

prepare:
	mkdir -p obj

clean:
	rm -rf $(OUT) obj/*

$(OUT): $(OBJS)
	$(DC) $(CONFIG) $(LD_HARDEN) -of $(OUT) $(OBJS) $(LDFLAGS)
	objcopy --only-keep-debug $(OUT) $(OUT).debug
	objcopy --strip-unneeded $(OUT)
	objcopy --add-gnu-debuglink=$(OUT).debug $(OUT)

obj/main.o: src/main.d
	$(DC) $(CONFIG) -I src -c src/main.d -of obj/main.o