Re: Teaching new tricks to an old dog (C++ -->Ada)

From: Martin Krischik (martin_at_krischik.com)
Date: 03/12/05


Date: Sat, 12 Mar 2005 11:43:55 +0100

Jerry Coffin wrote:

> Pascal Obry wrote:
>> "Jerry Coffin" <jcoffin@taeus.com> writes:
>>
>> > Your claim of fewer bugs is just the sort of unsupported anti-C
>> > comment we see all the time.
>>
>> Just plain wrong, there is data (a PHD) see
>> http://www.adaic.com/whyada/ada-vs-c/cada_art.html
>
> Perhaps you should reread this, paying paritcular attention to the
> dates involved. According to the paper, they started switching from C
> to Ada around 1986. C wasn't standardized until 1989, and (as you'd
> expect) it was some time after that before most compilers implemented
> the standard language.

Did they? Or did they just implemented some 80% of the new features? My
experience with C/C++ (and I have 10 years + of that) is that at no time
there was a fully compiant C compiler available. There where allways a lot
of compiler avaliable who claimed to be <small>almost</small> complinant -
but never one which realy was.

Partily because - unlike Ada (http://en.wikipedia.org/wiki/ISO_18009) -
there is not official testsuite to test a C/C++ compiler and runtime
library. Such an official testsuite would do C/C++ all sorts of good.

> By 1990 or so when compilers conforming reasonably closely with the C
> standard became available, it appears likely that essentially all new
> development was being done in Ada. Under the circumstances, it would be
> rather surprising if the C code was ever rewritten into standard C.

On the last project I was working with a 3rd party library which had not a
single "const" in its header files - probably to be compatible with old
compilers. So a major "savety" feature of C89 was still missing in current
code - and affected our current development - since I has to use that
library.

> In short, this is not a comparison to the C language as it exists
> today, or has existed in well over a decade.

What do you mean by "exists today"? C99 is 5 years old and still no compiler
is available which support all C99 features. "restrict" - missing in MS-C
(even thrue restrict can be implemented as "no operation") - VA - arrays
(savety critical feature) - missing in MS-C, buggy in GCC.

The most compatible C/C++ compiler AFAIK is digital mars
(http://www.digitalmars.com) with "only" 4 C99 features missing:
(http://www.digitalmars.com/ctg/ctgLanguageImplementation.html#c_unimplemented).

But even digital mars aims only at the C++98 and not the current C++ 2003.
And there are still 4 features missing:
(http://www.digitalmars.com/ctg/ctgLanguageImplementation.html#cpp_unimplemented).

> If anything, based on my own experience with standard C vs.
> pre-standard C, I'd say his study shows rather the opposite of what you
> think it does. Standard C was enough of an improvement over
> pre-standard C that it would be rather surprising if standard C didn't
> beat Ada in most areas studied (the primary exception being code
> reuse).

Maybe just maybe - if there realy was any standart compiler available - but
there isn't - the C/C++ compiler vendors are allways one release behind the
actual ISO standart.

> By contrast, comparing modern C++ to the pre-standard C shows _large_
> improvements in nearly all areas. This is due in part to the changes in
> the language itself, but perhaps even more so to improved understanding
> of how to use the language.

True - the former slim languages designed by individuals have become fad
languages desined by the ISO commitie ;-).

It is true that a programming language need some minimum features set to be
usefull. And that feature set is a lot larger then most belive. If a
successfull language does not provide that set it will be bolted on later.
If anything the current C/C++ ISO standards clearly show that the advocates
for slim languages hat been wrong all along.

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com


Relevant Pages

  • Re: Is C99 the final C? (some suggestions)
    ... > that someone will try compile their stuff on an old compiler. ... > because the ANSI standard obsoleted them, and everyone picked up the ANSI ... fixed by using another language. ... >>are multiplying two expressions of the widest type supported by your ...
    (comp.lang.c)
  • Re: Forth Frustrations
    ... How would they even know what they are without being language lawyers? ... standard systems and a large number of nonstandard ones. ... interpreter, ... They set up four states -- HOST INTERPRETER COMPILER ...
    (comp.lang.forth)
  • Re: C++ danger to break due to its weight, fragmentation danger - C++0x
    ... Also not all of the new features will be ... libraries for the standard on the way which are optional. ... extensions to the C++ compiler. ...
    (comp.lang.cpp)
  • Re: Forth Frustrations
    ... How would they even know what they are without being language lawyers? ... Then if you choose a standard system you can write code for it, ... interpreter, ... They set up four states -- HOST INTERPRETER COMPILER ...
    (comp.lang.forth)
  • Re: [9fans] caveat... optimizer? the `zero and forget thread on HN
    ... The language standard can only mandate what you can do within ... compiler dependent way. ... you can change from signed-preserving to unsigned preserving. ...
    (comp.os.plan9)