D/Objective-C 64bit

Jacob Carlborg doob at me.com
Tue Mar 11 11:23:07 PDT 2014


I just wanted to let everyone know that I have implemented D/Objective-C 
for 64bit. Everything that worked for 32bit should work, except for 
exceptions, which are not implemented yet.

Objective-C on 64bit uses the modern runtime, which is also the same 
used on iOS. This means D/Objective-C should now be compatible with iOS 
as well, at least in theory.

For those how don't know what D/Objective-C is. It is a language 
extension to D making it ABI compatible with Objective-C. This means 
it's possible to use Objective-C classes, methods, protocols 
(interfaces) and so on, directly just as it's currently possible to do 
with regular C functions.

Here's a recap of what's implemented, both for 32 and 64bit unless 
otherwise noticed:

* Classes
* Subclasses
* Instance and class methods
* Protocols (interfaces)
* Properties
* Exceptions (only 32bit)
* Selectors
* Class references
* String literals
* Casts

Some improvements that are really not part of Objective-C but are very 
convenient to have in D :

* Constructors
* Inheriting selectors
* Automatically generated selectors

On the other hand, here a list of what's not implemented yet:

* Blocks (similar to delegates)
* Categories (class extensions)
* Any form of automatic memory management
* Exceptions (64bit)
* Vtable optimization (64bit)

Objective-C exceptions on 64bit is implemented using the same mechanism 
as C++. I'm wondering if it would be possible for D (not just for this 
extension) to adapt this mechanism as well. This would make D compatible 
with both C++ and Objective-C exceptions on 64bit.

A DIP is available here [1] and the latest implementation is available 
here [2].

[1] http://wiki.dlang.org/DIP43
[2] https://github.com/jacob-carlborg/dmd/tree/d-objc

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list