CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 15 12:26:02 PDT 2017


On Wednesday, 15 March 2017 at 18:52:16 UTC, H. S. Teoh wrote:
> On Wed, Mar 15, 2017 at 03:59:46PM +0000, Stefan Koch via 
> Digitalmars-d wrote: [...]
>> Unsupported Features include :
> [...]
>>  - Floating point.
> [...]
>>  - unions
> [...]
>
> What are the chances / what's the expected timeframe of unions 
> being implemented?
>
> Support for unions in CTFE is a MAJOR milestone in making 
> std.math CTFE-able, which IMO will take D compile-time 
> capabilities to a whole new level, because it will greatly 
> expand the scope of what's computable at compile-time in terms 
> of floating-point constants, lookup tables, etc..  Imagine, for 
> example, a precomputed table of values transcendental functions 
> with some given resolution, for fast runtime lookups.
>
> (Of course, this also requires floating-point support in CTFE. 
> But that should be relatively easy(?). As long as both the host 
> and target architectures support the same set of IEEE 
> floating-point types, which is probably the case for our 
> currently-supported platforms.)
>
>
> T

I am not sure.
The CTFE-ABI is different from the ABI at runtime.
So more adventurous uses of unions are likely to be surprising.
As for floating point, I have yet to find a solution that will 
work for more numerically inclined people.
dmds constant folder apparently does some funky things in that 
domain as well.
I do not anticipate to have any of the fp stuff working before 
dconf.

Currently Unicode correct string-handling is more important.
After that comes class support.
FP is the very last thing on my list and will like take a lot of 
time.


More information about the Digitalmars-d mailing list