After many months of neglect, I may be able to get back to work on my Wcl to
perl interface. One of the things I will need to do is provide some way for
the perl code to access massive numbers of different callback info structs
and massive numbers of the various widget convenience functions, etc. It
would sure be nice to construct all these interfaces automagically.
I know there has been some work on this, but I haven't really kept track of
things too well, and I apologize in advance for asking questions I probably
ought to know the answers to:
* Where do I find the existing work that has already been done to interface
with structs? Is it already part of 5.002beta1? Or can I ftp it from
somewhere?
* What is the preferred mechanism for providing perl code with access to
structs? Do people use a pack/unpack type approach, or do you make the
struct look like a hash? Or do you just provide get and put functions
for each field? How do you approach nested structs? How about unions?
* I know it is probably impossible to make a mechanism that will work with
any existing C code without being at least as complex as a full blown C
compiler. Has anyone considered adding a "perl" target to gcc which could
compile arbitrary C or C++ code into a perl XS module that provides access
to all the data structures, enums, and functions?
* Another source of (hopefully) accurate information about the layout of
structs is the symbolic debug information that compilers generate. There
are an awful lot of different kinds of debug info from BSD stabs, to AT&T
COFF, to ELF and DWARF versions 1 and 2, to probably many other formats I
don't know about, but perhaps a perl interface to debug info could be
defined and various modules implemented to read different kinds of debug
info (perhaps even, the code to do this could be extracted from gdb, which
already knows how to read different kinds of debug info). Is this an idea
worth pursuing? [.I certainly know a lot about reading COFF and DWARF2
having written all the object reader code for our debugger here :-)].
* I don't know much about CORBA other than the acronym and a vague notion
of what the project is trying to do, but it seems to me that they have
similar interface issues to deal with, and perhaps there is some CORBA
work that perl code take advantage of to interface to other languages.
Has anyone who knows more about CORBA than me looked into this?
I didn't realize this message was going to get so long. I'd better stop
now, as this is probably already enough to trigger an interminable
thread of discussion :-).
--
Tom.Horsley@mail.hcsc.com
Home: 511 Kingbird Circle Delray Beach FL 33444
Work: Harris Computers, 2101 W. Cypress Creek Rd. Ft. Lauderdale FL 33309
Support Project Vote Smart! They need your support in non-election years too!
(email pvs@neu.edu, 1-800-622-SMART, http://www.vote-smart.org)
perl interface. One of the things I will need to do is provide some way for
the perl code to access massive numbers of different callback info structs
and massive numbers of the various widget convenience functions, etc. It
would sure be nice to construct all these interfaces automagically.
I know there has been some work on this, but I haven't really kept track of
things too well, and I apologize in advance for asking questions I probably
ought to know the answers to:
* Where do I find the existing work that has already been done to interface
with structs? Is it already part of 5.002beta1? Or can I ftp it from
somewhere?
* What is the preferred mechanism for providing perl code with access to
structs? Do people use a pack/unpack type approach, or do you make the
struct look like a hash? Or do you just provide get and put functions
for each field? How do you approach nested structs? How about unions?
* I know it is probably impossible to make a mechanism that will work with
any existing C code without being at least as complex as a full blown C
compiler. Has anyone considered adding a "perl" target to gcc which could
compile arbitrary C or C++ code into a perl XS module that provides access
to all the data structures, enums, and functions?
* Another source of (hopefully) accurate information about the layout of
structs is the symbolic debug information that compilers generate. There
are an awful lot of different kinds of debug info from BSD stabs, to AT&T
COFF, to ELF and DWARF versions 1 and 2, to probably many other formats I
don't know about, but perhaps a perl interface to debug info could be
defined and various modules implemented to read different kinds of debug
info (perhaps even, the code to do this could be extracted from gdb, which
already knows how to read different kinds of debug info). Is this an idea
worth pursuing? [.I certainly know a lot about reading COFF and DWARF2
having written all the object reader code for our debugger here :-)].
* I don't know much about CORBA other than the acronym and a vague notion
of what the project is trying to do, but it seems to me that they have
similar interface issues to deal with, and perhaps there is some CORBA
work that perl code take advantage of to interface to other languages.
Has anyone who knows more about CORBA than me looked into this?
I didn't realize this message was going to get so long. I'd better stop
now, as this is probably already enough to trigger an interminable
thread of discussion :-).
--
Tom.Horsley@mail.hcsc.com
Home: 511 Kingbird Circle Delray Beach FL 33444
Work: Harris Computers, 2101 W. Cypress Creek Rd. Ft. Lauderdale FL 33309
Support Project Vote Smart! They need your support in non-election years too!
(email pvs@neu.edu, 1-800-622-SMART, http://www.vote-smart.org)