Re: Dynamic functions



Dmitry A. Kazakov wrote:
On Fri, 10 Aug 2007 08:54:57 +0200, in comp.lang.ada you wrote:

Poul-Erik Andreasen wrote:

How is the best way to make a representation of a function/algorithm
wich can bee setup at runtime in Ada.
Is there any reason that you cannot convert the function to Ada, write
it to a file, compile it to a plug-in/DLL/shared library, and then
load the plug-in/DLL/shared library?

Yup, this is how MatLab and many other similar languages do, if you really
need to *program* (as opposed to draw (:-)) something...
The complication is that it requires an Ada compiler on the running
system, but the benefit is pretty fast execution.

?

Execution includes elaboration of the code. In your case elaboration would
mean to call the compiler, to link the DLL, to load the DLL. How frequent
the given function F will be called per run? If you are not going to design
some image rendering/processing system with millions of calls per function,
it probably will not pay off.

In my case wee are in fact talking about several million calls per function. Jacob have bee proposing this model to me before, but i find i a bit to cumbersome. By the way it is not images it is timeseries

Other potential issues:

1. You will need a lot of free system resources to be able to run the
compiler/linker in parallel to your program, free memory and disk space.

2. The response time (from request to execute F to its start) will be
awful.

3. You will need to manage files (lots of) and other environmental stuff.
Deployment, integration etc might turn difficult.

This is my main issue

4. DLL interface does not know Ada. Exporting complex data types and
objects of from a dynamically loaded DLL could be difficult.

5. DLL handling stuff is non-portable.

This could also become an issue.
.



Relevant Pages

  • Re: Dynamic functions
    ... Is there any reason that you cannot convert the function to Ada, ... it to a file, compile it to a plug-in/DLL/shared library, and then ... Execution includes elaboration of the code. ... mean to call the compiler, to link the DLL, to load the DLL. ...
    (comp.lang.ada)
  • Re: LabView-Dll and c++ (with FieldPoint)
    ... i've just startet to work with LabView and am trying to solve a (actually ... functionality should be used as a dll in a c++-program. ... without FieldPoint-assistance which worked fine (i.e. to add up ... At this point i can continue the execution by pressing the ...
    (comp.lang.labview)
  • Using A# & MSIL2Ada ...
    ... I'm trying to write a DLL for one of my .NET-projects. ... implement a C# interface in Ada, and then use that new Ada type from ... interface takes a parameter of type ... ... its ancestor being ClassA in DLL1.dll. ...
    (comp.lang.ada)
  • ada dll and c++ work together easy guide
    ... if possible,please modify it and put it in ada wiki. ... package C renames interfaces.c; ... Library_Interface means which package contain export functions in DLL. ... if your ada code not only work like C/C++ but also need Ada elaboration ...
    (comp.lang.ada)
  • Re: Error in loading DLL (Error 48)
    ... we are not performing any Windows API functions or ... Execution" and "Upgrade ActiveX controls" checkboxes set. ... This DLL appears to be setup the same exact way as ...
    (microsoft.public.vb.com)