Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm intrested in your claim of nim's better metaprograming support. As I've stuck with D for its metaprograming abilities. Have any good starting points?


The free online book nimprogrammingbook.com has chapters on templates [1] and macros [2] which explain them with nice examples.

From what I gather from the D docs (which I have only casually browsed through), the kind of adhoc ast construction that nim macros enable is not possible in D.

[1] https://www.nimprogrammingbook.com/book/nimprogramming_rouge...

[2] https://www.nimprogrammingbook.com/book/nimprogramming_rouge...


D does not support macros quite deliberately, because macros make for incomprehensible code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: