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.md4
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.
11
u/joaquintides Boost author May 13 '20
With all due respect I think opportunity analysis predates that question.
Setting epochs up, for what it’s worth, wouldn’t imply any involvement from library authors nor need any significant amount of per-library work; I tend to see that as a positive aspect.
5
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
Both myself and Edward Diener proposed, some years ago now, mechanisms for achieving your request. There was a collective yawn from a majority of the Boost maintainers. Some went ahead and locally reimplemented such techniques for their libraries (I did for mine, Edward did for his, Chris K did for ASIO, I think John Maddock did for his, I vaguely am thinking Regex or something like it did too), so for our libraries you already have what you ask.
Whilst those libraries are some of the more popular ones in Boost, that leaves an enormous remainder. For it to become worth there being an officially documented switch, or a knob, or "epochs", you need (a) more libraries with these facilities and (b) that the libraries with these facilities use some sort of common approach, because right now we're all doing our own, completely incompatible, things.
I thus bring it back to my original point: who is going to do the work? if anything more is to be done than what some of the library maintainers have already done?
Don't get me wrong here. Thanks to Peter D and others, Boost never has had so few internal cyclic dependencies. There has never been so little namespace leakage thanks to recent improvements, so there is a very good chance that epochs can be made ABI separate with very little effort. Boost is, in this sense, better than it has been in decades. There still remains a ton load of work to get it to where you propose, however. You're talking months of full time effort.
4
u/joaquintides Boost author May 13 '20
The proposal focuses on the central scheme and hopes to put some pressure in order to incentivize authors to modernize: it’d succeed in the degree that some activity is effectively triggered (which hasn’t been the case so far as you point out).
As to who’s going to do the (central) work, I don’t have an answer now. Per your assessment of this discussion’s worth, I think our interchange should stop here.
-9
May 13 '20
What right have you, or anyone else, to put 'pressure' on anyone who donates their free time to working on Boost?
8
u/joaquintides Boost author May 13 '20 edited May 13 '20
As much as users who do it here. Disclaimer: I am a Boost author and maintainer of three libraries.
6
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
In fairness, @joaquintides is being very gentle compared to what I've laid on in the past. And he's more than earned the right anyway, he's served Boost something like nearly two decades or so (apologies if my memory is faulty).
1
u/GameGod May 13 '20
You sorta answered your own question - If you're a company with 1000 C++ developers, it wouldn't take much of a productivity improvement in order for it to be worth it for them to pay someone full-time for even a year to implement these changes. So, a big company like Microsoft or Google would be the one to make these changes and push it forward. (I presume some of these Boost authors are on the payroll at various companies already.... and this logic is why.)
4
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
I've fund raised for Boost in the past. I can categorically assure you that no company will sponsor this sort of work since about 2010-2011. They'll contribute a little bit of cash, sponsor students to tinker at the edges, even sponsor a new library, but they will not fund anything which involves even a hint of a wholescale refactor.
Now, as it happens, Boost is a very wealthy organisation. They could just employ a full time developer to do it. Or contract out the work piecemeal. But that's not how things work there, it all boils down to individuals donating their free time, and that ultimately is a core of about four people who do almost all the packaging and release and whole-distro donkey work.
They are deeply underappreciated by the wider C++ ecosystem, incidentally. But they don't serve for recognition.
1
u/GameGod May 13 '20
Why won't they sponsor it? If the value proposition is there, it seems like you have a sales/marketing problem. Am I wrong about the value?
(Thanks for sharing your experience on this btw!)
2
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
The value proposition was there before C++ 11, so funding and workers could be found for infrastructure refactoring. Since, it's not there, companies use the individual libraries they like, and don't care about the whole.
In terms of why Boost doesn't just pay for a worker, it has been decided that would be inappropriate for a volunteer led library. So it is what it is, things progress as fast as a tiny number of people can find free time.
3
u/jonesmz May 13 '20 edited May 13 '20
At my last job, they paid me for almost a year to convince the ancient and bug ridden stlport standard library implementation to play nicely with visual studio 2015 and a 5 year old (at the time) version of boost.
Then they paid me to implement, separately from boost and stlport, a large handful of the metaprogramming functionality that came with C++11 and C++14. The stuff that didn't have a hard dependency on compiler intrinsics, but could be implemented with just pure C++ code.
That organization would have been happy to collaborate with Boost on infrastructure work to fix their own pain points. They didn't care about Boost's pain points, but the pain-points they had were certainly related to the pain-points Boost has.
However, my management (all highly technical people) identified that the barrier to entry for participating in Boost development was way too high.
The project is seen as disorganized, the libraries are not cohesive enough but are instead just a mishmash, the circular dependency hell is a major problem, and ultimately there was no guarantee we'd actually be able to accomplish anything that would synergize with the work we were doing, or that patches would be accepted at all.
They identified, and I agree, that there's no way to actually get into boost development until you start slinging patches at the mailing list, or github page, or whatever you're using these days. It was a confusing mess and it was decided that we would be able to get things done faster, and less expensively, by just doing it all ourselves on our own side of the fence.
You want companies to contribute, you've gotta demonstrate how that's valuable to them.
Start with getting some real consensus on what you want boost to be. Do you want it to be compatible with every compiler under the sun? Cause that's the main problems I had when patching it to make it work with the ancient stlport + visual studio 2015. Maybe drop compiler support for things earlier than C++11.
Get rid of the compatibility macro hell. It's embarrassing that there's a boost macro for every possible keyword or attribute.
Get your regression testing game figured out. There's a problem in the latest, or second latest, boost::process release that prevents some parts from even compiling in the first place. People have to patch it themselves.
Do outreach to larger companies to identify what opportunities there are for things like corporate sponsorship, or inserting existing employees into positions where they can be effective.
The codebase at my last job was 100% dependent on boost. There was something from boost in literally every header and cpp file larger than a hundred lines of code. Most boost modules were used by something. They would have jumped at the chance to have me, or one of my co-workers, actively involved in boost development.
But it's just a mess. Or at least it's perceived that way.
Fix the mess, or at least the perception of the mess. Then do outreach, and you'll find sponsors.
You can contact me privately if you want an email address that can be used for outreach at my previous job.
1
u/kalmoc May 14 '20
So to get people to fix the mess they need to fix the mess?
1
u/jonesmz May 14 '20
Yes.
Read 14ned's response to me.
He's worked with boost a lot, and had a lot of his contributions rejected.
If someone with a positive track record can't meaningfully contribute fixes, why would a corporation bother?
The point is that there is the mess that is the barrier to entry for companies, and then there's a different, distinct mess, that's the code itself.
Companies that hire software engineers aren't bothered by code mess. That's their bread and butter regardless of who's code it is. The thing that they are bothered by is political bullshit and a reputation of being difficult to work with. Why even consider having one of your very expensive staff put billable time into working with an open source organization to get a patch upstreamed if that organization has a well deserved reputation of being a pain in the ass to work with?
The patch was already written, and it fixes the problem the company needed fixing. So now the choice is either have the engineer write more code, or have the engineer play politics with upstream. Write more code wins 95% of the time.
If boost wants corporate contributors, they must re-organize the way they operate the project to make it attractive to corporations to contribute.
If they don't want to make themselves attractive as a target for corporate contributions, then they've made their decision.
→ More replies (0)1
u/14ned LLFIO & Outcome author | Committee WG14 May 14 '20
Firstly thanks for the long list of feedback. I would say that almost everybody at Boost will agree with you. They would have done so five years ago. Maybe even ten years ago, certainly some were acting back then to forestall later problems.
The problem isn't recognition of the problems. The problem is how best to solve them. Or, rather, how to persuade a majority of Boost maintainers to make a series of targeted and specific changes which solve the problems you identify.
There has been a lot of improvement on everything you mention especially in the past two years. There is still more to do. The biggest current problem is the external perception that nothing has improved, which is not true. It's just not obvious from the outside the improvements which have been made, as until they are complete, it doesn't affect the end user experience.
As I've mentioned elsewhere, Boost is a wealthy organisation. They could afford full time developers. But the culture there is to not pay for development nor maintaining infrastructure, unless done by students. So outreach in that sense isn't particularly beneficial, if a company needs something really badly, they can just go ahead and do it. Most do so, and maintain large patchsets against trunk rather than contributing anything back. I know my last three employers did this. And that's their choice.
For the record, I went ahead as a Boost author submitting my current employer's patchset back to Boost earlier this year. A little under half was accepted. About an eighth was actively rejected with hostility. The remainder was ignored, unsurprising as about half the libraries have no maintainer. The major feature contributed to build was rejected with no replacement chosen. So oh well, I tried.
1
u/jonesmz May 14 '20
For the record, I went ahead as a Boost author submitting my current employer's patchset back to Boost earlier this year. A little under half was accepted. About an eighth was actively rejected with hostility. The remainder was ignored, unsurprising as about half the libraries have no maintainer. The major feature contributed to build was rejected with no replacement chosen. So oh well, I tried.
Ah, so you're already well aware of all the things I was trying to communicate.
I'm sorry that you had to go through that.
Ultimately it's the reason why my boss told me not to spend company time trying to engage with boost, because he knew that any attempts would be shot down, and therefore it's not worth the cost (man-hours aren't free, after all).
The remainder was ignored, unsurprising as about half the libraries have no maintainer.
For me, this is the fucked up thing.
My boss at the last gig would have been happy to have myself, or one of our team, take over maintainership of an abandoned boost library that we used. I'm sure there are several that were used extensively. It's not like we weren't literally doing it already, just on our own repository.
But the cost of participation, with patches rejected with hostility, and the ultra-compatibility requirements, just killed any possibility that that could happen.
→ More replies (0)1
u/pdimov2 May 13 '20
Most people who propose the obvious idea of making boost::foo a using declaration for std::foo if present, not otherwise, are and remain oblivious to the ODR-related problems with the idea. To your credit, you do acknowledge it, and did I think suggest a solution to it - use a different namespace (f.ex. boost03 vs boost11).
This doesn't solve all the issues, because when user code has
struct X { boost::foo f_; };X is still not being mangled any differently; but it's better than doing nothing and pretending the problem doesn't exist.
1
u/14ned LLFIO & Outcome author | Committee WG14 May 14 '20
You may remember my C++ Now presentation on this some years ago. One technical solution is inline namespaces. But it was easy for people to accidentally mash up incompatible variants of libraries which have been configured differently. So my proposal for that was combining inline namespaces with a user facing macro
BOOST_XXX_NAMESPACE, which is intentionally easy to bulk find and replace in files.People didn't like that proposal. But you may notice that Outcome and all my libraries use that approach. Users handle it absolutely fine. And multiple ABI incompatible editions of my libraries can coexist in the same TU, I have a unit test which checks it. And users know what they are using, as they are explicitly named.
1
u/pdimov2 May 14 '20
Inline namespaces, yes, but this still doesn't solve the X problem above. Sure, boost::foo is actually boost::v14::foo in one place and boost::v17::foo in another, but X is still X in both places.
1
u/14ned LLFIO & Outcome author | Committee WG14 May 14 '20
No, I'm saying that for every:
struct X { boost::foo f_; };... users instead do:
struct X { namespace boost = BOOST_NAMESPACE(CXX11); boost::foo f_; };i.e. they pin themselves to a specific configuration of Boost. Here it is
CXX11. It could also be, for example,BOOST_NAMESPACE(CXX20, CXXMODULES), or any combination of ABI-incompatible modifiers.The namespace
boostitself would get deprecated for three releases, and then removed entirely.This is what I originally proposed. People didn't like it, as it would force all users to upgrade their code (as you know, I find that unimportant if users can easily find and replace in multiple files). There were also concerns about people combining different configurations of Boost into the same binary, to which my attitude is "they're already doing this, but with undetected ODR violation". And finally, and this is where the work is involved, libraries would need upgrading so that when a user asks for a Boost based on the C++ 20 standard library, they get one of those. Me personally, I'd leave the library maintainers opt into that on their own. Boost just needs to provide a common framework for selecting the config edition.
Even if only bits of the above get done, this upgrade is worth it. We, at work, have a custom fork of Boost with every boost namespace and macro renamed, so our Boost can coexist with customer Boost's. This is not an uncommon situation in the places I have worked. Official support for just that alone would be a large improvement over now. However, be aware that those libraries which refused my patches earlier this year with hostility don't want to upgrade to this. So, they'd need to be left out of C++ 11, 14, 17 or 20 based Boosts as they wish to stay 98-only, or monolithic Boost only.
1
u/pdimov2 May 14 '20 edited May 14 '20
This was implied. In my snippet,
boostis either a namespace alias, orboost::fooresolves toboost::some-inline-namespace::foo.The problem remains. One X and other X are not the same, but they have the same name.
EDIT Ah wait, you effectively suggest people use
struct X { boost::v14::foo f_; };instead. The implication is also that boost::v14 and boost::v17 can coexist in the same program.
I suppose this could work, in principle, but it doesn't help legacy code, which still says
boost::foo. Pin them to 03?1
u/14ned LLFIO & Outcome author | Committee WG14 May 14 '20
The implication is also that boost::v14 and boost::v17 can coexist in the same program.
Yes. Though, only for those libraries whose maintainers have upgraded their library to support editions bound to a specific version of the standard library.
I'll immediately volunteer Boost.Outcome to have a C++20 edition. Standalone Outcome already does this.
I suppose this could work, in principle, but it doesn't help legacy code, which still says boost::foo. Pin them to 03?
Personally I'd prefer to eventually make them formally declare which boost edition they want to use. But certainly for the first year or two of transition,
namespace boost = boost::v03;in your parlance.BTW I'd still strongly recommend the macro-for-namespace approach. Inline namespaces once designed, you're locked in forever, and I've found in the past it is very easy to accidentally cut yourself off from stuff. Using a macro to synthesise the inline namespace design frees you from that problem, you can change the namespace naming and/or conventions, and all source code still works just fine. Or, put another, don't break people's source code more than once!
This isn't just my experience. If I remember rightly, libstdc++ does the exact same thing, for the exact same reasons: macros give an extra layer of indirection.
1
u/pdimov2 May 14 '20
I'm not sure macros are necessary here. You could just do
namespace boost { namespace v14_f7a4b1 {} namespace v14 = v14_f7a4b1; }4
u/pdimov2 May 13 '20
The first step is always to persuade people that what is being proposed is the right thing to do.
0
u/14ned LLFIO & Outcome author | Committee WG14 May 14 '20
Not always. Most of my successes at changing behavior at Boost came from persuading key individuals such as yourself Peter. I actually count changing your opinion Peter as one of my greatest successes. Most of the improvements in the past five years can be traced to you personally doing things differently. And I'm very appreciative to you for that Peter. You're a great engineer. You listen.
To my knowledge, I have only once changed behavior at Boost by persuading a majority. I was very surprised at the time, it was totally unexpected. It was changing the rules for new libraries so that list of ignored libraries didn't keep growing forever, which had very bad optics to the outside. That's my only success, ever, on persuading more than one person at Boost.
1
u/Pand9 May 13 '20
It's absolutely outrageous that Boost has no constant sponsoring for such initiatives. Why is there noone willing to give money? THere is so many tech companies using it and they have more than enough budgets.
3
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
That's not how open source in C and C++ works. Generally what important open source projects get is a bit of dev time on only business-critical issues, such as diagnosing and preparing bug fix patches. If you want more than that, you need bodies to physically turn up onsite at multiple places and pitch management, not engineering, for funding. This generally needs to happen annually.
Newer open source such as Python, Wikipedia, OpenStack etc have such human bodies to go regularly do that. C and C++ predates that mechanism of funding, so there isn't really the culture for that historically speaking around these parts. Even if someone brought in the money - and Boost pulls in several hundred thousand per year - the Boost Steering Committee will only spend funds on CI hardware, student training support, conferences, and other general support functions. They haven't, historically, been willing to pay for development itself unless students are doing it as part of their training, even on problems widely recognised as unsolvable without dedicated staff. As I mentioned, there isn't the culture for that, historically speaking, around these parts.
1
u/Pand9 May 13 '20
Thanks for all the great information. So there is potential for improvement, then, yes? Who can influence C++ culture more than Boost itself?
2
u/14ned LLFIO & Outcome author | Committee WG14 May 13 '20
There is a very strong argument that if things were going to change, they would have changed by now. The major C++ conferences, WG21 and Boost all share a lot of management and lead engineers with the big multinationals. There isn't a lack of capacity for change, rather there is a lack of willingness driven by a perception that the current situation is mostly just fine.
Perceptions will eventually change as the current leadership retire and new folk with more exposure to other technology ecosystems come in from below. And I'd personally say things are far better today than say six or seven years ago, when the vitality of some parts of the C++ ecosystem were very worrying. But in the end, this is a very conservative ecosystem, change happens slowly, and there are lots of good reasons for that. You need to think in terms of multiple years for anything.
1
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?
2
u/joaquintides Boost author May 13 '20
Then set
BOOST_MIN_EPOCHto 03.0
May 13 '20
[deleted]
1
u/joaquintides Boost author May 13 '20
What should happen for you to consider using Boost.Optional rather than some alternative?
1
u/Xaxxon May 13 '20
I think I misunderstood.
There's no BOOST_MAX_EPOCH that removes things based on them being too new, right? So the only thing that BOOST_MIN_EPOCH does is remove "old" stuff? I won't get a worse version of some library because I have my MIN_EPOCH set to an old version of c++ even though I'm on a much newer version?
3
u/joaquintides Boost author May 13 '20
There is no
BOOST_MAX_EPOCH.BOOST_MIN_EPOCH= 03 is your current Boost. BumpingBOOST_MIN_EPOCHremoves libs subsumed by the standard, allows the rest to embrace the standard rather than subsumed libs, and removes those that don’t do that.
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.
3
u/joaquintides Boost author May 13 '20
In the context of epoched Boost, your options are:
Do nothing and happily stay in Boost03 (no shame in this)
Submit a giant PR to Chris
Wait till C++23 when ASIO might be subsumed
0
u/StemEquality May 13 '20
Incentivize Boost authors to embrace newer versions of the C++ standard and get rid of internal dependencies
So one of the stated goals is to have the older epochs be viewed as a badge of shame to pressure, sorry incentivise, developers.
5
u/joaquintides Boost author May 13 '20
In a sense, yes. At the end of the day epochs are labels that advertise how modern (meaning how much of the newest standards they embrace) libraries are. Take into account Boost authors can basically evolve (or not evolve) their libs any way they please. This makes social pressure more apparent.
As for shaming authors: I wouldn’t put it so harshly. For one, I am an author of three libs and probably wouldn’t be rushing to earn Boost11 badges.
1
u/jonesmz May 14 '20
Eventually the programming community needs to move on.
There are still "Enterprise grade" products out there written in C89, and they actively refuse to accept PRs that switch to C99.
Reference; Corosync cluster engine, widely recognized as a leading player in high availability computing applications.
I personally combed through the corosync code and found (and reported) numerous bugs that were directly tied to really stupid mistakes that C89 does not warn about, but C99 does. E.g. the use of "int" as a return value, where some places a 0 means success, and others the "true" keyword, all for the same callback. Just flagrant type system violation bullshit. Crickets for a year, followed by PR closed with no explanation.
Another project, Ninja (the popular build tool for C++) is C++98/03. They refuse to consider upgrading, and cite some unnamed older systems that they want to support.
Projects like these need to be left behind by the computing world. Corosync is over 30 years behind on language standards, and Ninja is passing the 20 year mark soon.
2
u/staletic May 14 '20
I've seen people at /r/C_programming argue that staying on C89 is fine because:
You don't break backwards compatibility.
You don't break backwards compatibility EVER!
You should focus on solving actual problems instead of keeping yourself busy with new language features.
While I believe backwards compatibility is very important, I also love C++20.
1
u/jonesmz May 14 '20
Point one and two are blatantly stupid and there's no excuse for that.
You should focus on solving actual problems instead of keeping yourself busy with new language features.
Right, except when the new language features proactively prevent all those "actual problems" being solved by introducing major bugs.
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.
1
u/dodheim May 17 '20
There's https://www.boost.org/doc/libs/release/libs/libraries.htm if you haven't come across that particular page.
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 ?
2
u/joaquintides Boost author May 13 '20
The result is very complex to handle as Boost libs are heavily interdependent. This proposal aims at reducing internal entanglement.
0
May 13 '20
[deleted]
3
u/joaquintides Boost author May 13 '20
This is doable but client code should be careful to use only the common functionality between the Boost component and its
stdcounterpart (which usually is not 100% of the total).10
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:Application code will suddenly break, because e.g. it references
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 libraries often still contain extra facilities than the standard library versions that supplant them. A couple of examples:
A project I worked on started using
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.As mentioned on the thread you linked to,
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.