From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Automated conversion to C++?
Date: Sat, 16 Feb 2008 13:43:58 GMT
Date: 2008-02-16T13:43:58+00:00 [thread overview]
Message-ID: <pan.2008.02.16.13.47.35.100187@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: ygemyq24a5n.fsf@hugsarin.dmusyd.edu
On Fri, 15 Feb 2008 14:33:08 +0100, Jacob Sparre Andersen wrote:
> I have been offered to take part in a programming project with a
> rather annoying constraint: There should be C++ source available for
> the constructed program.
>
> The good part is that I am allowed to do the actual programming in
> Ada, and just use an automated translator to generate the C++ code.
If you have to supply a C++ program semanticly equivalent to the binary
you deliver, the best choice is to write it in pure C (or C++).
You are guaranteed equivalence. You need find no translators. You
have no mismatches in runtime. The risk is low.
C++ makes so many Ada capabilities a real nuisance to implement.
Basics like enumerations with constraint checks, fixed point types,
floating point attributes, integer over/underflow exceptions
need loads of messy C++ (often with specialized headers) to implement.
When it comes to rendezvous, elaboration, real-time, ATC and anything
from Annex E,(or D or G), you are really stuck with no obvious mapping.
If you are interfacing to hardware, you hit the limitation that you
can't do representation clauses in C++. The nearest thing is by
unpacking bit fields manually, making assumtions about the layout
in C++ (which are not part of the language spec).
In short, to deliver a C++ program:
Simple program => Write it in C because translation takes too much time
Complex program => Write it in C because the translation is impossible
If a customer is paying to get C++ source, don't write it in Ada - they
presumably don't care for a robust, low-defect solution. If they did,
they would put constraints on the C++ (eg must run at least 80% of the
speed. Use no more than 1.3x the memory)
Just my opinion.
--
Adrian
next prev parent reply other threads:[~2008-02-16 13:43 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-15 13:33 Automated conversion to C++? Jacob Sparre Andersen
2008-02-15 14:11 ` Robert A Duff
2008-02-15 19:12 ` Jacob Sparre Andersen
2008-02-16 0:44 ` Robert A Duff
2008-02-17 22:31 ` Phaedrus
2008-02-18 0:59 ` Larry Kilgallen
2008-02-18 7:14 ` Martin Krischik
2008-02-19 1:04 ` Phaedrus
2008-02-19 17:01 ` Martin Krischik
2008-02-18 7:10 ` Martin Krischik
2008-02-18 7:08 ` Martin Krischik
2008-04-03 9:48 ` vindhya
2008-04-03 13:27 ` Robert A Duff
2008-02-15 18:24 ` Jeffrey R. Carter
2008-02-15 20:35 ` Maciej Sobczak
2008-02-16 4:52 ` Jeffrey R. Carter
2008-02-16 7:40 ` Pascal Obry
2008-02-16 12:12 ` Peter C. Chapin
2008-02-16 13:41 ` Larry Kilgallen
2008-02-16 16:35 ` Maciej Sobczak
2008-02-16 17:12 ` Jeffrey R. Carter
2008-02-16 21:23 ` Maciej Sobczak
2008-02-16 22:11 ` Jeffrey R. Carter
2008-02-19 16:46 ` Jacob Sparre Andersen
2008-02-17 12:41 ` Larry Kilgallen
2008-02-17 18:57 ` Peter C. Chapin
2008-02-17 19:50 ` Larry Kilgallen
2008-02-18 14:43 ` Maciej Sobczak
2008-02-18 19:17 ` Larry Kilgallen
2008-02-18 19:44 ` Peter C. Chapin
2008-02-19 0:05 ` John W. Kennedy
2008-02-19 7:29 ` Jean-Pierre Rosen
2008-02-18 20:01 ` Jeffrey R. Carter
2008-02-18 23:33 ` Randy Brukardt
2008-02-20 1:53 ` Subject: POSIX , Ada, Line Feeds, etc (was Automated conversion to C++) KarlNyberg
2008-02-21 7:34 ` Subject: POSIX , Ada, Line Feeds, etc Jacob Sparre Andersen
2008-02-16 17:09 ` Automated conversion to C++? Jeffrey R. Carter
2008-02-16 16:31 ` Maciej Sobczak
2008-02-16 17:20 ` Jeffrey R. Carter
2008-02-16 13:21 ` Jacob Sparre Andersen
2008-02-16 17:15 ` Jeffrey R. Carter
2008-02-16 13:43 ` Dr. Adrian Wrigley [this message]
2008-02-16 16:42 ` Jacob Sparre Andersen
2008-02-16 16:58 ` Martin
2008-02-21 7:14 ` Jacob Sparre Andersen
2008-02-16 21:43 ` Maciej Sobczak
2008-02-16 22:04 ` Jeffrey R. Carter
2008-02-16 18:27 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox