Sane API design (AKA C's #ifdef hell)
Dejan Lekic
dejan.lekic at gmail.com
Fri Apr 17 13:33:49 UTC 2026
On Friday, 17 April 2026 at 12:57:23 UTC, Dennis wrote:
> Can you demonstrate how the C pre-processor would make
> bindbc-opengl easier?
My replies were not advocating for the C pre-processor. They were
just to make sure people are aware of the pain we who write
bindings to C libraries need to suffer in order to do it right...
In general, configuration management with D is terrible because
DOD (D gOD) thought `version` is enough, and then you see code
which first turns version(s) into enum(s), and then you see tons
of static ifs in the code.
This is probably one of the reasons why Rust people are rewriting
everything in Rust. Dealing with C libraries that have part of
the "API" in header files as insane macros, and part in the
actual library (static or dynamic) is no fun.
More information about the Digitalmars-d
mailing list