clay icon indicating copy to clipboard operation
clay copied to clipboard

Add D example

Open bangbangsheshotmedown opened this issue 3 months ago • 3 comments

Hello,

I love your library, I use C and D, so I figured i'd share this example since you seems interested in providing bindings to other languages

D is a wonderful language, it also is a C compiler, so one can import C files directly, without needing to create bindings

I know D can understand C's macros, but I couldn't figure out a way to use them, i'll revisit that later

My code is not perfect, but I think this is a good starting point, maybe other D users can come and help improving it, D has fantastic template/mixin features, so I'm pretty sure this can be made much better.

Using your library from D is as simple as this:

dmd main.d clay.c

bangbangsheshotmedown avatar Oct 29 '24 19:10 bangbangsheshotmedown