Comment by FartyMcFarter

3 days ago

Why do you think the NSA could have put the industry on memory-safe languages?

Even if they wanted to, I highly doubt they could push the industry to do that. The industry does what it wants to do, and rewriting tons of software was far from its priorities. There were no LLMs back then to help with such a massive migration.

There's also the fact that rewriting software tends to introduce a lot of new bugs.

The U.S. government could have required all new software for any government-procured system to be written memory-safe languages, thus making it ubiquitous. This could have been phased in slowly with a few years of on-ramp time to allow for industry to acquire the relevant skills.

  • The DoD tried that with Ada and largely failed. That was with defense contractors whose primary customer mandated it. That was despite Ada being proven to work in its first projects.

  • The U.S. government had pushed Ada for years and it never worked out. The government was forced to accept C++ because industry was rebelling against ADA, even though ADA was memory safe. Well, Ada did have the ability to be memory unsafe. It was much better by default.

  • But even in memory-safe languages, compiler bugs are still an issue. The theory is perfect but the implementation is flawed. In such case once the compiler bugs are found, the software would have to be rewritten to compile. For example an 11 year old memory bug was discovered recently in the rust compiler: https://www.penligent.ai/hackinglabs/rust-borrow-checker-bug....

    Memory safe languages are not a silver bullet either.

    • Definitely not a silver bullet (consider also that memory management isn'the only source for vulns), but still much better than C/C++.

    • I think we'll have flying cars before we have to start focusing on compiler bugs. Most software is already written in memory safe languages and their vulnerabilities are unrelated to memory safety, they're just plain old logic bugs.

      2 replies →

  • The DoD have even created their own language: ADA. Massive contracts power, but different markets to incentivize.

    The distance between the usual consumer/b2b tech startup and the kind of company that sells software to the air force is even bigger than the distance between Google and the kind of company who hires Accenture.

Why do you think the NSA could have put the industry on memory-safe languages?

Did you even read my comment? I very explicitly answered this.

Government purchasing requirements have an immense effect on industry. IME/PSP/TrustZone have 99% CPU coverage because NSA put "owner-inaccessible oversight processor with disjoint physical address space" into federal sourcing requirements.

They could easily have done the same with "memory-safe language". Note this is not the same as "must use Ada" which is obviously dumb. The IME/PSP/TrustZone req worked so well because they specified the feature not the implementation (and indeed it has been implemented three different ways).

But instead, NSA actively pushed in the opposite direction and funded all sorts of kludges to try to keep memory-unsafe languages kicking as long as possible.

They have actively sabotaged the national security of their own country.