2 ms·
> maybe you don't want to accept that there are good reasons against I'm a scientist. Before I accept something I need to see it first. I have not seen a singl
by sklogic 11y ago
> maybe you don't want to accept that there are good reasons against
I'm a scientist. Before I accept something I need to see it first. I have not seen a single non-straw-man argument against macros yet. Not a single one. Either vague scaremongering without any specifics, or attacks on something that is totally unrelated to the macros.
> Things of great power are almost always dangerous.
Macros combined with the proper discipline are by orders of magnitude less dangerous than pretty much any other programming practice in existence. That's the whole point - our aim as engineers is to eliminate complexity. Macros are the ultimate way of doing so.
> So unless D or Rust have macros, you end up with Julia and Clojure.
Rust got proper, Lisp-style macros. D metaprogramming is Turing-complete, but yes, quite a bit behind, now even less powerful than the modern C++.
> C, PL/I, Common Lisp, SAS, M4, Forth
Of this list, only CL and Forth had proper macros.
> that collectively overweight the advantages of macros.
Nothing can overweight the infinite (literally) list of advantages of macros. With macros, every single semantic property you can imagine is available to you at no cost. Without macros - only the limited set of things that the language designers decided to give you.