#D functions marked with @nogc can’t heap-allocate, which means they can’t even index an associative array. #noalloc
on 02025-07-29“DMD is the reference compiler for the #D programming language.” Baziotis recommends studying it. #compilers
on 02024-12-12#LDC is the #LLVM based #D compiler which Baziotis recommends studying. “The compiler uses the official DMD frontend to support the latest version of D2, and relies on the LLVM Core libraries for code generation.” #compilers
on 02024-12-12common misconceptions about #compilers: “Optimization gives us optimal programs”, “Branch weights and the CPU’s branch predictor”, “-O3 produces much faster code than -O2”, “Javascript interpreters JIT at runtime because they don’t know which paths are hot ahead of time”, “If you have a compiler, you don’t need an interpreter”, “The middle-end is target/platform-independent”, “The compiler optimizes for data locality”, “-O0 gives you fast compilation”, “Templates are slow to compile”, “Separate compilation is always worth it”, “Why does link-time optimization (LTO) happen at link-time?”, “Inlining is useful primarily because it eliminates a call instruction”, “The role of the inline keyword”, “The best production compiler to study is LLVM”, “Undefined behavior only enables optimizations”, “The compiler can “simply” define undefined behavior”, “99% correctness rate is ok”. All of these are false except for the ones that aren’t falsifiable. #Baziotis recommends studying the Golang compiler, LDC, and Digital Mars #D.
on 02024-12-12Walter Bright’s explanation of #X-macros from 02010 in #C and #D
on 02024-08-04