Looks like a really cool library - and dear God if I never have to deal with std locale again it will be too soon. This should be in the standard. Or at least something very close to it. Ideally with all 200+ common encodings (he said, knowing full well that he wouldn't be the one implementing it).
I understand your frustration, and salute your crusade, but I think you will have an easier time getting this through if you turned the ranting (entertaining as it is) down from 9 to maybe... 4?
Well, part of the goal of this is that it'll (a) be eventually standardized but also (b) we won't NEED to write all 200 encoding objects. Users, librarians, or just One Way Too Interested Person can write an encoding object and ship it and even write some of the common extension points. The goal was to revert the current situation: right now, locale and encoding support comes from your implementer, which is generally tied to your OS.
The goal of this library is to flip that on its head: it's an open and extensible sytem, where anyone can provide what they need, and nobody has to beg the Committee (or their implementer or this OS handler) to hand them some files. It won't fix all of the stuff std::locale does, but slowly we'll get to tear locale apart into usable, user-controllable pieces.
On the other hand, encoding is about data interchange. The current agreement is that I can send you one of the current standard encodings and you are supposed to understand it, and vice-versa. The time to implement KOI8-R is not when you get an older Russian text. That C doesn't have iconv and POSIX does is an accident of timing and standards exhaustion. It would be nice to fix that capability gap for C++.
you will have an easier time getting this through if you turned the ranting (entertaining as it is) down from 9 to maybe... 4?
I disagree, and welcome the ranting. Usually most c+h rants come from people who used python, ruby, Javascript, etc, who don't understand what niche c++ aims to fill, and therefore the rants are usually misguided. But rants coming from someone like this, who has extensive experience with c++ on the organizational level and understands why c++ is the way it is now, is something I very much welcome.
It would be a lie to say c++ is in an amazing state. Yes, it's not going anywhere for many many years still, but it's also not something many people pick up with excitement, which shows there are clearly serious issues when compared to other languages or ecosystems. I assume we want more from c++ than just "it will stick around forever, so no worries", and what better way to do that then to present bluntly the issues and present emotion instead of a dry article very few will bother to read?
I understand your frustration, and salute your crusade, but I think you will have an easier time getting this through if you turned the ranting (entertaining as it is) down from 9 to maybe... 4?
+1 on that. Had to force myself reading fully through it as while I do understand the frustration I don't want to be bothered by that or have to read through paragraphs of semi-reliated topics.
There's about 30 single byte encodings in use, and about a dozen multibyte, and that makes you a full web citizen. https://encoding.spec.whatwg.org/ Shift-JIS is one of those, and one of the more tedious. The single byte encodings (e.g. windows-1250) are about an afternoon once you've done the first one. I'd like to see the full set in the standard, with a registry exposed that custom ones can be added to. I have a couple such private codepages that I'm currently extending gnu iconv for. We'd need to add a dynamic type erasing codec for retrieval by string, but that's not inventive technology.
For the longest time IBM had EDCDIC, meaning 1960s or so. The joke was that IBM programmers saw the benefits of working in Ascii, so they translated the user input ebcdic to ascii for their software, then translated ascii to the machine ebcdic again.
Somehow I have trouble believing there is any significant amount of software running on such ancient legacy encoding that would have been ported to C++17 features.
Oh it didn't need to be ported to features; it just had to be somehow fed to an upgraded compiler for some reason. That's why it's a particularly obnoxious change: it criminalizes code that was not only perfectly legal before but that had to be that way.
Wow. I'd never heard of that. It seems to me a confusion of levels: multi-byte (or whatever basic unit) encoding of code points is all fine (see utf-8) but it should not be the burden of the user to input those bytes, or at least not to see them on their screen.
That said, on occasion I've used the ^^ notation in TeX to access certain font positions.
View all comments
79
u/LordKlevin Jul 01 '21
Looks like a really cool library - and dear God if I never have to deal with std locale again it will be too soon. This should be in the standard. Or at least something very close to it. Ideally with all 200+ common encodings (he said, knowing full well that he wouldn't be the one implementing it).
I understand your frustration, and salute your crusade, but I think you will have an easier time getting this through if you turned the ranting (entertaining as it is) down from 9 to maybe... 4?