When testing Biohazrd with the DirectX API, I decided to split the API surface across various C# assemblies (IE: DXGI, D3D12, etc.)
I implemented this by splitting the TranslatedLibrary into multiple libraries. This worked pretty well, but I've had some pains around references which span the library boundaries. I have a transformation which looks for translated type references which will span library boundaries once the split is finished and rewrites them to (my self-implemented) ManuallyImplementedTypeReference. This unsurprisingly does not play nice with declarations which override how they are referenced.
The situation is workable, but I'm not sure if it would work nice in a more complex setting.
Add proper support to the output generation to split the library as it is written.
Add some mechanism for libraries (or things which resolve type references) to know about sibling libraries.
Provide a type reference which has a library reference which can resolve across boundaries. (This may be the simplest, but could be error-prone to use.)
When testing Biohazrd with the DirectX API, I decided to split the API surface across various C# assemblies (IE: DXGI, D3D12, etc.)
I implemented this by splitting the
TranslatedLibrary
into multiple libraries. This worked pretty well, but I've had some pains around references which span the library boundaries. I have a transformation which looks for translated type references which will span library boundaries once the split is finished and rewrites them to (my self-implemented)ManuallyImplementedTypeReference
. This unsurprisingly does not play nice with declarations which override how they are referenced.The situation is workable, but I'm not sure if it would work nice in a more complex setting.