future_cxx icon indicating copy to clipboard operation
future_cxx copied to clipboard

p1629 - Standard Text Encoding for C++29

Open ThePhD opened this issue 5 years ago • 9 comments

Submitted for SG16, Köln, Germany 2019 for inclusion in C++23.

ThePhD avatar Jun 20 '19 22:06 ThePhD

SG16 met and talked about the paper. They are okay with the design, but there is a crucial "middle" road for performance that also needs to be considered by this paper:

  • Low-level, object-based: encoding objects (okay, maybe try to make it a bit simpler if possible)
  • Mid-level, iterators: transcoding iterators / std::text / std::text_view (specifically transcoding, and how to make those faster and not round-trip through UTF32)
  • High-level, fast: fast eager functions for encode/decode/transcode (also just fine the way they are)

Low-level and high-level are covered. The paper needs to explicitly talk more about the high-level functionality in detail with extension points.

The mid-level also needs to be explicitly addressed, to allow someone to make fast transcoding iterators and have that plug into the general framework without an insane amount of work. This might work by letting someone write (partial) specializations of std::text::transcoding_iterator<FromEncoding, ToEncoding, ErrorHandler>.

Flesh this out for the Cologne meeting...

ThePhD avatar Jun 26 '19 21:06 ThePhD

Köln Feedback:

  • Have Tony Tables
  • std::text::encoding concept
  • std::text::encoding_trait type to expose
  • specify minimum range requirements
  • think about transcode_view
  • need to specify all of encode, decode, and transcode
  • add simplification for error handling (too generic, too overgeneralized?)

ThePhD avatar Jul 17 '19 15:07 ThePhD

Presentation done at Köln 2019 meeting: https://thephd.github.io/presentations/unicode/sg16/K%C3%B6ln/ThePhD%20-%20K%C3%B6ln%202019%20Standards%20C++%20Meeting%20-%20Catch%20Up.pdf

ThePhD avatar Jul 25 '19 21:07 ThePhD

What's the status of this paper? I find it very valuable and the issue over at https://github.com/cplusplus/papers/issues/420 mentions that it needs a revision...? :)

meastp avatar Feb 02 '21 12:02 meastp

A library is going to be released soon:

https://twitter.com/__phantomderp/status/1355565481416159234/photo/1 Documentation screenshot.

I doubt it'll make it into C++23. But we don't really need the Standard to make the library work; it would just be nice if we could stop doing ad-hoc transformations in the Standard itself for dealing with this and just specified it in terms of this, but alas.

ThePhD avatar Feb 02 '21 15:02 ThePhD

Great - I'll have a look when you publish it, especially if it's available through vcpkg ;) I hope this doesn't mean that your standardisation effort of p1629 is abandoned?

meastp avatar Feb 04 '21 05:02 meastp

It just means it'll take more time. I don't think the Standards Committee will be ready to review a paper that large by C++23, honestly.

ThePhD avatar Feb 04 '21 17:02 ThePhD

Kindly ask what's the current status. Deferred to C++26?

npuichigo avatar Jul 12 '22 03:07 npuichigo

@npuichigo Deferred to C++26 or C++29. I have to rewrite P1629 still, but the library implementation (for both the C and C++-style versions of this) are alive and well:

https://github.com/soasis/text https://github.com/soasis/cuneicode

ThePhD avatar Jul 13 '22 05:07 ThePhD