comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: Application Size in Ada
Date: 15 Apr 2004 22:12:12 +0200
Date: 2004-04-15T22:09:55+02:00	[thread overview]
Message-ID: <87u0zl2e77.fsf@insalien.org> (raw)
In-Reply-To: c5mkkn$gk3$1@wotsit.aston.ac.uk

Simon Lewis writes:
> How is dynamic linking achieved in Ada?

This depends on your compiler and linker.  These in turn depend on
your host platform.

> Are the Ada specific DLL's or can a DLL be used by any language as
> long as you have the right 'bindings' (You will have to excuse my
> ignorance, i am not very familiar with linking in Ada).

Libraries consist of object code and are theoretically independent of
the high-level language used to create them.  So yes, with the right
bindings (it is the appropriate word) you can use libraries produced
from any language.  However, compilers for object-oriented or very
high-level languages use obscure constructs like name mangling and
virtual tables.  You need detailed knowledge about them if you want to
use such a library.

Libraries produced from C are easy to use, because C does not need
name mangling or any funny structure.  C is the least common
denominator.  Libraries written in other languages may be more
difficult to use from other languages.

If you write a library in Ada, you can selectively export subprograms
and types using the same convention as C.  This makes such libraries
very easy to use from any other language.  The details of how to do
this depend somewhat on the compiler and target platform, but you can
have a look at the Ada Reference Manual [1], annex B "Interface to
Other Languages"; of particular interest are sections B.1 "Interfacing
Pragmas" and B.3 "Interfacing with C".

The Big Online Book of Linux Ada Programming [2] will also help you
even if you use another platform.

[1] http://www.adaic.org/standards/95lrm/html/RM-TTL.html
[2] http://www.vaxxine.com/pegasoft/homes/book.html

-- 
Ludovic Brenta.




  parent reply	other threads:[~2004-04-15 20:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-15 16:54 Application Size in ADA Simon Lewis
2004-04-15 18:13 ` Application Size in Ada Ludovic Brenta
2004-04-15 18:34   ` Simon Lewis
2004-04-15 19:49     ` chris
2004-04-15 19:52       ` chris
2004-04-15 20:12     ` Ludovic Brenta [this message]
2004-04-16  9:00       ` Simon Lewis
2004-04-15 18:13 ` Application Size in ADA Georg Bauhaus
2004-04-15 18:42 ` Martin Krischik
2004-04-15 19:26   ` Simon Lewis
2004-04-15 19:54   ` Martin Dowie
2004-04-15 21:26     ` Luke A. Guest
2004-04-15 22:25       ` Robert I. Eachus
2004-04-16  6:26       ` Martin Krischik
2004-04-15 21:22   ` Randy Brukardt
2004-04-16  6:22     ` Martin Krischik
2004-04-15 22:16 ` Robert I. Eachus
2004-04-16 16:31 ` Jano
replies disabled

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