[GAP Forum] Interface with other languages

Max Horn max at quendi.de
Fri Dec 10 09:06:19 GMT 2010


Am 10.12.2010 um 02:36 schrieb Hebert Pérez-Rosés:

> Dear Forum,
> 
> As far as I know, there is no way to compile a GAP program into an exec
> file, right?

Yes there is (at least on UNIX type systems like Linux and Mac OS X; don't know about Windows): You can use "gac", the "GAP compiler", see section 3.7 of the GAP reference manual <http://www.gap-system.org/Manuals/doc/htm/ref/CHAP003.htm#SECT007>

> And I suppose you cannot call a GAP function from another
> language. Please correct me if I am wrong.

That depends on how you mean that. GAP does not offer a "direct" native interface which others can hook into to load GAP as, say, a (shared) library.
One can of course "interface" by launching a separate GAP process, and then send text commands to it, and trying to "parse" the output of GAP (a technique sometimes also referred to as "screen scrubbing"). The Sage "interface" Keshav described uses exactly this technique.


In addition, GAP can load dynamic modules (again, at least on UNIX type systems). I used that to implement some of the most time critical functions of a package I am working on in C, for a major speed boost.  So you could call other systems from within GAP


Hope that helps,
Max


More information about the Forum mailing list