comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Newbie wanna Ada
Date: Fri, 26 Oct 2001 14:02:00 GMT
Date: 2001-10-26T14:02:00+00:00	[thread overview]
Message-ID: <s1eC7.1421$xS6.1867@www.newsranger.com> (raw)
In-Reply-To: 3BD87B95.2000703@maciejsobczak.com

In article <3BD87B95.2000703@maciejsobczak.com>, Maciej Sobczak says...
>2. Is there some more or less standard GUI lib? I've spot a Tcl/Tk 
>binding somewhere:

Probably the best Ada GUI lib for a Linux user would be GtkAda
(http://libre.act-europe.fr/GtkAda/).

>3. What is the level of portability of the source code? C++ suffers from 
>the fact that many vendors dare to dump crap on the market with the C++ 
>logo on the boxes. The result is that we have many different 'dialects' 
>of this (standardised) language. What about Ada? If I write something 
>for GNAT, can I assume that some imaginary Windows compiler will eat it?

The Ada culture is very different from the C++ culture there. Ada compilers that
don't properly implement the standard are just *not* accepted by the user
community, and thus there aren't many of them. Any compiler vendor can tell you
that it is quite common to get angry messages (and demands for bug fixes) from
users when they percieve that some section of the Ada Language Reference Manual
has been violated. In my experience any actual non-compliance found *is* treated
as a bug by the vendors.

However, there are some areas (clearly defined in the standard) where vendors
have some lattitude. Many of the "Annexes" in the standard are optional. In
fact, I believe there's still one that is only supported by Gnat. Also, vendors
are free to add their own pragmas. If a compiler encounters a pragma it doesn't
understand, it will ignore it, so this isn't disasterous, but it can make your
code non-portable if you aren't careful. In general, the places where things are
implmentation-defined are clearly called out in the spec, and it isn't difficult
to write code that is completely portable between compilers and platforms. My
company has a multi-threaded real-time scheduler that compiles and runs without
change on Win32 and vxWorks.

>4. What is the possibility of interfacing Ada with C (mainly - using C 
>libs from Ada)? Is this made during the linking or in the spirit of 

Quite easily done. There is a secion in the LRM all about it. See section B.3
and all subsections ( http://www.ada-auth.org/~acats/arm-html/RM-B-3.html ). The
pragmas used are shown in B proper.

>Native Interfaces (like in Java)? For extremists - is it possible to 
>call back some Ada procedure from the C function (possibly running in 
>another thread)?

Yup. I had to do both once when we had an existing C routine to call that
allocated memory, but we needed it to use Ada's allocators so that the memory
would be visible to other Ada tasks (this was on a Harris NightHawk, where tasks
were implemented as processes and all "globals" and dynamic allocation came from
shared memory). We just implmented our own C-interfaced allocation routine in
Ada and exported it as "malloc". Worked like a charm. 

>5. Is there a CORBA binding implemented for Ada?
Unfortunately I'm stuck in a Windows ghetto, so I don't know about that. But I
do know that there is a really good COM binding. From what I remember of CORBA,
an Ada binding wouldn't be difficult to do yourself in a pinch, but someone
probably has one already.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



  parent reply	other threads:[~2001-10-26 14:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-25 20:52 Newbie wanna Ada Maciej Sobczak
2001-10-25 21:30 ` tmoran
2001-10-26  9:49   ` Tony Gair
2001-10-26 12:57     ` Marc A. Criley
2001-10-26 16:31     ` tmoran
2001-10-26 13:18   ` Marin David Condic
2001-10-26 14:38     ` Ted Dennison
2001-10-26 15:42       ` Marin David Condic
2001-10-25 22:10 ` Michal Nowak
2001-10-25 23:47 ` Matthew Woodcraft
2001-10-26 13:30   ` Marin David Condic
2001-10-26  2:02 ` DuckE
2001-10-26  2:32 ` David Starner
2001-10-26  9:23   ` Preben Randhol
2001-10-26 17:22     ` David Starner
2001-10-27  8:39       ` Preben Randhol
2001-10-26 14:02 ` Ted Dennison [this message]
2001-10-26 18:02 ` Maciej Sobczak
2001-10-26 18:54   ` Marin David Condic
2001-10-26 19:39   ` Ted Dennison
2001-10-26 19:45   ` Larry Kilgallen
2001-10-27 10:17   ` Michal Nowak
replies disabled

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