04-09-2022, 05:11 PM
I agree. One main reason for using direct 1:1 bindings is reuse of documentation and existing knowledge of the orifinal API. With this model there is a single API for all languages, that makes it straightorward to reuse.
The other approach, using target language's own constructs as I did with the Python and C# bindings, feels more integrated and natural with the target language semantics. But it requires more work to maintain, a whole new documentation to write, and new knowledge that must be gained despite having experience with the original API.
So at the end, having a targeted binding is nice for the developers of the target language that don't know the original API but is a pain to maintain, whereas a 1:1 translation maybe is not so nice with the target language, but is straightforward to use and work with the existing resources.
Here i don't consider execution performance as both bidings use .NET P/Invoke facility to make calls to native library, where the main overhead is, so performance should be quite similar for both.
The other approach, using target language's own constructs as I did with the Python and C# bindings, feels more integrated and natural with the target language semantics. But it requires more work to maintain, a whole new documentation to write, and new knowledge that must be gained despite having experience with the original API.
So at the end, having a targeted binding is nice for the developers of the target language that don't know the original API but is a pain to maintain, whereas a 1:1 translation maybe is not so nice with the target language, but is straightforward to use and work with the existing resources.
Here i don't consider execution performance as both bidings use .NET P/Invoke facility to make calls to native library, where the main overhead is, so performance should be quite similar for both.