We have two (little) student projects, which should use D for meta-programming/code generation.

More specifically string mixins and templates.

I understand (at least I think so :)) string mixins. The task is to create a small internal DSL, which is capable of printing out D code, which we then will use as a mixin. So basically using CTFE to create code at compile time. (any additional sources/ideas are welcome).

The second project considers templates.
My idea was to recreate some template expressions, like we all know and love (hate) in C++.
However I am not so sure if that is a really good idea.
As far as I understood it, that is basically what ranges in D do.
So this would just mean "code linear algebra with ranges", which I am sure plenty of D's libraries do already (mir?). (that doesn't mean, it is not a good learning experience for the student).


I would love to hear some opinions on that matter.


Reply via email to