From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Ada and C++ in the same binary, was: Re: Current status of Ada development for an Android target ? Date: Sun, 19 Jun 2016 15:00:08 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <623218455.487799273.877639.laguest-archeia.com@nntp.aioe.org> <7cc0e66f-2a45-4cca-b670-0c3859f4b004@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Sun, 19 Jun 2016 15:00:08 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d44af18d7d1cdc69cde215431b4ac8ce"; logging-data="7132"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aA8nu3UAskWDqcrKQ0tJLUBqs5hPFrB4=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:Y72qGGHURiCl2VuAvK/r3L5wy+M= Xref: news.eternal-september.org comp.lang.ada:30810 Date: 2016-06-19T15:00:08+00:00 List-Id: On 2016-06-18, Shark8 wrote: > On Saturday, June 18, 2016 at 9:44:37 AM UTC-6, Simon Clubley wrote: >> >> Having thought about the situation, I'm getting nervous once again about >> the "special" :-( situation around Ada compilers given that I'm not >> sure where some of this code might be used in the future. > > Well, hopefully Byron will help push the available options up a bit. > >> My current thinking (as of this morning :-)) is to maybe write the low >> level stuff in C++ (which is the code more likely to be used elsewhere) >> and to do the high level stuff in Ada. > > I think I understand what you're saying... but wouldn't that invite > errors in the lower levels? I rather like the focus that Ada puts on > correctness. (And SPARK is pretty nifty, too.) > I agree that's a concern but I'm writing some code with the possibility in mind that some of it's going to be used in other projects on various unknown targets in the future. That means I have to make language choices based on what's likely to be available for those targets. >> The problem is that I don't have any experience combining C++ and Ada >> code in the same binary; in the past, I've only ever called plain C code >> from Ada. > > What about writing it all in Ada and providing an export interface to C++? The C++ idea is for the low level code which could be used elsewhere. If I write that low level code in Ada then how do I port it to a target which may not have an Ada compiler available for it ? Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world