Load dynamic libraries with no hand-written bindings!

ryuukk_ ryuukk.dev at gmail.com
Tue Sep 6 16:53:16 UTC 2022


That's pretty interesting, and it showcase the power and 
capabilities of ImportC, nice!

Few notes

- std.meta/std.traits = bloated and slow, i suggest sticking to 
plain __traits and copy/paste the few(2-3) functions that you need

- a whole class and new just to store that? you don't seem to 
make use of inheritance or any OOP features so a simple struct is 
enough imo

If both points are solved, it'll be betterC compatible out of the 
box, a win imo

Also, ``static import`` isn't nice, it leaks all the functions to 
the global scope, a little trick:

```D
import pa = portaudio;

(..)

auto dynamic = Dynamic!(pa, "portaudio_x64.dll")();
```

This should work?


More information about the Digitalmars-d mailing list