Alternatives to exceptions for error handling

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Nov 23 11:03:57 UTC 2020


On Monday, 23 November 2020 at 10:58:29 UTC, Jacob Carlborg wrote:
> On Sunday, 22 November 2020 at 17:37:18 UTC, Roman Kashitsyn 
> wrote:
>> In the video from DConf 2020 about @live functions 
>> (https://youtu.be/XQHAIglE9CU) Walter mentioned that all @live 
>> functions are nothrow.  He also thinks that exceptions are 
>> obsolete.
>
> I haven't watched the video yet, but in general I think we need 
> some form of error handling that more or less have the same 
> semantics as the existing one. There are other ways to 
> implement what looks like exception. Just look at the error 
> handling in Swift, Zig and the proposal for C++ [1]. I think 
> without any form of language support and syntax sugar, error 
> handling is going to be a pain.

To get better C++ interop the best solution is to do whatever C++ 
does and focus on the ability to catch C++ exceptions in D code 
and vice versa.


More information about the Digitalmars-d mailing list