Interfacing D with C: Arrays Part 1

jmh530 john.michael.hall at gmail.com
Thu Oct 18 13:04:00 UTC 2018


On Wednesday, 17 October 2018 at 15:20:08 UTC, Mike Parker wrote:
> I had intended to publish the next GC series post early this 
> month, but after many revisions and discussions with a couple 
> of reviewers, I've decided to put it on hold until something 
> gets worked out about the conflation of destruction and 
> finalization in D (something I'll be pushing for soon).
>
> Instead, I've gone back to an article I started writing months 
> ago and put aside in favor of other things: my next post in the 
> 'D and C' series.
>
> This post is the first of what will likely be three dealing 
> with arrays (four if you count strings). It focuses primarily 
> on declaration and initialization and is intended to be 
> beginner friendly, assuming little or no knowledge of either C 
> or D.
> [snip]


The original interfacing C and D series on gamedev and in the 
Learning D book was very useful to me, but I really didn't know 
C. I mean, I knew the syntax and stuff, but there were so many 
details that I didn't know. For instance, there was an R library 
I used that called a C library. As an R user, I wasn't really 
exposed to any of the underlying C details. So there was quite a 
bit of learning curve when trying to use it in D, particularly on 
Windows. For instance, you don't just download the files and 
convert the headers. The dll the project provided was compiled 
with MinGW, so you have to recompile it with Visual Studio for it 
to link properly. My sense is that a lot of the C/D ecosystem 
just work(TM) a lot easier on Linux, to the extent that if I were 
doing it over again I would recommend people learning C/D on 
Windows to just use the Windows Subsystem for Linux for as long 
as they can.


More information about the Digitalmars-d-announce mailing list