Calypso
Calypso copied to clipboard
Major blocker: DMD bogus forward and circular reference errors.
Right now the (last?) major blocker for many complex C++ libraries lies in incorrect forward and circular referencing errors, caused by how DMD's semantic phases are currently designed. Those phases are too "catchall" and for example calling dsym.semantic()
when all the caller wants to know is if the dsym
symbol has a member named "foo" creates dependencies between symbols that may result in wrong forward/circular referencing errors.
The qt5demo example just got updated to not rely on module map files (which will be replaced by a pragma(cppmap)
parameter like proposed in https://github.com/Syniurge/Calypso/blob/documentation/calypso_proposal_pragma.md), but doesn't compile anymore because it triggers a circular referencing error within a Qt module.
I will fix a few more Calypso-specific issues, and then will start working on this again. I had a first shot at this last year: https://github.com/dlang/dmd/pull/7018 but will soon restart from scratch from current DMD master.
It will consist in splitting importAll/semanticN
functions into smaller blocks, and making DMD semantic analysis lazier especially for non-root modules (the ones not being codegen'd). The latter will also help against another Calypso issue which is the recursive instantiation of templates due to C++ being completely lazy whereas D isn't. For example the libstdc++/valarray.d test case fails because of recursive instantiation. Others would if there wasn't a RecursiveInstChecker
semi-hack that detects simple cases of recursive recursions and discard the declarations, but discarding is pretty bad.
I suppose those fwd reference errors are what leads to messages such as:
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
../xdr/Stellar-SCP.h(611): Error: size of type .ℂcpp.xdr.xvector.xvector!(SCPQuorumSet, 4294967292u) is not known
?