How about a 100% CTFE?

Dejan Lekic dejan.lekic at gmail.com
Mon Nov 7 09:56:28 PST 2011


Don wrote:

> With what you propose:
> Cross compilation is a _big_ problem. It is not always true that the
> source CPU is the same as the target CPU. The most trivial example,
> which applies already for DMD 64bit, is size_t.sizeof. Conditional
> compilation can magnify these differences. Different CPUs don't just
> need different backend code generation; they may be quite different in
> the semantic pass. I'm not sure that this is solvable.
> 
> version(ARM)
> {
>     immutable X = armSpecificCode(); // you want to run this on an X86???
> }

A very good point, Don. I cross compile D code quite often. (Host: x86_64-
pc-linux-gnu, Targets: i686-pc-linux-gnu and i686-pc-mingw32)

Second point is - if code uses lots of CTFE's (many of them may call each 
other recursively) then what Gor proposes may *significantly* slow down 
compilation time.


More information about the Digitalmars-d mailing list