> > - Can Inline wrap a C library without modification?
>
> or any object library, for that matter?

Why not just write Inline::Library? Inline::Library would "parse" library
files by examining their symbol tables and would then generate XS to
automate their linkage with Perl. The user could perhaps specify header
files in which the library's types are defined. Or if sufficient debugging
information is available within the library, type information could be
gleaned from it directly.

Inline::Library could even handle C++ libraries.

Imagine:

use Inline::Library => "nsjpg"; # Expands to libnsjpg.so on Linux.

$jpg = new JPGDecoder;
...

Naive?

TTUL
Ken

> > We could de-emphasize inlining and focus on the automated linkage:
> >
> > - Allow the "use Inline" to specify a file to read from instead of
> >   requiring that the foreign code be embedded.
> > - Provide an alternative to Inline_Stack_* that doesn't impact the C
> >   code. One idea is an ARGMAP which specifies how byref arguments to a
> >   function map to multiple return values. Another is an inlined
> >   function declaration which has additional syntax for specifying the
> >   Perl argument mappings.
> >
> > I realize that these suggestions may not be quite in line with the
> > goals implied by the name "Inline". However, doing this sort of thing
> > would allow Inline to automatically generate the linkage to unmodified
> > C code, allowing folks to do the kinds of things I described above.
> > This would also likely remove the last reason to use XS directly. :)
> >
> > Unfortunately, my suggestions may increase the learning curve of
> > Inline back to the level of XS...
>
> having to RTFM twice to use the _advanced_ features is nothing anyone
> will object to
>
> --
>                                            David Nicol 816.235.1187
>                      Keep Dan Sugalski away from my stuffed animals
>

Reply via email to