3 ms·
macro programming in Lisp would be "programming programs". I don't see it here. This looks like compile-time execution to compute values. If it would be a macr
by _19qg 2y ago
macro programming in Lisp would be "programming programs".
I don't see it here. This looks like compile-time execution to compute values. If it would be a macro, it could return source code.
- pjmlp 2y agoIn general, a macro produces code at compile time, doesn't matter in which form it ends up in the binary, as long as the observable side effects are the same. Example of a library that generates serialization code, https://github.com/getml/reflect-cpp https://github.com/getml/reflect-cpp As mentioned the ongoing C++26 proposal with produce the desired source code at compile time, thus reducing the amount of code of libraries such that one.
- lispm 2y ago> In general, a macro produces code at compile time The term "macro" is overloaded. In a typical Lisp they are generating source as data, not just constant values. Lisp macros also work in interpreters and they can use arbitrary language features, incl. creating side effects or accessing external data sources.
- emmanueloga_ 2y agoSome people are calling this "multistage programming" [1] which is kind of related but not exactly the same as a macro system. -- 1: https://en.wikipedia.org/wiki/Multi-stage_programming https://en.wikipedia.org/wiki/Multi-stage_programming