This repo shows a very basic example of Ada to Python automatic interfacing, using The -gnatceg switch along with Python's cffi library.
The limitations are mainly due to what -gnatceg is able to handle, mostly:
- Simple Ada types that maps to C types straightforwardly (so no discriminated records, unconstrained arrays, ect)
- Functions and procedures using the
C
convention.
Steps are:
- Install python and the cffi library, using
pip
for example - Install a GNAT toolchain
- Run
$ make
, and then$ python test.py
. You should see:
$ python test.py
Point(1, 2)
Point(3, 4)