Recent US Goverment recommendations on programming:
https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-ONCD-Technical-Report.pdf
And 40 years ago we had safe C. We all know how well that
survived.
Are they going to try and force the Air Force to use Ada again?
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?
And that is the concept that C can, obviously, be just as safe as Ada.
On 3/7/2024 1:41 PM, Simon Clubley wrote:
On 2024-03-06, bill <bill.gunshannon@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.
And, on another note regarding C and Ada. The original GNAT
compiler converted Ada into C and compiled it with GCC.
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. :-)
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.
On Thu, 7 Mar 2024 16:37:18 -0500, Arne Vajhøj wrote:
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.
The same applies very much to machine code, of course. That’s why we don’t
need a separate term “transpile” to distinguish the process from what “compile” does.
Hmmm... I don't see Jovial on that list. Are they going to
try and force the Air Force to use Ada again?
The convention (today) is:
compile = transform to lower level language
transpile = transform to same level language
On Thu, 7 Mar 2024 15:50:29 -0500, bill wrote:
And that is the concept that C can, obviously, be just as safe asNot without help, though: namely, the constraints imposed by an Ada
Ada.
compiler.
But my argument is that C had the chance to be one of those
"safer" languages. Users rejected it. Have to wonder why.
And, on another note regarding C and Ada. The original GNAT
compiler converted Ada into C and compiled it with GCC. 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. :-)
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.
On 3/8/2024 8:14 AM, Simon Clubley wrote:
On 2024-03-07, bill <bill.gunshannon@gmail.com> wrote:
And, on another note regarding C and Ada. The original GNAT
compiler converted Ada into C and compiled it with GCC. 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. :-)
Well, that's a load of nonsense and shows a total lack of understanding
of how compilers work. All compiled languages are ultimately compiled
into assembly language opcodes. That doesn't mean they are only as safe
as the assembly language they are compiled into.
Well, I did discount explanation 1. :-)
But, explanation 2 still stands. If the "safe" code written in
Ada can be converted to C then, obviously, the same "safe" code
could be written directly using C. The question really is why do programmers choose not to.
OTOH, it could sound like the reasoning of someone trying to desperately
claim that C is somehow as safe as Ada. :-)
It is. It is not any shortcoming in the language that makes C
"unsafe". It is the practices of the programmers.
[snip]
But, explanation 2 still stands. If the "safe" code written in
Ada can be converted to C then, obviously, the same "safe" code
could be written directly using C. The question really is why do
programmers choose not to.
OTOH, it could sound like the reasoning of someone trying to desperately
claim that C is somehow as safe as Ada. :-)
It is. It is not any shortcoming in the language that makes C
"unsafe". It is the practices of the programmers.
Also, how long did this GNAT compiler that translated into C
actually exist for ? Was it something that once existed for a couple
of years about 30-35 years ago and was never used again.
Really don't remember. That was more than a lifetime ago in
computer years. :-)
I first started really using Ada compilers around the gcc 2.8 timeframe
(IIRC) and have never encountered this Ada to C translator you speak of.
A lot of the early Gnu compilers started as translations to C
and compilation with GCC. P2C, F2C As has been stated many times,
C is really just a slightly higher level than assembler.
You know, one can easily write buffer overflows, out of bounds arrays,
type mismatches, etc. with assembler but no one blames the assembler
for it.
We don't have memory-safe instruction sets.
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 Dallman <jgd@cix.co.uk> wrote:
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.
iAPX 432.
In article <usf5lb$5ad$1@panix2.panix.com>, kludge@panix.com (Scott
Dorsey) wrote:
John Dallman <jgd@cix.co.uk> wrote:
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.
iAPX 432.
What the hell. I've collected various PDFs and will read up on it.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 437 |
Nodes: | 16 (2 / 14) |
Uptime: | 199:45:43 |
Calls: | 9,138 |
Calls today: | 5 |
Files: | 13,432 |
Messages: | 6,036,000 |