ImportC and nothrow/@nogc?

Manu turkeyman at gmail.com
Wed Aug 28 13:41:47 UTC 2024


On Wed, 28 Aug 2024 at 08:12, Walter Bright via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 8/26/2024 10:54 PM, Manu wrote:
> > The whole point of ImportC, is to use the API.
>
> Initially, yes. But the mission creep has already happened, and why not?
>

Where has it happened? The mission isn't even off the ground. I thought I'd
have a go, and it's a complete non-starter.
So no, I really just want to use the C API; it's called ImportC; surely
that's _literally the point_.


> And if someone does a binary-back-door... who cares? That's called a BUG.
> > They're playing with fire already! C doesn't have any such type safety,
> and they
> > shouldn't expect it to.
> > They know what they did; they did it intentionally, surely knew what the
> risk
> > factors were, and they are naturally expected to not write such bugs
> into their
> > program.
>
> The author of the C code likely has no idea that the caller from D exists
> let
> alone that it would require that the C code not call any D functions.
>

The author of the library expects you to use the library via the API they
provide... their API is C code; if C code is nothrow @nogc, then the
callback you provide is necessarily nothrow and @nogc also.
I really can't see the fuss here...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20240828/dfbb626a/attachment-0001.htm>


More information about the Digitalmars-d mailing list