[fpc-pascal] Re: Automatically exporting C++ API using SWIG??
Reinier Olislagers
reinierolislagers at gmail.com
Thu Aug 1 12:47:18 CEST 2013
On 01/08/2013 12:24, Sven Barth wrote:
> Am 01.08.2013 12:11, schrieb Michael Van Canneyt:
>> On Thu, 1 Aug 2013, Sven Barth wrote:
>>> Am 01.08.2013 11:38, schrieb Michael Van Canneyt:
>>>> On Thu, 1 Aug 2013, Sven Barth wrote:
>>>>> Am 01.08.2013 11:10, schrieb
>>>> How do you handle different binary formats of C++ compilers ?
>>>> Or is this meanwhile standardized ?
>>> Support for every C++ compiler (mainly MSVC, C++ builder and GCC
>>> [LLVM counts here as GCC]) needs to be implemented explicitely,
<snip>
>> Since a library is provided by a vendor, I'd say you normally
>> interface with one compiler per lib that you target, no ?
> That's basically what I said :)
>>
>>>
>>> As a first step I'd only target GCC and LLVM as these are the main
>>> compilers for the majority of our platforms.
>>
>> Eh, MSVC also seems popular on windows ? ;)
> We have three windows platforms with MSVC and I don't know how many
> platforms where GCC or LLVM is the main compiler. I'm not going for
> popularity here, just for the majority of platforms.
Looking at the options
1 use swig architecture to parse the C++ source code/headers and extract
Pascal bindings - either by a rewrite or adapting the current effort
2 accommodate (and maintain) various compiler idiosyncracies
from a distance... I'd say option 1 would be the easiest and best
maintainable?
- SWIG already provides infrastructure to parse the source files
- People using Delphi would probably also be interested in
fixing/patching bugs
- On top of the previous point: changes in C/C++ standards/formats would
not be our concern so much because those will be dealt with by the wider
SWIG community
- Of course, if swig is ever extended to support more languages, we get
that for free
Of course I understand it's very attractive to have everything in house
and native in FPC, but I suspect the effort needed to develop/maintain
it may outweigh that...
@dliw: wasn't the Object Pascal module based on the Modula 3 module?
IIRC recent posts on the swig mailing lists did indeed indicate the
Modula 3 module was buggy in current SWIG.
More information about the fpc-pascal
mailing list