[Info-vax] Memory Safe Programming Languages
Arne Vajhøj
arne at vajhoej.dk
Thu Mar 7 16:37:18 EST 2024
On 3/7/2024 3:50 PM, bill wrote:
> On 3/7/2024 1:41 PM, Simon Clubley wrote:
>> On 2024-03-06, bill <bill.gunshannon at gmail.com> wrote:
>>> And 40 years ago we had safe C. We all know how well that
>>> survived. If people weren't willing to choose memory safety
>>> back then, why would they be expected to now?
>>
>> There's no such thing as a "safe" language.
>> The recommendation is to switch to using these "safer" languages, not
>> some mythical "safe" language.
>
> But my argument is that C had the chance to be one of those
> "safer" languages. Users rejected it. Have to wonder why.
Being memory safe does not work for some C usage (direct HW access).
And we don't know much about the implementation quality of that
80's C compiler you keep referring to. Even a good idea can be
fucked up by a bad implementation.
Or maybe the time was not ready for it then but is now. The
p-code idea was a not a big success back then, but today
the same concept is more widely used than compiling to
native code.
> And, on another note regarding C and Ada. The original GNAT
> compiler converted Ada into C and compiled it with GCC.
Like GnuCOBOL today?
I thought Gnat always worked like other GCC compilers.
> Now,
> it seems to me that points at two possible concepts. One is
> that if Ada can be done in C then it has all the same flaws
> and warts. Not sure I would like to go in that direction.
> The other is much more interesting. And that is the concept
> that C can, obviously, be just as safe as Ada. The question
> then becomes why isn't it? See my first paragraph. :-)
I don't think that logic is true.
The language level of safety very much depend on the
definition of the language.
If language X is transpiled into language Y (instead
of compiled to native object code), then it is very
much possible for X compiler to prevent something that
Y compiler allows. X can be memory safe even though Y is
not.
Arne
More information about the Info-vax
mailing list