GUI program on Mac OS in D?

mrphobby mrp at spinrock.net
Wed Dec 6 16:50:10 UTC 2017


On Friday, 24 November 2017 at 15:56:21 UTC, Jacob Carlborg wrote:
> BTW, the following line [3] of the Dub file will embed the 
> Info.plist file in the executable, which can be handy if you 
> don't want to use application bundles. The Info.plist file is 
> not always necessary, I think my sample application will work 
> without it, but for some things is necessary.
>
> I also have a Dockerfile [4] with a cross-compiler setup that 
> targets macOS.
>
> You should also know that there's a bug in DMD, which I haven't 
> manged to fix, that occurs when returning certain structs from 
> Objective-C methods. I'm pretty sure if works correctly in LDC, 
> since it's using the LLVM backend that already knows about 
> Objective-C.
>
> Finally, since you're using D you'll not have ARC (Automatic 
> Reference Counting) which these days are preformed by the 
> Objective-C and Swift compilers. You'll need to resort to 
> traditional release/retain calls where appropriate. I have not 
> included those calls in my sample application.

I'm also interested in making native macOS apps. I have a lot of 
experience in Objective-C but I'm new at D. I'm a bit confused at 
what documentation to look at. In [1] I get the impression that 
support for creating instances is very rudimentary, but in [2] it 
looks much better with constructors mapped with @selector. What 
level of support is there in the latest DMD compiler?

Also, is there any support for creating macOS application bundles?

[1] https://dlang.org/spec/objc_interface.html
[2] https://wiki.dlang.org/DIP43


More information about the Digitalmars-d-learn mailing list