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 17:52:43 -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> <421848116.488042939.962509.laguest-archeia.com@nntp.aioe.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Sun, 19 Jun 2016 17:52:43 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d44af18d7d1cdc69cde215431b4ac8ce"; logging-data="15679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xX9Qn7fyDHnQg7DI+Kchyo+dwPtjZFho=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:BBzgwqHKZ6IHZYfDDwJKSrGr3yg= Xref: news.eternal-september.org comp.lang.ada:30813 Date: 2016-06-19T17:52:43+00:00 List-Id: On 2016-06-19, Luke A Guest wrote: > Simon Clubley wrote: > >>>> 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 ? > > Obviously, if GCC has a backend target done, getting Ada on it is generally > trivial bless it's got weird exception handling, I don't know when they did > it but they finally added arm specific eh. > > In this specific case it would help to know which specific targets you > need. > I suppose in some ways that's at the core of the problem; I don't fully know and I don't know what's going to be along in a couple of years (both architecture and operating system wise) that I might want to use some of this code with. My new project is initially Linux desktop based but some of the lower level stuff is probably going to find it's way into some embedded and portable applications. Right now on my desk, I've got stuff with MIPS, AVR and ARM cores (both Cortex M0/M4 class and A8 class as well as traditional ARM cores). I've got stuff that's running a mixture of bare metal code, RTEMS and a bit of Linux. (Because of various reasons, including the historical embedded compiler situation, most of the above is running C code; Ada is more of a desktop environment language for me at the moment). I've also got Android devices that I am wanting to get more into as well. The requirement to port parts of my new project to unknown future targets is what originally drove me (reluctantly) initially down the pure C path before I abandoned that idea as not viable. The next logical step up is C++ (because it's probably going to be available on most of the new targets C is) but I do prefer Ada. However, having said all that, the immediate new target of interest is Android which I've got a couple of future ideas for. One concern however is with the potential closing of Android by moving away from the AOSP (and potential internals changes) along with, as you pointed out, the move to LLVM. As such I do wonder if gcc is going to be left out in the cold on new Android versions. BTW, thanks for asking that question. :-) Writing the above in a form suitable for someone else to read has helped sort out some ideas in my head. :-) Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world