How to use D for cross platform development?

Nick Sabalausky a at a.a
Wed Mar 28 12:18:44 PDT 2012


"Iain Buclaw" <ibuclaw at ubuntu.com> wrote in message 
news:mailman.1198.1332955673.4860.digitalmars-d at puremagic.com...
> On 28 March 2012 16:31, Bennie Copeland <mugen.kanosei at gmail.com> wrote:
>> On Monday, 26 March 2012 at 10:46:39 UTC, Chris W. wrote:
>>>
>>> I am using D for cross platform development. I recently implemented C
>>> wrappers for D. It works fine (Mac OS X). I could also create a Python
>>> module that consists of both D and C code (the C code is really just the
>>> wrapper for the module's functionality that is completely in D). It also
>>> works with Lua.
>>>
>>> I think the decision to make C logic part of the language was a very 
>>> very
>>> good idea. The dream of every cross platform developer.
>>
>>
>> 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?
>
> Binary compatibility by measure of thumb is no different to binary
> compatibility in C or C++ when moving executables across different
> versions of the same platform.
>

D makes it a little easier though with things like "int"/"long"/etc being 
the same size on all platforms, and "align" for structs. And just generally 
having less "undefined/implementation-defined" cruft.




More information about the Digitalmars-d mailing list