|
Boost : |
Subject: [boost] [outcome] "sea of noexcept, islands of throwing"
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2017-01-17 05:58:52
Niall,
I moved this to another thread, as I believe it is quite independent of the
documentation review.
I am trying to understand the concept of "sea of noexcept, islands of
throwing", and its significance.
First, is this programming technique the primary motivation for
Boost.Outcome? In the docs, I only saw a small mention of it, but from your
replies it looks like this is an important part of the library. But I might
be wrong.
This "sea and islands" are quite similar to what is described in P0364R0
("Report on Exception Handling Lite (Disappointment) from SG14"). The
authors argue that if the exception control flow is indicated explicitly,
the compiler has a better chance of performing optimizations.
I understand that your goal (with the Outcome library) is to offer
something more modest, but implementable in C++. You are saying, that the
C++ compiler can implement similar optimizations, provided that all the
try-catch-throw flows are confined to one translation unit. Did I get it
right?
The authors of P0364R0 claim that in some business domains, like video
games, if you encounter a failure to acquire resources, you might as well
terminate the program. For this reason RAII is not really that important
there: you want to shut down the app rather than clean up and continue. Is
it also what you are saying?
Do you also intend to support something like 'panic mode' in Rust? I do not
know Rust, but I understand that this 'panic mode' is shut down the program
but with resource cleanup.
Sorry, my questions are quite random. But I am trying to understand the
idea.
Regards,
&rzej;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk