C to D bindings: how much do you D-ify the code?

Lionello Lunesu lionello at lunesu.remove.com
Sat Oct 26 13:43:45 PDT 2013


On 10/25/13, 15:34, Dicebot wrote:
> I think best approach is to have 2-step bindings. First step is pure
> 1-to-1 translation with no D-ification at all. Second step is D wrapper
> that expresses same functionality in more native syntax (probably even
> more type-safe). Step-2 module imports Step-1 module of course.
>
> Benefit of such approach is that you can generate bindings using
> automatic tool when new header version is out without wasting time on
> adjusting those to D style again and again - you only need to change
> step-2 module if there are some breaking API changes.

That's a good point. A "diff" is much more manageable with a 1:1 conversion.

L.


More information about the Digitalmars-d mailing list