3 ms·
Your definition of flexible must differ from mine. The fact that you mentioned an AST as a plus and macros w/ runtime overhead tells me you don’t understand Lis
by armitron 6y ago
Your definition of flexible must differ from mine. The fact that you mentioned an AST as a plus and macros w/ runtime overhead tells me you don’t understand Lisp.
- TylerE 6y agoLisp macros operate on a representation of the AST. By overhead I mean the nim compiler can generate direct specific instatiations at compile time instead of doing runtime based duck-typing as in lisp. Like, you can have a macro that generates a different expansion based on the type of arguments passed, if you structure the macro that way. The macro can also take entire code blocks as arguments of course, so you can implement general purpose control structures that are first class citizens. Here's an example: https://peterme.net/cross-platform-guis-and-nim-macros.html https://peterme.net/cross-platform-guis-and-nim-macros.html
- junke 6y ago> Lisp macros operate on a representation of the AST. The representation of the AST is the AST in Lisp (Scheme has syntax objects). > By overhead I mean the nim compiler can generate direct specific instatiations at compile time instead of doing runtime based duck-typing as in lisp. SBCL has `deftransform`, which allows macro expansions to benefits from static type analysis.