And most of those "teralines" of code are legacy garbage. The core OS, a basic userland, a database and a webserver are 90% of the world's critical IT infrastructure. That doesn't take a century to rewrite.
You will lose all of that in a rewrite, which is why people don't do it.
> You will lose all of that in a rewrite
I don't think you lose everything in a rewrite in general - you still have all of the edge cases and business logic in the old code that you translate to the new code. It's not like you are implementing whatever it is from scratch.
Sure, there are opportunities for the translation to introduce regressions, but that's a vastly different argument (and I think a much more minor downside).
At some point you have to come to terms with the fact that some bugs shouldn’t be fixed.
And you don't have to rewrite everything at once, you can do it at the function or file level bit by bit. Perhaps the parts that are changing the most are done first, or perhaps the parts with the most bugs.
I'm still not saying rewriting is always right or wrong, but I think it isn't as cut and dry as some make it sound.
Well I have this native app fetish. I mean why pay for 4 G ram for each electron app?
No, there is more legacy code than you list there.
Please keep those web apps.