#20241: Separate Sage-specific components from generic C-interface in 
PariInstance
-------------------------------------+-------------------------------------
       Reporter:  defeo              |        Owner:
           Type:  PLEASE CHANGE      |       Status:  new
       Priority:  major              |    Milestone:  sage-7.2
      Component:  interfaces         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Luca De Feo        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/defeo/trac/u/defeo/pari_instance |  799f2555869086a4a302313545a9b74d8e5597e8
   Dependencies:  #20217             |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by defeo):

 * commit:   => 799f2555869086a4a302313545a9b74d8e5597e8
 * dependencies:   => #20217


Comment:

 I'm pushing a failed attempt at splitting `PariInstance` into a generic
 `PariInstance` cython type, and a Sage-specific `SagePariInstance`.

 This is problematic because of the global
 `sage.libs.pari.pari_instance.pari` variable: it is not clear where this
 variable should go.

 Some concrete suggestions: `PariInstance` serves three main purposes:

 - As a wrapper around the pari stack,
 - As a collection of conversion methods to and from pari types,
 - As a namespace for a handful of functions, for lack of a better place
 (e.g. `primes`, `genus2_reduction`, ...)

 Of these, only the first one really needs a Cython type. I suggest:

 - To make a proper abstraction `PariStack` around the pari stack. This
 should not be handled as a global variable, but rather as a singleton
 class (we cannot have more than one pari stack, because of global
 variables).
 - Move conversion functions to a separate namespace, as #20226 started
 doing.
 - Have `PariInstance` hold a pointer to a `PariStack`. Have `gen`'s hold a
 pointer to a `PariInstance`. (Maybe this double wrapping is superfluous?)

 I don't know quite well what to do with utility functions such as
 `primes`. They may stay as methods of `PariInstance`, or maybe go to a
 different namespace as pure functions (they should take a `PariInstance`
 or `PariStack` as parameter, then).
 ----
 Last 10 new commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=dce67fca49e515ce610539263e1e7a6f26c7bc69
 dce67fc]||{{{Move memory functions to cysignals}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=4bb8337295ed82c93d1a9c9f7173a4c36f97151d
 4bb8337]||{{{Rename sage_malloc -> sig_malloc and friends}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=5ab73c1c098478da766a061109a2a248d741e49e
 5ab73c1]||{{{Get rid of factorint_withproof_sage in PARI interface}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=c0ed97a0b2a036c3a4677d8e5dbabf6b2a6d54fc
 c0ed97a]||{{{Stop using deprecated PARI factoring features}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=edc5ce28655f157a13f27d2d94ae2e5d5d731bd6
 edc5ce2]||{{{Merge branch
 't/20205/get_rid_of_factorint_withproof_sage_in_pari_interface' into
 HEAD}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=5fb408dedb22e4147ee68ae5656e643b4f1df06c
 5fb408d]||{{{Replace pari_catch_sig_on by sig_on}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=d5c934c5164255e352cee9ddbc780d0759b6e185
 d5c934c]||{{{Deprecate PARI nth_prime and prime_list}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=d7d2d7df24760cdecf0d6585972d2bf6140c1123
 d7d2d7d]||{{{Remove redundant functions from pari_instance.pyx}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=282b1878dd25528debef017d13057b68c05b3b5b
 282b187]||{{{Failed attempt to split PariInstance}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=799f2555869086a4a302313545a9b74d8e5597e8
 799f255]||{{{Split pxd file too}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/20241#comment:2>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to