How to use D for cross platform development?

Chris W. wendlec at cd.ie
Thu Mar 29 02:12:45 PDT 2012


On Wednesday, 28 March 2012 at 15:31:26 UTC, Bennie Copeland 
wrote:
> Great to hear someone with experience with it. Was there any 
> issues with the code that had to be tweaked depending on the 
> OS? When I was looking at C++, there was implementation defined 
> data type sizes, endieness, implementation defined order of 
> variables in a struct, etc. On that topic, what do I have to 
> consider in D if I want binary compatibility in files saved on 
> different OS's?

I cannot give you any advice as regards C++, because I have never 
really used it - avoiding it like the plague. My strategy is to 
keep things as simple as possible and use C only as the "glue". 
It's a bit like the Lua approach which only uses ANSI C to ensure 
maximum portability.

Since I have just started to put the pieces together, I have yet 
to test whether it works on all platforms. I haven't tested it on 
Windows yet and don't know where the pitfalls are (and I am sure 
there are some!). It is amazing, though, how easily C code can be 
integrated into a D program. I have to use two external 
frameworks/libraries written in C (one of them the utf8proc 
library). With a few lines of code I've got all the functionality 
I need without writing any wrappers.

I have not yet used Objective-C with D directly. Does anyone have 
experience with that?


More information about the Digitalmars-d mailing list