Call C (or C++) with pointer to static function

2010-10-10 Thread Michael Stover
I am wondering if D would be a good choice for our differential equation modeling app. What it needs to be able to do is dynamically compile D code into a static function that can then be used to call C-code that expects a pointer to a static function. Longer description: It is a desktop app. Th

Re: Call C (or C++) with pointer to static function

2010-10-10 Thread Simen kjaeraas
On Sun, 10 Oct 2010 22:03:51 +0200, Michael Stover wrote: I am wondering if D would be a good choice for our differential equation modeling app. What it needs to be able to do is dynamically compile D code into a static function that can then be used to call C-code that expects a pointe

Re: Call C (or C++) with pointer to static function

2010-10-10 Thread Michael Stover
I am under the impression that passing a pointer to a static function (ie, passing a pointer to a memory address that contains the starting point of a function) is not the same as defining a method that can be called by name from C code. I am not a C expert though. Can one call fortran libraries

Re: Call C (or C++) with pointer to static function

2010-10-11 Thread Simen kjaeraas
Michael Stover wrote: I am under the impression that passing a pointer to a static function (ie, passing a pointer to a memory address that contains the starting point of a function) is not the same as defining a method that can be called by name from C code. I am not a C expert though.

Re: Call C (or C++) with pointer to static function

2010-10-11 Thread Michael Stover
Thank you for helping me understand. Mike On Mon, Oct 11, 2010 at 8:39 AM, Simen kjaeraas wrote: > Michael Stover wrote: > > I am under the impression that passing a pointer to a static function (ie, >> passing a pointer to a memory address that contains the starting point of >> a >> function)

Re: Call C (or C++) with pointer to static function

2010-10-11 Thread Daniel Gibson
On Mon, Oct 11, 2010 at 2:30 AM, Michael Stover wrote: > I am under the impression that passing a pointer to a static function (ie, > passing a pointer to a memory address that contains the starting point of a > function) is not the same as defining a method that can be called by name > from C cod

Re: Call C (or C++) with pointer to static function

2010-10-11 Thread Lars T. Kyllingstad
On Sun, 10 Oct 2010 20:30:52 -0400, Michael Stover wrote: > Can one call fortran libraries from D? Ie, say one wanted to use LAPACK > from D? Since it is possible in C, it should be possible in D. A quick search turned up this page: http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortran

Re: Call C (or C++) with pointer to static function

2010-10-11 Thread Michael Stover
Thank you, I have checked them out. Both SciD and dstats look useful. We would have to supplement with our own math libraries and bindings to various C/Fortran libraries I think. I am just exploring possibilities because of the endless troubles we have with compiling and linking C++ code on Mac