[OT] Godot Engine: Disable C++ exception handling

Hipreme msnmancini at hotmail.com
Fri Aug 18 10:06:44 UTC 2023


On Tuesday, 15 August 2023 at 02:21:43 UTC, ryuukk_ wrote:
> I always been advocating against EH
>
> This is another missed opportunity at capturing that audience
>
> I think the builtin tuple DIP must be resumed right away once D 
> no longer is frozen
>
> https://github.com/godotengine/godot/pull/80612

I have been saying about how exception handling wasn't a good fit 
for game development, as I said before, games should fail as soon 
as possible, since they are super easy to enter in an invalid 
state, they're the completely the opposite from servers. Hipreme 
Engine is being developed completely without exceptions. I had to 
develop my own JSON solution since the `std.json` one uses 
exception, and also talked with p0nce about his libraries to not 
use exceptions.

The *only* place I use exceptions/error handling are in the hot 
reloading functionality since the user code can easily do errors 
such  as

```
int[] a;
a[0] = 50;
```

This will cause an AssertError, which my engine will handle 
manually to unload the shared library.

Also, my own JSON implementation consistently got 50% of the time 
used by std.json, probably for not throwing any kind of error, it 
is almost a drop-in replacement for it, except you manually check 
after parsing.




More information about the Digitalmars-d mailing list