[dmd-internals] Refactoring of the Objective-C integration

Jacob Carlborg via dmd-internals dmd-internals at puremagic.com
Sun Mar 12 09:44:05 PDT 2017


> On 7 Mar 2017, at 08:10, Walter Bright via dmd-internals <dmd-internals at puremagic.com> wrote:
> 
> I don't see the value in, for example, compiling Linux code from Windows. As I said, it has never come up.


A couple of reasons of why I think it should be a runtime check:

* It is a runtime check today, at least partly

* Today it’s possible to cross-compile on macOS to 32bit. If the check is only performed at compile-time it would be possible to use a 64bit compiler to compile for 32bit without getting any compile time errors (note that the Objective-C integration is not supported on 32bit)

* LDC and GDC are cross-compilers 

Perhaps a bit far fetched, but one reason you _need_ to cross-compile on macOS is when targeting iOS, watchOS and tvOS devices which are all ARM devices. Of course, DMD doesn’t support ARM. But, when targeting the Simulator it will actually compile for x86 and not ARM, so it would be possible to use DMD for that.

-- 
/Jacob Carlborg


More information about the dmd-internals mailing list