Re:Trying out C++20's modules with Clang and Make
by dagmx on Monday October 16, 2023 @10:45AM
(#37900550)
Reading the module information would be significantly easier. (which is not something swig can do today since swig hasn’t been updated in a while )
Parsing code to define an API is horribly fragile. A single macro or unknown keyword can break it. Hence why you had to specify C not C++ headers.
Having a statically defined metadata like C++ modules do would have greatly simplified binding generation
There's two ways for tooling like swig to work with modules:
1. Read the compiled module and generate the stubs to call into it.
2. Read the source code for the module and generate the stubs for it.
Which of those, do you think, is easier than reading C (not C++) header files?