[GAP Forum] Communicating with GAP in C++

Christopher Jefferson caj21 at st-andrews.ac.uk
Mon Apr 20 09:18:49 BST 2015


There are a number of options available to you, of varying levels of
quality, efficiency, and ease of use.

The pipe/fifo option is not really GAP-specific, you can make a named FIFO
and then read and write it from most programs, including GAP. Go and read
a general guide on named pipes.

You could use this option with the the json package (
https://github.com/gap-system/json ), to give you a well-formed data
structure to send / receive.

Another alternative is SCSCP, which sends XML over network sockets. I have
used this, it does require using an XML parser, which is fairly heavy
duty, and is a little slow (this would only matter if you are sending many
very small requests, it is only the communication itself which is slow).

I have an example library for using SCSCP from C++ here:

https://bitbucket.org/ChrisJefferson/miniscscp


This library is very minimal, but will hopefully give you guidance on how
to make SCSCP work.

The final option, which is by far the hardest (but I mention it as an
option) is to integrate your C++ code as a GAP kernel extension. If you
want more details about how to do this I'm happy to provide them, but I
warn you it is much harder than the other options!

Chris

On 19/04/2015 17:25, "Jonathan Gryak" <gryakj at gmail.com> wrote:

>Hello,
>According to the FAQ:
>
>> What you can do is to run GAP in a child process and communicate with it
>> using pipes, pseudo-ttys, UNIX FIFOs or some similar device. We have
>>done
>> this successfully in a number of projects, and you can contact the
>>support
>> list for more detailed advice if you want to go down this route.
>
>
>Unfortunately I can't seem to find any documentation or post in the Forum
>or elsewhere which shows this process. Any suggestions?
>
>Thanks in advance.
>Jonathan
>_______________________________________________
>Forum mailing list
>Forum at mail.gap-system.org
>http://mail.gap-system.org/mailman/listinfo/forum




More information about the Forum mailing list