From: <lan...@qw...> - 2006-05-06 02:44:40
|
PLplot is something that I am definitely interested in but has been on my back burner for while--read,I haven't done much at all with it. I'll study the SWIG site, as it is something that I've run into before as being potentially useful. Ada can interface directly to C binaries, and I've written some code like that. It's fairly easy as long as the C code uses simple types-- just two lines of Ada per C call--nothing unusual there. And rewriting the headers as Ada spec files. Arrays are fine and structs probably are OK (not sure), but anything fancier could be a problem (not sure again). I could answer this myself by looking at PLplot source, but approximately how many functions would have to be interfaced, and are the arguments simple types and arrays (or pointers to any of those)? I'll need to also send output to Aquaterm on OS X, but I think PLplot already has an adaptor for that use. Jerry On May 5, 2006, at 6:46 PM, Alan W. Irwin wrote: > On 2006-05-05 17:30-0700 lan...@qw... wrote: > >> Are there Ada bindings for PLplot? > > No, but there is hope if you are willing to do some work. > > There are two approaches for providing a language binding to PLplot. > > (1) Do a hand-generated interface. That's how we used to do our > Python and > Java interfaces, but it was quite time consuming and error prone to > do the > same boiler-plate transformations again and again for different > argument > list orderings for each of our functions. > > (2) If you have the ability to hand-craft an interface, then you can > formulate all those Ada <--> C argument transformation rules for > each type > of variable using the Simplified Wrapper and Interface Generator > (SWIG). > Fortunately, those interface rules had already been done in SWIG > for Python > and Java (and many other languages, see > http://www.swig.org/compat.html#SupportedLanguages) so it took a > relatively > limited effort to produce complete Python and Java PLplot > interfaces using > the SWIG approach, and we would never go back to using a non-SWIG > approach > to generate those interfaces. > > We definitely encourage additional language interfaces to PLplot > using the > SWIG-based approach. Unfortunately, nobody has yet formulated the C > <--> Ada > transformation rules in SWIG. So you would have to do that first, > then > finish with the (relativly easy) specific SWIG configuration for > the Ada > interface to PLplot to apply those transformation rules for the large > variety of argument list arrangements for the C functions in our API. > > Hope this overview of the problem of generating new language > interfaces to > PLplot helps. > > Alan > __________________________ > Alan W. Irwin > |