3 ms·
> I find it surprising that anyone could imagine that the creator of C++ is unaware of its issues. While C++ adds a lot of new features, it does very little to
by mtzet 5y ago
> I find it surprising that anyone could imagine that the creator of C++ is unaware of its issues.
While C++ adds a lot of new features, it does very little to solve the problems inherited from C. The lack of static introspection, a real module system and tagged unions are all inherited from C. I do think it's fair to think that if a problem is not addressed in 30 years, it just might not be considered important.
Adding tagged unions is not a sophisticated language feature. Fat pointers (c++20 std::span) also seems like a no-brainer. Maybe I'm biased by hindsight, but these features were implemented by contemporaries like Pascal?
Actually, the paper also contains a great section about fat pointers:
> The obvious solution is to supply an abstraction that holds a pointer plus a size. For example, in 1990, Dennis Ritchie proposed that to the C standard committee: "'fat pointers' whose representation will include the space to store the adjustable bounds at run-time" [Ritchie 1990]. For various reasons, the C committee didn’t approve. At the time, I heard the priceless comment: "Dennis isn’t a C expert; he never comes to the meetings." It is probably good that I don’t remember who said that.
- pjmlp 5y agoWe are on the early days of module system, but it kind of works, at least on VC++. You can get tagged unions via std::variant.