[D.typesystem] Static (CT) enforce anybody?

Don nospam at nospam.com
Thu Sep 2 07:55:14 PDT 2010


Steven Schveighoffer wrote:
> On Wed, 01 Sep 2010 17:11:50 -0400, Jonathan M Davis 
> <jmdavisprog at gmail.com> wrote:
> 
>> On Wednesday, September 01, 2010 13:54:15 Philippe Sigaud wrote:
>>> On Wed, Sep 1, 2010 at 22:37, bearophile <bearophileHUGS at lycos.com> 
>>> wrote:
>>> > Philippe Sigaud:
>>> > > Yes, Steve is right. Also, you cannot throw exceptions at CT.
>>> >
>>> > This is a temporary limitation :-)
>>>
>>> Really? That means being able to create reference types at CT, that'd be
>>> interesting, to say the least. And what code would catch them? Aren't 
>>> they
>>> caught by the runtime?
>>
>> Well, according to TDPL, the ultimate goal is to be able to use _all_ 
>> of SafeD
>> with CTFE. So, exceptions would be on the list. However, I wouldn't 
>> expect CTFE
>> to get that powerful anytime soon.
> 
> I think step 1 is to rewrite the compiler in D.  Right now, CTFE is 
> interpreting things from a C++-based program.  I think without a garbage 
> collector too.
> 
> -Steve

Writing the compiler in D would be great, but it's a long way off. This 
will happen a lot sooner than that.
Exceptions, like almost all other CTFE features, are blocked by bug 
1330. Fixing this will require a new CTFE memory allocation system. It's 
  not terribly complicated, but won't happen until the high priority 
bugs are taken care of.
Other than memory management, most of the CTFE machinery for classes and 
exceptions is already in place. Note, for example, that reference 
parameters and struct member functions work correctly.


More information about the Digitalmars-d mailing list