[OT] - C++ exceptions are becoming more and more problematic

Paulo Pinto pjmlp at progtools.org
Sat Feb 26 21:11:55 UTC 2022


On Saturday, 26 February 2022 at 20:59:53 UTC, IGotD- wrote:
> On Friday, 25 February 2022 at 21:03:21 UTC, forkit wrote:
>> [...]
>
> It seems to be some kind false narrative that Rust is savior of 
> all and will create a new world. The more I learn Rust, the 
> more I realize that's not the case.
>
> [...]

Case in point,

https://nnethercote.github.io/2022/02/25/how-to-speed-up-the-rust-compiler-in-2022.html

>  Decoder trait used for metadata decoding was fallible, using 
> Result throughout. But decoding failures should only happen if 
> something highly unexpected happens (e.g. metadata is 
> corrupted) and on failure the calling code would just abort. 
> This PR changed Decoder to be infallible throughout—panicking 
> immediately instead of panicking slightly later—thus avoiding 
> lots of pointless Result propagation, for wins across many 
> benchmarks of up to 2%.

Beware of always copying other language designs.


More information about the Digitalmars-d mailing list