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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a7da1d9b7f5ba84 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!a21g2000yqc.googlegroups.com!not-for-mail From: Mark Lorenzen Newsgroups: comp.lang.ada Subject: Re: Loadable module in Ada. Date: Thu, 3 Dec 2009 05:40:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <3f7376da-6666-446d-a1f5-4e6cad8165d1@a21g2000yqc.googlegroups.com> References: <2009120301362116807-stevenshack@stevenshackcom> NNTP-Posting-Host: 193.163.1.105 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1259847617 13181 127.0.0.1 (3 Dec 2009 13:40:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 Dec 2009 13:40:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a21g2000yqc.googlegroups.com; posting-host=193.163.1.105; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8299 Date: 2009-12-03T05:40:17-08:00 List-Id: On 3 Dec., 10:36, Steven Shack wrote: > I'd like to create a loadable module in an Ada program. I've searched > around, but can't > seem to find any examples of this. Say I've got some calculation or a > driver and I'd like to have > multiple different versions of it with the same interface. I'd like to > be able to load and replace > these modules at runtime. > > In C I'd do this with pic code, dlsym and function pointers. I can't > seem to find the equivalent > in Ada. Can anyone help me out? > > Thanks I'm not sure what you mean by loadable module, but if you mean dynamic linking at run-time, you should take a look at this very interesting article: http://www.adacore.com/wp-content/uploads/2005/04/dynamic_plugin_loading_with_ada.pdf Note that you will of course still need support from the OS, so there is no pure Ada solution, just as there is no pure C solution (the dl* system calls just happen to have a C API). - Mark