It's because they're trying to make a module system that is compatible with decades of development based around `#include`. It's nowhere near as simple as making a new language with modules.
I almost feel like they should give up. IMO Rust and Zig have made C/C++ a legacy language. Except in some specific areas where Rust doesn't have mature libraries (GUIs & games mostly) you'd be silly to start a new project in C++.
Migrating existing C++ projects to modules likely isn't worth the enormous effort, and the days of starting new C++ projects are numbered... so why bother?
There is still an unfathomably huge landscape of problems where C++ is the more mature, “right” choice over rust for new projects. Just from my (extremely limited and narrow) personal experience:
- scientific/numerical computing (super mature)
- domain-specific high performance computing (C++ is for better or worse extremely flexible)
- weird CUDA use cases (feels very native in C++)
- game dev as you mention
- probably much much more
C++ to me feels more like a meta-language where you go off to build your own kind of high performance DSL. Rust is much more rigid, which is probably a good thing for many “standard” use cases. But I’m sure there will always be a very very long tail of these niche projects where the flexibility comes in handy.
There are tons of places where Rust and Zig don't have a solution, or are not part of an industry standard that builds on top of C and C++, like GPGPU, Khronos standards, console SDKs, ...
Additionally while they keep being built on top of C++ compiler infrastructure, C++ isn't going away.
Sure now that is the case. But which do you think will happen first - C++ will get working modules or people just give up on C++? Definitely not clear cut!
I almost feel like they should give up. IMO Rust and Zig have made C/C++ a legacy language. Except in some specific areas where Rust doesn't have mature libraries (GUIs & games mostly) you'd be silly to start a new project in C++.
Migrating existing C++ projects to modules likely isn't worth the enormous effort, and the days of starting new C++ projects are numbered... so why bother?