On Dec 20, 2006, at 4:50 AM, Werner Smekal wrote: > Hi Jerry, > > I've spotted your bindings to ada already some time ago. Normally > such bindings go into the bindings directory (in the ada case, > bindings/ada), and since swig doesn't seem to support ada, your > effort was the only possible.
I understand that Ada support for SWIG is coming, but I don't know when. > > Anyway, I don't know much ada, but how is this supposed to work? > Which files of your work are actually really needed? All three packages of the (spec and body files) are needed. Some cases may get by without the thin binding and and the "common" stuff but that would depend on a specific case of usage. The example file uses all three packages and this is recommended. > How is ada told then where it can find the bindings? That is up to the particular OS or build system, as typically handled by search paths. > How does ada than find the plplot library? This is a linker issue and as such is specific to a particular OS or build system. I did this work in the Xcode IDE on OS X so this is handled by drag-and-drop in that case. > It seems that ada can use libraries directly? This is a linker issue--see the above comment. Also, Ada has an extensive built-in C interfacing capability which among other things allows the association of external C symbols to Ada symbols. In the thin bindings you will see many lines that look like this: procedure plwhatever(this : PLINT; that : PLFLT); pragma Import(C, plwhatever, "c_ plwhatever"); This is the connection to external code, in this case C. (Other languages are also supported, mainly FORTRAN and COBOL, I believe.) However, the Ada programmer does not ever need to be concerned with this detail. Ada implementations require that C constructs map in obvious ways to corresponding Ada constructs. For referencing external data or passing data to subroutines, the pragmas can enforce C or FORTRAN calling conventions. > > On which platforms (Windows, Linux, MacOSX) is the ada bindings > supposed to work? It will work on any platform which has an Ada compiler and a PLplot library. For output, for what it's worth, I tested it with AquaTerm, X11, and the Postscript file options. > Could you provide a cookbook what is needed to make the bindings > work (for persons who never used ada)? I can provide a help file or readme although compiling sources and linking libraries is just the usual stuff. Command line usage requires compiling your main Ada program, assuming the sources are in your search paths. Compiling Ada is quite easy because every Ada package must specify everything it needs, thus simplifying the build process. Compiling a multi-file program is done by simply directing the compiler to compile the main program. The Ada compiler that is included with gcc is especially easy to invoke, as I understand (not having used any others). After compiling, you tell the linker where the PLplot library is and you're done. > > And would it also possible for you to port the examples which you > can find in the examples directory to ada examples (using the thin > bindings)? I would like to port the examples but I'm a one-person operation so this would take extra time, especially since I still struggle to decipher C. (The FORTRAN examples are easier for me to read so maybe I would use them as a starting point.) I would use the thick bindings, however, because I'm afraid that many Ada programmers would look at the examples written using the thin bindings and keep looking elsewhere for a plotter. For example, the argument lists for the thick binding are frequently shorter because it is not necessary to pass array dimensions. Does the PLplot distribution policy absolutely require that the examples be included with the binding? Jerry > > Thanks, > Werner > > Jerry wrote: >> Hi all, >> My name is Jerry Bauck and I just joined this list after having >> been on the plplot_general list for a while. I hope this is an >> appropriate posting. >> I was delighted to find PLplot some months ago after getting some >> feeling for what is available in the way of high-quality plotters. >> I have made both thick and thin bindings to PLplot in Ada. The >> thick binding contains a number of high-level procedures for >> super-easy use in making plots and manipulating the color tables, >> among other things. >> I didn't know C and was just learning Ada when I started this so >> needless to say it has been entertaining. I made a fat swath >> initially with a few lines of regex (which I also did not know) >> and the rest was just rolling up my sleeves and getting to work >> (plus a little help from the folks at comp.lang.ada). >> I'd like to know if there is any interest in including these >> bindings with the PLplot distribution. >> The source code and some graphical examples may be examined at >> http://homepage.mac.com/oscarruitt/plplotinada/plplot_ada.html >> Thanks, >> Jerry > > -- > Dipl. Ing. Werner Smekal > Institut fuer Allgemeine Physik > Technische Universitaet Wien > Wiedner Hauptstr 8-10 > A-1040 Wien > Austria > > email: [EMAIL PROTECTED] > web: http://www.iap.tuwien.ac.at/~smekal > phone: +43-(0)1-58801-13463 (office) > +43-(0)1-58801-13469 (laboratory) > fax: +43-(0)1-58801-13499 > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel