Hacker News
points by klempner 4 days ago | 0 comments
I think this is misunderstanding the problem with std::regex -- the problem isn't so much that it provides a "spec for what the batteries should look like" but rather that it is naturally ABI entangled and so the bad first generation implementations are unfixable given that the committee refused to allow for an ABI break to fix this.

The real problem is the latter: C++ has always had a "you don't pay for what you don't use" as part of its core philosophy but it turns out that doesn't apply if the thing you don't use is ABI stability.

(and, failing an ABI break story, std::regex should have had an implementation that was more PIMPL and less template so it would have fewer ABI issues, possibly followed by a regex2 later that could get more of the compile time bits once implementations were more mature.)

[–] forrestthewoods 3 days ago
I think both are problematic.

I think even if C++ had a periodic ABI break that even a better std::regex spec is fundamentally wrong.

As someone who ships cross-platform I never ever want different platforms to have different implementations for things that are not actually platform specific. Having different implementations of std::string depending on if I’m on windows, Linux, Mac, iOS, Android, PlayStation, Xbox, or Nintendo is a profoundly terrible thing to do.

Hacker News