4 ms·
Most of wrappers in D are actually very thin wrappers over C bindings, focusing on C interop rather than trying to push D objects through. But to be honest, no
by skocznymroczny 8y ago
Most of wrappers in D are actually very thin wrappers over C bindings, focusing on C interop rather than trying to push D objects through. But to be honest, no matter what you do, as soon as you begin to interface with C, you are throwing safety out of the window anyway.
- dbaupp 8y agoThere's the unsafety inherent to C, with the risks of bugs in the underlying library, and there's unsafety caused by misusing the API. Safe languages often provide enough power to make the latter impossible, for a C API that fits standard patterns like "new, some operations, free", or even reference counting. I think D, via classes, is one of these languages, with enough power to make the wrapper itself safe (that is, impossible to misuse the API), at least for basic stuff like construction and destruction.