[PYTHONMAC-SIG] Calling any toolbox routine from Python

Steven D. Majewski sdm7g@virginia.edu
Wed, 12 Feb 1997 12:15:54 -0500 (EST)


My thoughts on a related issue:

 I've just finished testing a shared library interface to our data 
acquisition hardware for Xlisp-Stat. I'm also going to do Python
and Java bindings, so I've been trying to think of the easiest way
to maintain these separate interfaces in one library. 

[1] The "brute force" method would be to include wrapper/entry-points
for all of the above, and use some symbol naming convention to 
select the appropriate symbols, but I'ld like to avoid having to
deal with the wrapper code in the library. 

[2]   Mac Runtime for Java does some undocumented tricks(*) -- you can
get some clues if you disassemble the class interfaces for some of
the com.apple.MacOS classes. They have class definitions for a bunch
of Mac native data types: point, rect, graphics-port, window, etc. 
and use those in other interface definitions. Java native methods 
have both a native library and a class file to define their interface.
The class files have a representation of the method signature. Is 
there a way to use this sort of signature to create safe wrappers 
at runtime ? 
    
[3] The above sounds rather like what SOM already does. 
Write SOM classes and add SOM import support to Java, Python & Xlisp ? 
( I believe ILU has a similar interface, but (1) no Mac ILU port yet;
(2) SOM is supported on Mac (3) SOM is probably more "lightweight". 


I was thinking about experimenting with SOM a bit -- and to do this 
I was thinking about adding a sort of "raw" call interface to Python. 
I'm still thinking ( in between getting the "brute force" method 
above done to have something right away for my current problems )
about how to do it or if there is a better and higher level way to
package things. If I do a low level interface, I wasn't very concerned
with making it safe -- it is planned mostly as a tool to figure out
a better/safer way to do it. 




[ (*) Undocumented MRJ tricks: The latest Class Wrangler has a "show 
 information" button that will display the class interface definitions. 
 Or you can use MOCHA, a free class file disassembler. A large part
 of the Mac toolbox is wrapped in com.apple.MacOS package. I have 
 been told by Apple that these are experimental and mostly undocumented. ] 


---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---
         By doing just a little every day, you can gradually 
                let the task completely overwhelm you.


_______________
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
_______________