Re: C to Ada
- From: rodkay@xxxxxxxxxxx
- Date: 25 Nov 2006 15:52:47 -0800
Brian May wrote:
"rodkay" == rodkay <rodkay@xxxxxxxxxxx> writes:
rodkay> These attempt to generate Ada bindings to both C and
rodkay> C++ libraries. The 'ada' module is for any Ada compiler,
rodkay> and produces bindings based on a 'proxy' approach. The
rodkay> 'gnat' compiler targets the GNAT family of compilers, and
rodkay> produces Ada types and objects which are the binary
rodkay> equivalent of their corresponding C/C++ types.
I am still not clear on the difference - what is the 'proxy' approach?
With the 'proxy' approach, the Ada type holds only a pointer to the
wrapped C++ object. When an object of the the Ada type is constructed,
a corresponding C++ object is created, and its pointer stored in the
Ada type object. All operations on the Ada object are then relayed to
its internal C++ object.
The 'gnat' binary approach produces an Ada record layout which is
equivalent to the C++ class layout. Operations act directly on the Ada
object.
Can I assume that the GNAT target uses GNAT specific features and
won't work without GNAT??
Yes, the 'gnat' SWIG module produces bindings which require a GNAT
compiler.
Perhaps a similar approach (binary-compatible) for other compilers
might be attempted, after the existing modules have matured a little
more.
.
- Follow-Ups:
- Re: C to Ada
- From: Robert A Duff
- Re: C to Ada
- References:
- C to Ada
- From: Brian May
- Re: C to Ada
- From: rodkay
- Re: C to Ada
- From: Brian May
- C to Ada
- Prev by Date: Re: C to Ada
- Next by Date: Re: C to Ada
- Previous by thread: Re: C to Ada
- Next by thread: Re: C to Ada
- Index(es):
Relevant Pages
|