DIP 50 - AST macros

Doodoo barf at barf.com
Mon Nov 18 13:42:50 PST 2013


> Case in point - again and again I see utterly wretched use of 
> macros in C++ from the top level of C++ programmers who really 
> ought to know better. Want to see a lovely example? Take a look 
> at the C header files for openssl:
>
> https://github.com/D-Programming-Deimos/openssl/tree/master/C
>
> This is not unusual.
>
> I try to put my money where my mouth is. If you look at older 
> parts of dmd, you'll see macro abuse that I cleverly wrote. The 
> newer bits contain fewer and fewer use of any macros, and I've 
> made an ongoing effort to try and eliminate all of it (yebblies 
> has campaigned to get rid of it, too, even crap I tried to hang 
> on to). This has been done this without compromise on 
> performance and usability and readability of the code - and I 
> hope you'll agree that it looks nice without the usual rat's 
> nest of preprocessor abuse one sees in typical C++ code.

  Now, now Walter, that is C not C++. In C++ we would use Boost 
Preprocessor:)

  Also C macros are just crappy textural replacement, I would 
assume an AST macro would be along the lines of lisp, which 
doesn't have much of anything to do with the shitty macro system 
in C despite using the word "macro".

  Not that I care so whatevars!



More information about the Digitalmars-d mailing list