[GAP Forum] Interface with other languages

Alexander Konovalov alexander.konovalov at gmail.com
Fri Dec 10 11:42:38 GMT 2010


On 10 Dec 2010, at 09:06, Max Horn wrote:

> 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>

Note that this will not result in a C code which you can run stand-alone.

>> 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

In addition, Hebert, you may communicate with the GAP server provided by the SCSCP package [1] 
from another application using SCSCP protocol [2]. A client could be e.g. GAP SCSCP client [1]
or another SCSCP-compliant computer algebra system (e.g. MuPAD, via an extension package [3] or 
Macaulay2 [4] out-of-box). SCSCP has good C/C++ [5] and Java [6] APIs, which may be used for 
calls from C/C++/Java applications. Please let me know if you would be interested to go this way.

Best regards,
Alexander

[1] http://www.cs.st-andrews.ac.uk/~alexk/scscp.htm
[2] http://www.symbolic-computation.org/scscp
[3] http://mupad.symcomp.org/
[4] http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/SCSCP/html/index.html
[5] http://www.imcce.fr/Equipes/ASD/trip/scscp/
[6] http://java.symcomp.org/




More information about the Forum mailing list