Re: C to Ada




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.

.



Relevant Pages

  • Re: Extending discriminant types
    ... Because the poster states that he can compiler the code. ... I used Gnat 3.15p using Ada 95 specs. ... type Child is new KBase with null record; ...
    (comp.lang.ada)
  • Re: GNAT verses A# for soft-realtime system
    ... I have a choice of GNAT or A# for my programming environment. ... Whether you go with a supported compiler, or with a free version of GNAT ... version of Ada you want to use. ... Windows target but could also use .net on top of that. ...
    (comp.lang.ada)
  • Re: GNAT verses A# for soft-realtime system
    ... I have a choice of GNAT or A# for my programming environment. ... Whether you go with a supported compiler, or with a free version of GNAT ... version of Ada you want to use. ... Windows target but could also use .net on top of that. ...
    (comp.lang.ada)
  • Re: ada compiler?
    ... The compiler uses the FPU ... -- learning and debugging feature that is build-in to Ada. ... -- one will suggest that this should be reported to Adacore. ... This is stated on a number of Adacore and GNAT source files ...
    (comp.lang.ada)
  • Re: Current status of Ada?
    ... learning and using this great language. ... The reason why compilers maker can't make their compiler totally free ... I agree with you that most of the links you can find on Ada websites ... AdaCore has contributed a free gnat compiler to ...
    (comp.lang.ada)