Date: Sun, 30 Aug 2026 15:41:20 +0200
niedz., 30 sie 2026 o 15:34 Sebastian Wittmeier via Std-Proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> In practice there seem to be 4 ways how modern programming-languages handle exceptions.
>
>
> The need to sometimes propagate the errors up the call hierarchy is addressed.
>
> Sometimes possible exceptions are marked, sometimes not, sometimes both options are offered.
>
> Sometimes the call site, which can lead to an exception, is marked, sometimes not.
>
>
>
> 1. C++ exceptions / Java unchecked exceptions
>
> ==================================
>
> - Automatically propagate up the call stack
>
> - Caller does *not* have to mark at call site
>
> - Individual exceptions do *not* have to be listed in signature
>
> - In C++ function signature does not contain noexcept
>
>
You can add C# there too where there is no signature marinkig for
functions that throws.
Even more, you need to assume that all code can throw as `1 + x` can
throw too when it overflows.
>
> 2. Java checked exceptions
>
> ====================
>
> - Automatically propagate up the call stack
>
> - Caller does *not* have to mark at call site
>
> - Individual exceptions *must* be listed in signature
>
>
>
> 3. Swift throw
>
> ==========
>
> - Propagate up the call stack
>
> - Caller has to mark with try
>
> - Individual exceptions do *not* have to be listed in signature for untyped exceptions (function signature contains throw)
>
> - Individual exceptions *must* be listed in signature for typed exceptions
>
>
>
> 4. Zig try, Rust ?, Go error, C++ expected
>
> ==============================
>
> - Similar to 3., but error is part of return value
>
> - Compiler may warn/error, if return value is discarded
>
> - Has to be explicitly rethrown
>
> - Some languages offer operator to explicitly propagate
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> In practice there seem to be 4 ways how modern programming-languages handle exceptions.
>
>
> The need to sometimes propagate the errors up the call hierarchy is addressed.
>
> Sometimes possible exceptions are marked, sometimes not, sometimes both options are offered.
>
> Sometimes the call site, which can lead to an exception, is marked, sometimes not.
>
>
>
> 1. C++ exceptions / Java unchecked exceptions
>
> ==================================
>
> - Automatically propagate up the call stack
>
> - Caller does *not* have to mark at call site
>
> - Individual exceptions do *not* have to be listed in signature
>
> - In C++ function signature does not contain noexcept
>
>
You can add C# there too where there is no signature marinkig for
functions that throws.
Even more, you need to assume that all code can throw as `1 + x` can
throw too when it overflows.
>
> 2. Java checked exceptions
>
> ====================
>
> - Automatically propagate up the call stack
>
> - Caller does *not* have to mark at call site
>
> - Individual exceptions *must* be listed in signature
>
>
>
> 3. Swift throw
>
> ==========
>
> - Propagate up the call stack
>
> - Caller has to mark with try
>
> - Individual exceptions do *not* have to be listed in signature for untyped exceptions (function signature contains throw)
>
> - Individual exceptions *must* be listed in signature for typed exceptions
>
>
>
> 4. Zig try, Rust ?, Go error, C++ expected
>
> ==============================
>
> - Similar to 3., but error is part of return value
>
> - Compiler may warn/error, if return value is discarded
>
> - Has to be explicitly rethrown
>
> - Some languages offer operator to explicitly propagate
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2026-08-30 13:41:38
