|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-10-12 10:33:41
----- Original Message -----
From: "Greg Colvin" <gcolvin_at_[hidden]>
> From: David Abrahams <abrahams_at_[hidden]>
> ...
> > I don't know much about Perl, but I doubt it has the right abstractions.
For
> > example, does Perl have classes?
>
> Yes.
>
> You can find a description of how to call C from Perl here:
>
> http://www.perldoc.com/perl5.6/pod/perlxs.html
That document describes an IDL and its associated pre-compiler. As such
it's not very useful for what I'm doing, since my approach is explicitly
non-IDL oriented.
> > I did spend a few minutes looking at JNI to see if the same thing could
be
> > done for Java, but it's not clear to me that it would work.
>
> After more thought, here is how it might work. If you have a
> C++ class you want to call from Java you would have to write
> a corresponding Java class with all its methods declared to be
> "native". Then you put a JNI wrapper on each C++ method. Easy
> enough, but no doubt there would be other gotchas.
Like, for example, where does the C++-specific object data go (i.e. the
instance of the class being wrapped)?
The biggest obstacle I could see was that JNI seemed to be a language based
on using preprocessor macros. It wasn't clear to me that there was a way to
generate the appropriate constructs using template argument deduction (which
is what py_cpp does).
-Davfe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk