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-Thread: 103376,ccc3531aba8db12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Erdmann Newsgroups: comp.lang.ada Subject: Re: Dynamic Plug-in Loading with Ada Date: Fri, 01 Jul 2005 08:09:35 +0200 Message-ID: <42C4DE1F.2040102@snafu.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de neZJEen18QyTn4ai5dzaZQdgVTgKsNHI2UgsemI+cP2a3C8j+Ydu6A X-Orig-Path: boavista.mydomain.de!news User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050219 In-Reply-To: Xref: g2news1.google.com comp.lang.ada:11805 Date: 2005-07-01T08:09:35+02:00 List-Id: Preben Randhol wrote: > I don't know if you have seen this paper: > > http://www.gnat.com/pressroom_20.php# > I have read the paper. i think the paper misses out some of the nasty details how to initialize the loaded plugin. At least from my experience i have made with my own implementation (http://sourceforge.net/projects/ascl) this is a small nightmare since you got very strange effect regarding access types if you dont do it. Michael > Maintenance of high-availability systems (e.g., servers) requires the > ability to modify, enhance, or correct parts of the application > without needing to shut down and re-link the entire system. This is > relatively straightforward in an interpreted or virtual-machine based > language such as Java, in which new code is loaded upon demand. In a > language with static executable images this capability can be > realized though dynamically loaded / linked libraries ("DLLs"). > However, in practice this causes problems, because the protocol for > invoking subprograms in a DLL is very low-level and sacrifices type > safety. > > Object-oriented programming makes this approach practical by using > dynamic dispatching to invoke dynamically loaded functions with a > more robust, high-level protocol. In an OO paradigm, a �plug-in� > contains new classes that enrich the class set of the original > application. Calls to subprograms in the shared library (plug-in) are > done implicitly through dynamic dispatching which is much simpler, > more transparent to the programmer, more type-safe, and thus much > safer.A paper by Cyrille Comar and Pat Rogers shows how Ada � a > statically-typed, statically-built, object-oriented language� can > fully implement dynamic plug-ins as in Java, but without needing to > rely on a comparatively inefficient virtual machine. This paper, > which will be available on the AdaCore website, shows how to use GNAT > Pro to build an extensible application and illustrates adding new > functionality at run time through plug-ins, without needing to shut > down the program. > > The paper explains the procedure for doing this in Windows. Does anybody > know if one could do the same in Linux with shared libraries? > > Thanks in advance > > Preben