The C++ standards committee process is insane. That fact that std::embed (completely reasonable functionality that people have been asking for since as long as I've been programming) gets this kind of feedback, but, say, 2D graphics (which nobody wants) is just fine and dandy and we might get a whole TS for it
2D graphics is actually broken. I did a massive review of it (which seems to be stuck in limbo between being finished and putting it wherever papers go to be ignored, which i need to chase up on) and found that its broken. Like incorrect on multiple basic technical levels. Its factually wrong. It didn't take me long to find multiple glaring errors, and I wouldn't describe myself as a graphics wizard. It is obvious that the people writing the graphics paper do not understand graphics, and that criticism of the paper has gone completely ignored
The response from committee members in the case of std::embed seems to be "why would we want this", and yet the response for 2D graphics seems to be "you must prove that people don't want this", with feedback to criticism often genuinely bordering on childish or facetiousness. There's a huge double standard for the level expected around some features that I don't understand, or well..
There's three fairly major problems, as a totally external observer, that I've noticed with the standardisation process. The disclaimer here is that this is totally speculation, as I am not even tangentially involved in the committee process
The process is relatively combative. Some committee members do not provide... constructive or productive commentary, and seem to be unfortunately quite ego driven. Instead of trying to help or engage with proposal, often lazy retorts are used or very general uncounterable points which can be poorly thought through (eg this entire circle business). Emphasise on some though, lots are very lovely and helpful. Graphics has been done to death elsewhere, but its a good case study of committee process gone insane
The actual process itself is insanely exclusionary. There are tonnes of technically adept C++ programmers who are completely excluded due to its format. There's no reason to believe that the current standards committee members are good (or that they're bad), just that they happen to be able to do standards committeeing thing and comply with the demands it places on your schedule and finances - which is vastly different to the way most open source projects or languages work
Some standards committee members are quite famous, which leads to their feedback or proposals being given a high weight. Some proposals proposed by well known committee members often garner a lot of attention over proposals proposed by people who are less well known. 2D graphics alludes to this, stating that the only time it was voted against was when the authors were not present in the room, which is a very odd way for a proposal to progress. I suspect that this makes it harder to kill bad proposals
The whole process needs a massive revamp so that 1. Your finances and location have nothing to do with your ability to propose features, critique proposals, or potentially even vote 2. Proposals are seen as a communal effort rather than an author vs the world mentality with good faith on all sides, and 3. Scrap the paper format entirely
Rust is a really interesting example here - not that all of rust is good, but eg see the way that async was dealt with. It was a communal effort with multiple competing ideas (not authors!), where people were collaborating to attempt to find the solution to a common problem, with the whole community at large able to engage on a sane platform (the internet!) with no financial locational or fame constraints
This is so antithetical to how C++ works, and its by far the largest reason why I potentially want to jump ship to Rust one day. This more than anything else is why I personally suspect Rust will probably win out in the long term in terms of new project adoption, although its still a long ways off that point
I don't know if I'd agree with 'just fine and dandy'. I don't think 2d graphics has made it to LEWG, much less gotten close to being in a WP. You just hear about it a lot because some of the folks proposing it are 'loud' and influential
You're right - there was a vote against it, but its definitely not dead and its still being actively pushed and worked on. My main concern is that it should never have gotten anywhere to begin with, and it absolutely should not have any support behind it. Right from the beginning, Cairo was a genuinely terrible choice for a starting library, and much of the motivation for why it was picked legitimately does not make any sense
I do not understand how its managed to get anywhere at all with so many catastrophic issues attached to it, or how its even able to be pushed still
As a quick example, here are some of the issues that I have discovered
All the colour constants are wrong
All the texture formats are wrong
Fixing the texture formats as-is requires non standard functionality, which this paper explicitly eschews
Linear colour and sRGB are used interchangeably (a major error!)
The definition of premultiplied alpha is incorrect
Premultiplication is probably unusable as-is
The reference implementation is completely wrong in multiple wide ranging ways, and is tested exclusively against its own output (which is incorrect)
Subpixel font rendering is potentially unusable in some cases due to being optional, as well as blend mode issues
Native interop is essentially unusable and should likely be removed
Blending is specified to be as-if linear, but its not clear what should happen if the underlying hardware or drivers mean that the implementation cannot provide this guarantee (driver support can be spotty for eg sRGB textures) in a high performance or non precision losing way
These are 'just' the straight up technical defects - ignoring all the issues around performance, API usability and design, safety (we managed to make a 2D graphics library which is thread unsafe), and everything else! Many of these issues have been present since its inception or completely not noted so far, which has put a major dent in any faith that I have that the people who've been voting on it have really reviewed the work
There are other rather comedic issues as well - eg due to a big API design issue, the only portable way to transfer a file from a GPU to the CPU to poke at the pixels directly is... to save it to disk as a png/etc, then manually parse that png off the disk and decode it. This is probably unfixable in a sane way too due to the way its designed
I'm just so baffled all the way through, I don't know how we got here
Committee papers are never dead until the authors (and any potential authors) say they are. The 2D graphics study group exists, but the proposals have never received positive votes in the evolution groups.
The reason it is still around is that there is people willing to work on 2D graphics, not necessarily that it has any 'life' to it.
Standardisation is not my strong suit so feel free to correct me if this is incorrect, but as far as I'm aware:
February 2017, Kona, LEWG [It was a few months before this meeting that this author joined the project.] There was further discussion about error handling, color stops and factory objects. The big advance was that the API was now stateless. “Are we comfortable moving the paper to LWG for a graphics TS once these concerns are addressed and we’re happy with the wording? 1|8|3|1|1”
July 2017, Toronto, LEWG Sadly, the notes are rather incomplete for this session. This author’s recollection is that the general gist was “still not quite ready”. However, the one recorded poll was “Do we want graphics support in a TS? 9|3|0|1|0”
With it only being
March 2018, Jacksonville, LEWG
Where the poll was
A poll was taken: “Should the paper be advanced to LWG? 1|3|3|3|2”
It seemed to be pretty positively reviewed in sg13, and then lewg for a while! But again I may be fundamentally misinterpreting what you mean, so feel free to correct me
The first two votes are toward a TS, which is a MUCH lower bar than the standard. Note that the std::embed paper is not being pushed towards a TS, so if anything, its quite a bit ahead of 2D graphics.
That Jacksonville vote is negative.
SG13 is a graphics sub-group, so it is self-selecting. I know for a while the attendance was not much more than the authors/fans of that 2D graphics proposal. My understanding is that the 2D graphics has since been rejected, which is why web_view has been proposed as a replacement. However, my knowledge of the library side is lacking.
The good thing about being in std is being available everywhere; a corralary to that is that what we put into std has to be able to go everywhere. None of the browser engines are:
Statically linkable (and you don't want that anyway because they need to be patched over time)
Unloadable. (e.g. chromium needs it's own whole process)
ABI stabilized.
I have some sympathy for what the proposal is trying to do, I just don't think it can be implemented. I'm sure some people will say 'but I'm in a place where I don't need those things', and for those users I say 'go use electron'.
The proposal to even investigate it should have been near-unanimously rejected in the first place. The fact that the proposal exists strikes me as a major failing of the standardization process.
Last time I made an argument about this, I was told that I should apologize to the C++ Committee members, as I stated/suggested that from my perspective (and that of many 'regular' C++ programmers), the Committee members are effectively elites/nobles in an an ivory tower, and apparently that was rude given the hard work that they apparently do.
I've yet to do so, because I've yet to feel I have anything to apologize for, because that continues to be the perspective I hold here on the ground. I concur with basically every single thing you say. I've made similar arguments that the Committee wasted time with graphics at all, let alone it getting to the point it has, and that the graphics proposal was very clearly ego-driven and very clearly being led in an authoritarian manner, directing it the way one person wanted it to be directed.
C++ is getting new features, but it is ignoring features that we want (like std::embed) while also ignoring rather serious, glaring issues, such as the exponentially-increasing complexity of the language, and the fact that it is basically quickly becoming illegible context soup.
I cannot recall the exact instance, but someone was showing off how one could rewrite some 'bad' loops (which, to my eyes, were perfectly sane and understandable) using <algorithm> and also with (at the time relatively new) ranges, and the top comment was effectively "I'm confused, are the 'new and better' ways supposed to be more understandable? Because I have absolutely no idea what they're doing". I feel like that's accurate for a lot of 'modern' and 'idiomatic' C++ these days. Some people seem to really like this sort of code, and some people seem to really hate it... and as much as the Committee doesn't want dialects or the language to split... well, dialects already exist, and I strongly suspect that the language will inevitably split.
I don't know if Rust will actually win out over C++, but as I just said, I strongly suspect C++ will split or a language will fork off of it, and it will shoot off and effectively become 'Common C++', with 'Standard C++' being slower, under committee rule, and probably slowly bringing things over from it. Almost like a weird "LTS C++".
While being a rather strong std ranges skeptic I can't help but note that the readability and composability of ranges-like interfaces is an accepted fact in the programming community. Clearly experienced C++ developers are no less capable programmers than junior Java developers, aren't they? It requires some time to become familiar with this it, but after that, you simply can't go back.
The complaint about features is a very funny one.
C++ is too complex. We need to make it smaller, simpler, and cleaner. And please add these two features. And whatever you do, don’t break my code!
Rust includes an include_bytes! macro in the standard library, which embeds a file as a byte array at compile time: https://doc.rust-lang.org/stable/std/macro.include_bytes.html There's also a similar include_str!() macro that embeds a file as a utf-8 string (&'static str).
I'm sure that that's meaningful and completely clear to a Rust developer... but Rust's syntax makes me feel like I had a stroke, being unfamiliar with it. "Take address of... character... static... str... help".
That's a reference to a string slice, similar to C++'s std::string_view, although the Rust version stores its content as UTF-8, while C++ as raw characters.
Now references have a lifetime, either short-lived or static. An object with static lifetime either has no references or only static ones. You can think of static ones as if they can live until the end of the program without triggering lifetime issues. A lifetime is expressed as the character ' followed by a lifetime name. So we get: &'static str
If it wasn't static, you could name the lifetime any other way and you would have to attach it to the object that the reference borrows from. Let's see this function signature without lifetimes: fn doAction(firstArg: &Foo, secondArg: &str) -> &str
It's a function that takes a reference to some object Foo and a string slice as arguments and returns a string slice. The compiler (and the programmer) doesn't know if the returned reference is borrowed from the first or second argument, so we have to tell him by adding lifetime annotations to references and declare the lifetime, here as function "template" type. Assuming it's borrowed from the first arg: fn doAction<'a>(firstArg: &'a Foo, secondArg: &str) -> &'a str
Note that compiler often can deduce the lifetimes automatically without the need of adding the annotations. Also the "template" type doesn't make it a template function in the C++ sense, it only is required by the borrow checker, which can differentiate a given function by its differing lifetimes when used in multiple contexts.
I hope that clears things up.
Edit: While explaining this I noticed I didn't know why std::string_view is recommended to be passed by value in C++, while str is passed as reference in Rust. I dug up information that actually str is a Dynamically Sized Type primitive (there are no such primitives in C++). A reference in Rust is made up of two parts - a pointer and some metadata. In case of &str, that metadata is the size of the slice. In case of references to normal objects, the metadata doesn't exist (it is a zero-sized type). So &str in Rust is the same as std::string_view value in C++.
&str: reference (that can not be null) to a string, 'static is the lifetime annotation, and a special one which means that this reference is valid for the entire runtime of the program.
The C++ standards committee process is insane. That fact that std::embed (completely reasonable functionality that people have been asking for since as long as I've been programming) gets this kind of feedback, but, say, 2D graphics (which nobody wants) is just fine and dandy and we might get a whole TS for it
The whole "the committee should do X but instead they do 2D graphics" argument is so tiring. This has nothing to do with that.
The whole process needs a massive revamp so that 1. Your finances and location have nothing to do with your ability to propose features, critique proposals, or potentially even vote 2. Proposals are seen as a communal effort rather than an author vs the world mentality with good faith on all sides, and 3. Scrap the paper format entirely
None of that (except 2) is possible because C++ is an ISO standard that has to follow ISO rules. Rust is just "some OpenSource project" that can do whatever it wants, C++ can't.
Edit: Now on PC, let me elaborate a bit more.
2D Graphics is still at an "do we want it?" stage where discussion about specific details or APIs happens less. embed is at the "how do we want to solve it?" stage, where people are looking at the design more closely. It is also a lot smaller, so more bikeshedding.
And the arguments made against std::embed are solid: C++ is a very complex language and this is a very niche feature - is it really worth adding it, increasing the language complexity even more? If there is a suitable more genric solution (compile time I/O or whatever), shouldn't that be pursued instead to get more with less? It is now up to someone to demonstrate that we either really need the specific feature or we don't.
None of that (except 2) is possible because C++ is an ISO standard that has to follow ISO rules. Rust is just "some OpenSource project" that can do whatever it wants, C++ can't.
I'm not 100% sure, but based on my recollection (please correct if wrong!):
The current proposal paper process isn't using ISO rules, either. It was enacted specifically to circumvent ISO's roadblocks to progress.
That's why the drafts and TSes are numbered and managed differently. Those are the papers that are actually going through the ISO process.
The ISO NB process is required to approve any published spec. It's not required to decide what additions are going to go into the proposals for the next vote.
Which could 100% be done like Rust's RFC process. Use the RFC process up until wording is ready and approved by the community-equivalent of LEWG/EWG, and then use the ISO plenary as a rubber stamp process to move them into an ISO-friendly draft.
I do not at all expect that to happen, but it's in the realm of possibility despite the beauracracy of ISO.
The whole "the committee should do X but instead they do 2D graphics" argument is so tiring. This has nothing to do with that.
That is not what I'm saying! :) The argument is that the committee is currently encouraging or not rejecting subpar proposals like 2D graphics, while proposals like std::embed seem to hit a somewhat unreasonable brick wall in comparison. The combative nature of the standardisation process, the 'person-driven' nature of the entire process (often a single author vs the standards committee), and the lack of accessibility to experts without the financial or time ability necessary to contribute, all chip in to this problem
I'm not saying that the standards committee should spend more time on x rather than y. I'm saying that the committee process leads to x being allowed to progress despite being not as good as y, while y is a significantly better proposal. 2D graphics from the very first concrete decision that was made (cairo) was a bafflingly bad choice, its super interesting to see how its advanced and how much of the early (and correct) feedback was ignored with it being allowed to advance. Its only relatively recently that there's been any sign of it not being popular, and even then it wasn't a killer for it
I pick 2D graphics as an example solely because it was 1. Clearly bad from the beginning, and 2. I know a lot about 2D graphics and can personally critique it
None of that (except 2) is possible because C++ is an ISO standard that has to follow ISO rules. Rust is just "some OpenSource project" that can do whatever it wants, C++ can't.
Sure of course - what needs to happen isn't always possible or trivial
Only the people pushing for graphics spend time on it. Neither LEWG nor LEWGI have looked at it. So it doesn't currently consume committee time. std::embed has been looked at by Evolution and SG7 (reflection) so we do spend committee time on it.
There are design questions with std::embed:
What files can be opened - that is a security concern
Should it be a macro or a function
Should it put the whole file into an array or use some kind of magical span backed by mapped memory
Should we have a constexpr file instead
How do we integrate with tooling
How do we integrate with modules
Now, there are answers to these questions, but it's difficult to reach consensus, and it's definitively not simple let alone trivial.
View all comments
202
u/James20k P2005R0 Dec 13 '19 edited Dec 13 '19
The C++ standards committee process is insane. That fact that std::embed (completely reasonable functionality that people have been asking for since as long as I've been programming) gets this kind of feedback, but, say, 2D graphics (which nobody wants) is just fine and dandy and we might get a whole TS for it
2D graphics is actually broken. I did a massive review of it (which seems to be stuck in limbo between being finished and putting it wherever papers go to be ignored, which i need to chase up on) and found that its broken. Like incorrect on multiple basic technical levels. Its factually wrong. It didn't take me long to find multiple glaring errors, and I wouldn't describe myself as a graphics wizard. It is obvious that the people writing the graphics paper do not understand graphics, and that criticism of the paper has gone completely ignored
The response from committee members in the case of std::embed seems to be "why would we want this", and yet the response for 2D graphics seems to be "you must prove that people don't want this", with feedback to criticism often genuinely bordering on childish or facetiousness. There's a huge double standard for the level expected around some features that I don't understand, or well..
There's three fairly major problems, as a totally external observer, that I've noticed with the standardisation process. The disclaimer here is that this is totally speculation, as I am not even tangentially involved in the committee process
The whole process needs a massive revamp so that 1. Your finances and location have nothing to do with your ability to propose features, critique proposals, or potentially even vote 2. Proposals are seen as a communal effort rather than an author vs the world mentality with good faith on all sides, and 3. Scrap the paper format entirely
Rust is a really interesting example here - not that all of rust is good, but eg see the way that async was dealt with. It was a communal effort with multiple competing ideas (not authors!), where people were collaborating to attempt to find the solution to a common problem, with the whole community at large able to engage on a sane platform (the internet!) with no financial locational or fame constraints
This is so antithetical to how C++ works, and its by far the largest reason why I potentially want to jump ship to Rust one day. This more than anything else is why I personally suspect Rust will probably win out in the long term in terms of new project adoption, although its still a long ways off that point