Hacker News new | past | comments | ask | show | jobs | submit login

What syntax of nim's is the network: ... Used to declaratively construct the neural networks? Is it a macro? Looks really neat!



It is a small DSL written using macros at https://github.com/mratsim/Arraymancer/blob/master/src/array....

Nim has pretty great meta-programming capabilities and arraymancer employs some cool features like emitting cuda-kernels on the fly using standard templates depending on backend !


Yes, Nim macros can fiddle with the AST: https://nim-lang.org/docs/macros.html

You can also see another (I think) neat example in `npeg`: https://github.com/zevv/npeg?tab=readme-ov-file#quickstart




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

Search: