On Thu, 02 Sep 2010 18:55:14 +0400, Don <[email protected]> wrote:
Steven Schveighoffer wrote:
On Wed, 01 Sep 2010 17:11:50 -0400, Jonathan M Davis
<[email protected]> wrote:
On Wednesday, September 01, 2010 13:54:15 Philippe Sigaud wrote:
On Wed, Sep 1, 2010 at 22:37, bearophile <[email protected]>
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.
DDMD advances pretty fast, it can already compile druntime, phobos and
some of the applications. We also started updating it to newer versions,
so it's catching up (ddmd is at 2.036 atm). GC is disabled atm due to
memory corruptions inherited from DMD, though. I believe once we resolve
those and enable GC we could backport the changes to DMD so that it could
use Boehm's GC. Win-win?