· Lexical · Modules · Declarations · Types · Properties · Attributes · Pragmas · Expressions · Statements · Arrays · Structs & Unions · Classes · Interfaces · Enums · Functions · Operator Overloading · Templates · Mixins · Contracts · Conditional Compilation · Handling errors · Garbage Collection · Memory Management · Floating Point · Inline Assembler · Interfacing To C · Portability Guide · Embedding D in HTML · Named Character Entities · Application Binary Interface |
D Application Binary InterfaceA D implementation that conforms to the D ABI (Application Binary Interface) will be able to generate libraries, DLL's, etc., that can interoperate with D binaries built by other implementations.Most of this specification remains TBD (To Be Defined). C ABIThe C ABI referred to in this specification means the C Application Binary Interface of the target system. C and D code should be freely linkable together, in particular, D code shall have access to the entire C ABI runtime library.Basic TypesTBDStructsConforms to the target's C ABI struct layout.ClassesAn object consists of:offset contents ------ -------- 0: pointer to vtable 4: monitor 8... non-static membersThe vtable consists of: 0: pointer to instance of ClassInfo 4... pointers to virtual member functionsThe class definition: class XXXX { .... };Generates the following:
InterfacesTBDArraysA dynamic array consists of:0: array dimension 4: pointer to array dataA dynamic array is declared as: type array[];whereas a static array is declared as: type array[dimension];Thus, a static array always has the dimension statically available as part of the type, and so it is implemented like in C. Static array's and Dynamic arrays can be easily converted back and forth to each other. Associative ArraysTBDReference TypesD has reference types, but they are implicit. For example, classes are always referred to by reference; this means that class instances can never reside on the stack or be passed as function parameters.When passing a static array to a function, the result, although declared as a static array, will actually be a reference to a static array. For example: int abc[3];Passing abc to functions results in these implicit conversions: void func(int array[3]); // actually Name ManglingTBDFunction Calling ConventionsTBDException HandlingWindowsConforms to the Microsoft Windows Structured Exception Handling conventions. TBDLinuxUses static address range/handler tables. TBDGarbage CollectionTBDRuntime Helper FunctionsTBDModule Initialization and TerminationTBDUnit TestingTBD |
Add feedback and comments regarding this page.