You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Hans Marggraff <hm...@qint.de> on 2002/12/18 08:46:04 UTC

Re: Java binding - SWIG or not? Not!

I have looked at the java bindings too and tried to get them working.
I posted the original question, and since have played with swig.

The design of svn makes use of swig very hard. Svn exposes a mass of interfaces
that reach right through to its underlying libraries (neon etc)
Swig will try to generate wrappers for these too which leads to an unmanageable
mass of interfaces, most of which are superfluous.

This can be turned off by defining mappings for swig, however these mappings did not
appear much simpler than to to a concise JNI wrapper.

To be able to generate or to maintain the java interface *automatically* via swig
is an illusion in my opinion.

Regards
	Hans Marggraff

Greg Stein wrote:
> On Mon, Dec 16, 2002 at 11:02:04PM +0100, Oliver Geisser wrote:
> 
>>Hi
>>
>>Jesper Steen Møller wrote:
>>
>>>My (perhaps) ambitious goal is to write a Subversion client to build 
>>>into Eclipse.
> 
> 
> Very cool.
> 
> 
>>...
>>
>>>How should I contribute?
>>>A. Work on completing/improving/testing the SWIG/Java bindings
>>>B. Adjust/complete the original JNI effort
> 
> 
> I would recommend (A). Over the long-haul, having the bindings automatically
> update w.r.t the libraries' APIs will be much better. Having to hand-code
> each wrapper and maintain that will be a pain and will fall out of sync very
> easily.
> 
> 
>>...
>>Copy the way SWT interacts with native toolkits.
>>The SWT JNI bindings are the smallest possible wrappers around
>>the native C functions. Everything else is done on the
>>Java side.
> 
> 
> I'm not entirely sure exactly what SWT does, but that is the recommend
> procedure: wrap the functions exactly as they are -- get them up into the
> other language. In *that* language, create your language-specific and
> language-stylistic abstractions.
> 
> Python and Java and Perl will have *very* different notions of the "right"
> way to expose the SVN functionality. So let the wrappers give you the
> basics, and then do it Right in the other language.
> 
> Cheers,
> -g
> 

-- 
Hans Marggraff
Qint Software
Allingerstr. 18a
82178 Pucheim
Germany
Tel 089 80067094
mailto:hmf@qint.de
http://www.qint.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Java binding - SWIG or not? Not!

Posted by Hans Marggraff <hm...@qint.de>.
Greg Stein wrote:
> On Wed, Dec 18, 2002 at 09:46:04AM +0100, Hans Marggraff wrote:
> 
>>I have looked at the java bindings too and tried to get them working.
>>I posted the original question, and since have played with swig.
>>
>>The design of svn makes use of swig very hard. Svn exposes a mass of interfaces
>>that reach right through to its underlying libraries (neon etc)
>>Swig will try to generate wrappers for these too which leads to an unmanageable
>>mass of interfaces, most of which are superfluous.
> 
> 
> What did you do? Run SWIG yourself right over our .h files? Eesh... No
> wonder it isn't coming out very well.
> 
> Take a look at subversion/bindings/swig/. The top-level Makefile even has
> some stuff already for generating the Java bindings.

I tried that, baut at the time (8 months ago) Swig core dumped when I tried to
generate java output using the subversion swig bindings. At that point I gave up.
Pleased to hear, that the situation has improved.

> 
> 
>>This can be turned off by defining mappings for swig, however these mappings did not
>>appear much simpler than to to a concise JNI wrapper.
>>
>>To be able to generate or to maintain the java interface *automatically* via swig
>>is an illusion in my opinion.
> 
> 
> We've been doing exactly this for the Python wrappers, and I believe it is
> also working (to a point) for the Java stuff that Daniel Rall has been
> working on.
> 
> Cheers,
> -g
> 

If the swig/java and the swig/python stuff can share a significant part of the wrappers,
then swig will make a lot more sense for java too.

Regards
Hans

-- 
Hans Marggraff
Qint Software
Allingerstr. 18a
82178 Pucheim
Germany
Tel 089 80067094
mailto:hmf@qint.de
http://www.qint.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Java binding - SWIG or not? Not!

Posted by Greg Stein <gs...@lyra.org>.
On Wed, Dec 18, 2002 at 09:46:04AM +0100, Hans Marggraff wrote:
> I have looked at the java bindings too and tried to get them working.
> I posted the original question, and since have played with swig.
> 
> The design of svn makes use of swig very hard. Svn exposes a mass of interfaces
> that reach right through to its underlying libraries (neon etc)
> Swig will try to generate wrappers for these too which leads to an unmanageable
> mass of interfaces, most of which are superfluous.

What did you do? Run SWIG yourself right over our .h files? Eesh... No
wonder it isn't coming out very well.

Take a look at subversion/bindings/swig/. The top-level Makefile even has
some stuff already for generating the Java bindings.

> This can be turned off by defining mappings for swig, however these mappings did not
> appear much simpler than to to a concise JNI wrapper.
> 
> To be able to generate or to maintain the java interface *automatically* via swig
> is an illusion in my opinion.

We've been doing exactly this for the Python wrappers, and I believe it is
also working (to a point) for the Java stuff that Daniel Rall has been
working on.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org