Intro to D metaprogramming - Creating a JSON serialiser
Created 2019-10-31 | Updated
dlang, tutorial, metaprogramming
A series which covers the creation of a basic JSON serialiser in D while teaching several different aspects of D's metaprogramming: templates; template arguments; function contracts; static if; static foreach; mixins, and more.
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.