comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: How to make Ada popular. Get rid of ";" at end of statement.
Date: Fri, 26 Jul 2019 22:16:04 +0300
Date: 2019-07-26T22:16:04+03:00	[thread overview]
Message-ID: <gq11rkF9qmnU1@mid.individual.net> (raw)
In-Reply-To: <1dc13d50-7606-4530-b5cc-19e07b4d4938@googlegroups.com>

On 19-07-25 10:26 , Maciej Sobczak wrote:
>> The one concrete reason I've ever heard for using C or C++ instead
>> of Modula-2 or Ada is that C/C++ allow you to perform pointer
>> arithmetic
>
> Really? I would never consider that reason myself. But I have two
> others that I consider important:
>
> 1. C or C++ allow to reuse the existing C or C++ libraries, of which
> there are too many to ignore them. In fact, in some areas like
> embedded systems (which is where Ada tries to compete) those
> libraries are essential to get anything done.

Well, that depends. It may be true for short, small projects, but IME 
for longer projects one can well do without the libraries. Of course it 
also depends on the nature of the project, for example whether some 
network connectivity is needed (which was not the case in most of my 
projects).

> Chips are too complex
> to program them via their register-level interfaces and vendors
> deliver only C libraries for their products. No, the Ada's
> Interfaces.C does not even come close to be reasonably useful. It can
> be used only with those C interfaces that were specifically designed
> to facilitate such use.

That, again, depends. A colleague successfully used the GNAT "dump Ada 
specs" function to create an Ada API for a large customer-supplied C 
library of "driver" functions and linked it to an Ada application with 
very few problems.

When I tried it on another C library, the result was very ugly, partly 
because the library aimed to provide register-level access in addition 
to some higher-level functions, and partly because the names of the C 
entities used various prefixing and suffixing schemes to compensate for 
the lack of a module system in C, and so the corresponding 
package-qualified Ada names were really ugly... Instead, we wrote our 
own HW register definitions and higher-level functions (and as a side 
effect found and reported some errors in the HW documentation) giving a 
pure Ada solution that, in addition, is portable between the big-endian 
SPARC target and little-endian x86 development systems.

For ARM Cortex chips I believe there is a standard HW register 
description language and a tool to generate the corresponding Ada 
declarations.

> This is another source of misconception. Critical systems (not only
> automotive, but also medical, aviation, etc.) do not rely on
> programming languages to achieve reliability. They rely on
> independent verification processes, which also happen to account for
> most (like in >95%) of expenses. And Ada does nothing to make these
> processes any easier, because while belonging to the same family of
> programming technologies (3rd gen, imperative, etc.), its required
> verification technology is essentially the same. So why bother?

Hmm. I recall that the developers of SPARK wrote, somewhere, that they 
tried to develop a similar tool for C, but gave up because the 
properties of C where so much less amenable to formal analysis and proof 
than the properties of Ada. Now it may be that advances in proof 
systems, C "sanitizers" and lint-like tools have reduced this prooblem, 
but it would surprise me if there would be no difference left.

And of course there is the well-know empirical evidence that development 
in Ada, rather than C, leads to fewer errors and errors that are less 
costly to fix.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

  parent reply	other threads:[~2019-07-26 19:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
2019-07-19 22:09 ` Dmitry A. Kazakov
2019-07-20  6:47   ` J-P. Rosen
2019-07-20  8:42     ` Paul Rubin
2019-07-21  5:11       ` J-P. Rosen
2019-07-23  9:24         ` darek
2019-07-20 17:08     ` Stéphane Rivière
2019-07-20 13:46   ` Dennis Lee Bieber
2019-07-20  0:47 ` Matt Borchers
2019-07-20 13:54   ` Dennis Lee Bieber
2019-07-20 14:40 ` Stephen Davies
2019-07-20 15:45   ` Optikos
2019-07-20 17:24     ` joviangm
2019-07-20 19:10       ` Optikos
2019-07-20 19:17         ` AdaMagica
2019-07-20 22:25           ` Paul Rubin
2019-07-20 23:08           ` Optikos
2019-07-20 22:24         ` Paul Rubin
2019-07-20 21:14   ` Keith Thompson
2019-07-23 21:58 ` Ingo M.
2019-07-23 23:56   ` Paul Rubin
2019-07-24 14:06   ` John Perry
2019-07-24 14:51     ` Ingo M.
2019-07-24 15:29       ` Dmitry A. Kazakov
2019-07-25 10:58         ` Ingo M.
2019-07-25 12:16           ` Dmitry A. Kazakov
2019-07-26 10:54           ` antispam
2019-07-26 11:35             ` Niklas Holsti
2019-07-26 16:07               ` Simon Wright
2019-07-24 19:52       ` Ingo M.
2019-07-24 20:31         ` J-P. Rosen
2019-07-25 13:34           ` gautier_niouzes
2019-07-25  7:26     ` Maciej Sobczak
2019-07-25 10:47       ` Ingo M.
2019-07-25 16:18       ` John Perry
2019-07-25 18:31         ` Dennis Lee Bieber
2019-07-26 18:04         ` Shark8
2019-07-26 18:53         ` Niklas Holsti
2019-07-26 19:16       ` Niklas Holsti [this message]
2019-07-27  1:27       ` Lucretia
2019-07-27  1:34         ` Keith Thompson
2019-07-27  3:11           ` Randy Brukardt
2019-07-27  4:06             ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox