If we have AGI, it can just solve all the memory issues in the existing codebase instead of rewriting it all.

But then we'd still be left with a C or C++ codebase.