D Cross Compiler

Daniel Green venix1 at gmail.com
Sat Apr 16 23:17:10 PDT 2011


On 4/16/2011 9:21 PM, Brendan Simon (eTRIX) wrote:

> I believe that eCos is written in C++ (or a restricted subset), and I
> presume that it performs quite well, so given that, I see no reason why
> a D based OS/RTOS could not perform as well as eCos or other OSes.
Squeak is a good example of that too.  The smalltalk language is 
interpreted but the developers of Squeak have managed to extract a 
subset that can be compiled as  C code.  Allowing Squeak to be written 
in smalltalk.

One obstacle is D's runtime is coupled to the compiler.  Several runtime 
functions are part of the code the compiler outputs.  I am not aware of 
any documentation other than phobos and tango source that describes that 
coupling.

For example 'new' requires _d_newclass and 'throw' requires _d_throw. 
In addition to the module related output per file.

The Windows driver module, possibly others I'm just familiar with that 
one, may be a good way to think of the problem.  Essentially one has 
layers that would give access to an increasing subset of D until you 
reach the full capabilities offered.

bare-metal : D subset WYSIWYG.  D requires no support functions. Outputs
	minimal extra code.
kernel : Basic support functions.
driver(low): Kernel allocated objects. Maybe GC.
driver(high): Templates, GC, TLS, basically full D at this point.
user: Phobos or equivalent runtime.


That's just my perception of the problem.  I have no experience with 
actually designing such a system.


More information about the D.gnu mailing list