Hacker News new | past | comments | ask | show | jobs | submit login

To be fair, the GNU implementation of std::regex has to conform to the API defined by ISO/IEC 14882 (The C++ Programming Language). If you don't have to provide that API purely in a header file, it gets pretty easy to write something bespoke that is faster, or smaller, or conforms to some special esoteric requirement, or does something completely different that what the C++ standard library specification requires.

The purpose of the C++ standard library is to provide well-tested, well-documented general functionality. If you have specific requirements and have an implementation or API that meets your requirements better than what the C++ standard library supplies, that's great. You're encouraged to use that instead.

If you have an implementation of std::regex that meets all the documented requirements and is provably faster under all or most circumstances than my implementation is, then submit it upstream. It's Free software and it wouldn't be the first time improved implementations of library code have been suggested and accepted by that project. Funny how no one has done that for std::regex in over a decade though, despite the complaints.




I've always heard that it's a backwards compatibility problem with ABI, not API, is that not true?


Mostly yes, and it doesn't help that the template heavy API makes it really hard to improve things internally without breaking the ABI.

See https://stackoverflow.com/questions/70583395/why-is-stdregex...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: