[OpenAFS] building swig based interfaces

Gémes Géza geza@kzsdabas.hu
Sun, 01 Sep 2013 22:58:00 +0200

2013-09-01 19:31 keltezéssel, Russ Allbery írta:
> Gémes Géza <geza@kzsdabas.hu> writes:
>> Okay, then should wrap around the command line tools then, in the hope,
>> that some day they will get rewritten to use a library I (or someone
>> else) can use? BTW. I'm fine wit it for now.
> I think it's also worth noting that it's rather difficult to write
> high-quality bindings with SWIG, since SWIG forces the language into a
> C-like mode and doesn't give you enough flexibility to adjust the calling
> conventions to be more native to the language that you're binding.  By
> choosing to use SWIG instead of writing native bindings, you will limit
> the possible quality of the end result below where it could be, and it
> will be impossible to achieve the best quality without mostly throwing
> things out and starting again from scratch without SWIG.
> It may still be the expedient approach, but it's an inherent limitation.
The advantage of the swig approach is not just speed, but the ability (I 
don't plan to exploit it) to use the same interface for many more 
languages. Although writing native python bindings were and still are 
under consideration too.


Geza Gemes