comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Ada-Python binding
Date: Sat, 08 May 2010 00:24:11 +0200
Date: 2010-05-08T00:24:11+02:00	[thread overview]
Message-ID: <87iq6zz6yc.fsf@ludovic-brenta.org> (raw)
In-Reply-To: 29e8c624-74fb-4a92-9ead-aa3cf1cecda6@o14g2000yqb.googlegroups.com

Maciej Sobczak writes on comp.lang.ada:
> Hello,
>
> The following article might be of interest to programmers practicing
> mixed-language development:
>
> http://www.inspirel.com/articles/Ada_Python_Binding.html
>
> This article builds on the various bits and pieces of knowledge that I
> needed to collect in order to proceed with one of my projects.
> Hopefully it will be useful for others as well.
>
> All comments are welcome.

The GNAT Programming Studio uses this technique extensively.  Indeed,
Python is not only the scripting language for GPS but also the language
in which parts of GPS are written.  GPS exposes a rich API to the Python
scripts and plug-ins.

You can have a look at the relevant part of the GPS sources here:

[1] http://libre2.adacore.com/viewvc/trunk/gps/gnatlib/src/python
[2] http://libre2.adacore.com/viewvc/trunk/gps/python
[3] http://libre2.adacore.com/viewvc/trunk/gps/share/library
[4] http://libre2.adacore.com/viewvc/trunk/gps/share/plug-ins

[1] is part of what AdaCore want to turn into a reusable library;
currently the sources are still "hidden" inside the GPS source tree.
This is, essentially, an Ada-Python binding that allows not only to call
Ada subprograms from Python but also to launch a Python interpreter and
execute scripts from within an Ada program.

[2] loads the Python interpreter into GPS for to execute plug-ins
and user-defined initialization scripts written in Python.

[3] contains a library of reusable components written in Python, for use
in plug-ins or user-defined scripts.

[4] contains the plug-ins written in Python.

Most of the modules of GPS export an API to these plug-ins; the code
that does that is scattered in the rest of the source tree.

HTH

-- 
Ludovic Brenta.



  reply	other threads:[~2010-05-07 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 21:43 Ada-Python binding Maciej Sobczak
2010-05-07 22:24 ` Ludovic Brenta [this message]
2010-05-10  9:09   ` Cyrille
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox