[Info-vax] Memory Safe Programming Languages

John Dallman jgd at cix.co.uk
Fri Mar 8 05:07:00 EST 2024


In article <usdaaa$18du3$2 at dont-email.me>, ldo at nz.invalid (Lawrence
D'Oliveiro) wrote:

> On Thu, 7 Mar 2024 15:50:29 -0500, bill wrote:
> > And that is the concept that C can, obviously, be just as safe as 
> > Ada. 
> Not without help, though: namely, the constraints imposed by an Ada 
> compiler.

Indeed. Looking at the levels of the implementation can be helpful:

We don't have memory-safe instruction sets. The idea isn't impossible,
but it would be a lot more complex and/or restrictive than any of the
currently popular instruction sets. 

We can implement memory-safer languages on top of unsafe instruction sets.
But most of the memory safety comes from the restrictions of the language:
if you take the machine code version of a program written in a safer
language, it is not obvious from inspection that it is safer, and proving
that it is safe is impossible (see the halting problem). 

The same applies to compiling a memory-safer language (ADA) into a
memory-unsafe language (C). The resulting C is memory-safer, but this
isn't obvious from the code and isn't provable. 

John 



More information about the Info-vax mailing list