comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Dynamic Plug-in Loading with Ada
Date: Tue, 28 Jun 2005 20:43:20 GMT
Date: 2005-06-28T20:43:20+00:00	[thread overview]
Message-ID: <pan.2005.06.28.20.42.47.419892@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: mailman.94.1119684986.17633.comp.lang.ada@ada-france.org

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.




  parent reply	other threads:[~2005-06-28 20:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-25  7:35 Dynamic Plug-in Loading with Ada Preben Randhol
2005-06-28 18:30 ` Mark Lorenzen
2005-06-28 20:43 ` Dr. Adrian Wrigley [this message]
2005-06-28 20:53   ` Alex R. Mosteo
2005-06-28 21:30   ` Preben Randhol
2005-06-28 23:22     ` Dr. Adrian Wrigley
2005-07-01  6:09 ` Michael Erdmann
replies disabled

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