Blog series to teach and show off D's metaprogramming by creating a JSON serialiser
sealabjaster at gmail.com
Thu Oct 31 00:05:06 UTC 2019
Currently only the first post is out, as I'd like to collect
feedback before writing any more.
The series is aimed at people new to D, or people who have heard
of D, but haven't really explored its metaprogramming too much,
hence certain things such as calling D's metaprogramming "often
overlooked" as that tends to be true for non/new users of D.
Sorry in advance if this is the wrong forum group to post to, I
didn't know whether to put it here or in the Learn group.
Future plans for this series:
* Serialising structs (next up).
* Serialising enums via their names, rather than values (and
certain complications such as is(SomeEnum == int) being true).
* Serialising classes.
* Using UDAs to let classes and structs customise their fields.
* Using __traits(compiles) to determine if a struct or class
implements a custom (de)serialisation function.
* Trying to think of how I can shoe horn mixin templates in,
just so they're shown off.
I'm welcome to any other ideas to try and fit into the series.
The serialiser won't be overly robust in terms of edge cases
(such as nested classes/structs needing to be filtered out
sometimes), but I'll try to mention them and provide a workaround
I've also taken to certain decisions in the code snippets, to try
and reduce the amount of things I need to explain at once, and to
hopefully make things more readable. e.g. Using "const string"
instead of just "const" or "enum" (and then having to explain why
not to use "enum" for strings), giving all if and else statements
brackets to make things more readable (that's the plan at least),
As for release schedule, I'm planning on getting at least one
post out a week.
Other than feedback for the actual content of the blog, I'd also
appreciate any feedback on visual style of the blog, since I'm
quite a novice at CSS, let alone writing things like this.
While I'm not really capable of contributing to D in terms of
improving phobos, or writing quality libraries, I'm hoping to at
least be able to provide some educational material on what I feel
makes D worth it as a way of contribution.
More information about the Digitalmars-d-announce