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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c74781e34db23310 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-15 13:09:56 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!news2.euro.net!transit.news.xs4all.nl!195.241.76.212.MISMATCH!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Sender: lbrenta@deuteronomy Newsgroups: comp.lang.ada Subject: Re: Application Size in Ada References: <87y8ox2jpq.fsf@insalien.org> From: Ludovic Brenta Date: 15 Apr 2004 22:12:12 +0200 Message-ID: <87u0zl2e77.fsf@insalien.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 15 Apr 2004 22:09:55 CEST NNTP-Posting-Host: 83.134.238.160 X-Trace: 1082059795 dreader2.news.tiscali.nl 41750 83.134.238.160:33058 X-Complaints-To: abuse@tiscali.nl Xref: archiver1.google.com comp.lang.ada:7164 Date: 2004-04-15T22:09:55+02:00 List-Id: 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.