My programming and teaching blog

Metaprogramming in D

Created 01/05/2021 | Updated 01/05/2021 Status: WIP

D boasts one of the strongest, most flexible array of metaprogramming features amongst most existing languages, which allows it the ability to perform use-cases such as automating boilerplate without the need of external tooling; generating compiler optimised D code from a regex at compile-time; and running functions at compile-time to generate values/more code. All done using the language's built-in features with little compromise.

  1. Text templates that can execute code at compile-time