3 ms·
The coolest thing about nim is that it's macros participate in the type system and overload resolution and can work with both type checked and non type checked
by barchar 1y ago
The coolest thing about nim is that it's macros participate in the type system and overload resolution and can work with both type checked and non type checked code
- cb321 1y agoThe "dual" of this type-dispatch of template/macros is that the scoping rules also allow you to use a template or a macro to define a bunch of things which are only "in effect" in a sub-scope, like, e.g. that old C hazard of pointer arithmetic - "defined but contained": https://forum.nim-lang.org/t/1188#7366 https://forum.nim-lang.org/t/1188#7366 In a lot of little ways, Nim is a lot like a statically typed Lisp with a vaguely Python-ish surface syntax, although this really doesn't give enough credit to all the choice one has writing Nim code.
- barchar 1y agoWell, there's also term rewriting macros, which are basically full blown compiler plugins (and will likely be removed because they're so hard to get right
- dataangel 1y agoThis is the comment that is going to get me to actually try Nim
- hugs 1y agoone of us! one of us!