6 ms·
What syntax of nim's is the network: ... Used to declaratively construct the neural networks? Is it a macro? Looks really neat!
by CornCobs 2y ago
What syntax of nim's is the network: ... Used to declaratively construct the neural networks? Is it a macro? Looks really neat!
- supakeen 2y agoYes, Nim macros can fiddle with the AST: https://nim-lang.org/docs/macros.html 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 https://github.com/zevv/npeg?tab=readme-ov-file#quickstart
- warangal 2y agoIt is a small DSL written using macros at https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/nn/nn_dsl.nim 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 !