#6391: libGAP! -- create a Cython library interface to gap
------------------------------------------------------------------------+---
Reporter: was |
Owner: was
Type: enhancement |
Status: needs_review
Priority: major |
Milestone: sage-4.7
Component: interfaces |
Keywords:
Author: Dima Pasechnik, Ivan Andrus, Volker Braun, William Stein |
Upstream: N/A
Reviewer: Dima Pasechnik, Ivan Andrus, Volker Braun, William Stein |
Merged:
Work_issues: |
------------------------------------------------------------------------+---
Comment(by vbraun):
Hi Dima,
Yes everything in `libgap.pyx` is doctested. I have't tried to replace gap
by libgap in the Sage library, first I want to see if the new spkg
compiles on all supported platforms. But p8 uses the standard autotools to
build the shared library, so I'm pretty confident.
There is a subdirectory `sage/libs/gap/test` that contains a small C
program for testing purposes just like what you want.
Getting garbage collection in Gap work to work correctly was one of the
major issues that I worked on over the week. For starters, Gasman has no
explicit reference counts. It is also compacting, so we must never hold
direct pointers into the memory. The way it works is that
1. `libgap.pyx` first creates a new Gap global variable
`libgap_owned_objects` and assigns an empty `rec()` to it.
1. Every Python `GapElement` adds is wrapped Gap object to
`libgap_owned_objects`.
1. The `GapElement.__dealloc__` removes the Gap object from
`libgap_owned_objects`. It is then no longer referenced inside Gap and
Gasman eventually recycles the object.
This is doctested in the `__dealloc__` documentation.
I haven't tried saving/loading Gap workspaces. But it doesn't make much
sense in libGAP since it would break the Python<->Gap object relations. If
you need to load a huge pre-evaluated Gap script then you probably don't
need libGAP, which is all about fast interaction with Gap.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6391#comment:61>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.