News for hackers. Stuff that matters.
Re:Can a LLM convert C, to ASM to specs and then to a workin... by djmips on Tuesday March 18, 2025 @04:18AM (#43396839)
Macros are the original Spawn of the Devil and their descendants are template metaprogramming.
Re:Can a LLM convert C, to ASM to specs and then to a workin... by WalterBright on Tuesday March 18, 2025 @11:16AM (#43400461)
Template metaprogramming can be abused, too. Expression templates come to mind. You can do expression templates in D, but I have discouraged it and it has not caught on to my relief.

But templates still are a better choice than macros.

Re:Can a LLM convert C, to ASM to specs and then to a workin... by djmips on Tuesday March 18, 2025 @11:41AM (#43400772)
I would have thought so but fast forward to today and we have template abuse that cause very long build times and creates gigabytes of symbols that flood memory and crash compilers and take debuggers to their knees and create the most inscrutable code to read and debug that MACRO jockeys could never have dreamed of.

I'm working on a C++ project where maintainers have had to resort to changing namespaces to single letters as a grotesque stop gap against the symbol table explosion!