Any estimates on having exceptions in betterC?
Mike Franklin
slavo5150 at yahoo.com
Mon Apr 22 01:58:34 UTC 2019
On Sunday, 21 April 2019 at 19:23:19 UTC, Igor wrote:
> Also now that dip1008 is implemented (using exceptions in
> @nogc) what is preventing it from happening?
The fundamental problem with having Exceptions in betterC is that
Exceptions are classes, and classes require runtime support in D.
I think the stack unwinding implementations are also in druntime.
betterC imports druntime, but doesn't link to it. Therefore,
anything in druntime that is not implemented as a template is not
going to be available to betterC.
There is a GSoC project that is planned for this year to convert
many runtime features to templates. That could potentially make
more features of D available to betterC builds, but the templates
themselves will also need to be modified to use templates all the
way down the stack.
There is another GSoC project planned for this year to convert
some of that low level code to templates as well, so that could
help.
There is also talk of a new class hierarchy that may be lighter
weight and may allow exception handling with less runtime
support: http://dconf.org/2019/talks/staniloiu.html We'll have
to wait until DConf to know more.
All of that work will eventually bring us closer to the "opt-in
continuum" that Andrei mentioned here:
https://forum.dlang.org/post/q7j4sl$17pe$1@digitalmars.com
But, that is going to take years with current manpower and
governance practices. I don't know if we'll ever have classes or
throw and catch facilities in betterC. I think if the
aforementioned opt-in continuum were achieved we wouldn't even
need betterC.
Anyway, there are plans to make light-weight opt-in programming
in D better (a betterD rather than a betterC), but it's going to
take time to get there. We need more people able and willing to
do the work to accelerate it. If you have the skills and want to
help, let me know. I can at least help reduce the barrier to
entry for new contributors.
Mike
More information about the Digitalmars-d
mailing list