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,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!pe1.news.blueyonder.co.uk!blueyonder!news-out.ntli.net!newsrout1-gui.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe1-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: Dynamic Plug-in Loading with Ada User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Tue, 28 Jun 2005 20:43:20 GMT NNTP-Posting-Host: 80.4.127.115 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe1-win.ntli.net 1119991400 80.4.127.115 (Tue, 28 Jun 2005 21:43:20 BST) NNTP-Posting-Date: Tue, 28 Jun 2005 21:43:20 BST Organization: ntl Cablemodem News Service Xref: g2news1.google.com comp.lang.ada:11705 Date: 2005-06-28T20:43:20+00:00 List-Id: On Sat, 25 Jun 2005 09:35:16 +0200, Preben Randhol wrote: > I don't know if you have seen this paper: > > http://www.gnat.com/pressroom_20.php# ... > The paper explains the procedure for doing this in Windows. Does anybody > know if one could do the same in Linux with shared libraries? Hi! I put together a little package last year to do "Live Coding" in Ada under GNAT/Linux. The package (LiveCoding) implemented procedures to run statements, to compile subprograms and to compile packages. The arguments would be strings and context clauses. I implemented context clauses as a separate data type which could be passed in to the code generator, The LiveCoding package wrote out new packages into files and called out to gnatgcc (or whatever) to compile the code fragments using dlopen and dlsym to access the new program symbols. I think this goes a bit beyond implementing plug-ins because the new code was written out and compiled by the running program. And it could run new statements and function calls dynamically generated. Overall, it was just an experimental system, to investigate the viability of the technique. While it was not perfect, it seemed very promising. It took about 150ms to compile, link and run basic statements and packages (2xAMD 1400XP). OK for implementing a command parser with a human interface. The run-time performance of the code, of course, is excellent. What was it all for? One use I was looking into was for interactive digital music synthesis. Users want to be able to type in music fragments as code segments, joining them together in real time. The most popular way of doing this (live) is with a LISP system, but some people use FORTH derivitives (AMPLE). It also shows promise for efficient emplementation of genetic algorithms, where expressions are generated and tested for fitness in problem solving. Compiling the code is often 20x the speed of interpreting the function more directly in the code. Another use was in a new kind of software development system I was messing around with. Basically, I wanted to make the programming experience much more interactive, allowing changes to code to be made "on the fly". Ada is particularly unsuited to Live Coding, but it *can* be made to work. In curious to know if anyone else has tried "Live Coding" in Ada, and what the outcome was. Good luck! -- Dr. Adrian Wrigley, Cambridge, UK.