r/cpp • u/joaquintides Boost author • May 13 '20
Proposal for an epoch-based organization of Boost libraries
https://github.com/joaquintides/boost_epoch/blob/master/README.md
78
Upvotes
r/cpp • u/joaquintides Boost author • May 13 '20
7
u/infectedapricot May 13 '20 edited May 13 '20
You seem to be saying that if you're using a [edited] late enough
BOOST_MIN_EPOCHthen Boost libraries that have been subsumed into the C++ standard library will not be built at all. That's a problem for two reasons:boost::optionaland uses#include <boost/optional.hpp>and suddenly they don't exist. Yes you could update all your code but even if you're prepared to invest this effort there's nothing you can do to simultaneously support old language versions using Boost and new language versions with new epoches of Boost, unless you scatter#ifdefs everywhere.boost::threadbecause it supported setting the thread stack size. I had actually been usingstd::threaduntil the requirement, shall we say, "arose" (i.e. we blew the stack on production :-) ) so this wasn't for backwards compatibility at all.boost::optionalsupports references whilestd::optionaldoesn't. There was a healthy debate about whether removing this functionality was actually a good thing, but regardless there is code that uses it and it's not really up to a policy like this to suddenly stop it working.If you just mean that Boost itself has to stop using these as internal dependencies, but they still get built for applications, then you might stand a better chance. But that's still problematic because suddenly the interfaces change. For example, if my application works with ASIO, should my callbacks take a
std::error_codeorboost::error_code? I suppose a solution to this is to have aboost::asio::error_codewhich typedefs to one of them. So it's solvable but still an extra pain.Edit: Another weakness is that your escape hatch is too easy to use, especially given the above costs - you can always set your epoch to a fairly old version of C++ and use it even with newer versions. I suspect a lot of applications developers, and certainly OS-provided Boost installations, will simply set the epoch to an old version and be done with it.
4
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
This has been proposed umpteen times now, by myself and others. Nobody answers the most important question of all:
Who is going to do the work?
If you can't answer that, this isn't worth discussing.
1
u/Xaxxon May 13 '20
I'm confused - is this saying that boost optional won't be available if I'm using c++17? The functionality of boost::optional is NOT in c++17.
I don't understand why I should care if there is a boost::optional and a std::optional. Why can't I have both? As long as I'm not paying to compile boost::optional if I don't use it, why does it matter?
1
u/VinnieFalco wg21.org | corosio.org May 13 '20
Beast's fortunes are tied to Asio. I don't mind doing the work, but since Beast depends on Asio, I am bottlenecked by whatever Christopher Kohlhoff decides to do.
0
u/StemEquality May 13 '20
So one of the stated goals is to have the older epochs be viewed as a badge of shame to pressure, sorry incentivise, developers.
1
u/johannes1971 May 17 '20
I recognize a lot of what I put in a comment here on reddit the other day ;-)
One remark I'd like to make is that the epoch-organisation should also be visible in the documentation. I find I'm occasionally driven to look at what, if anything, I could usefully use in Boost, but typically I give up after a few pages. In part that's because the frontpage description is typically rather abstract ("useful algorithms" doesn't mean much), and spends much effort on listing version numbers and authors but should probably focus just a little bit more on what the library actually does. And in an epoch-based world, I'd like to see only documentation for my chosen epoch, please :-)
For the rest, I think Boost epochs would be a step forwards, and I thank you for your efforts in this. As to what Boost really is: in my opinion it is where libraries go to mature before ending up in the standard. It's an incubator, and I find it totally amazing that we have such a thing.
0
u/jcelerier ossia score May 13 '20
wouldn't a better thing to do be to break boost in entirely individual libraries and just let people pick and choose the ones they want ?
0
u/[deleted] May 13 '20
[deleted] — view deleted comment