On Thursday, August 18, 2016 at 12:59:39 PM UTC+1, Simon King wrote:
>
> Hi Dima, 
>
> On 2016-08-18, Dima Pasechnik <dim...@gmail.com <javascript:>> wrote: 
> >> Does a concept of "GAP packages" and "Singular packages" exist? If so, 
> >> you should follow recommendations for those kinds of packages to 
> install 
> >> your GAP/Singular code. 
> > 
> > With GAP it is problematic, as updating GAP wipes out installed GAP 
> > packages. 
> > Also there is a lot of boilerplate to produce for a GAP package, and I 
> > would not really recommend this, unless 
> > it's a separate piece useful with GAP alone. 
>
> It isn't useful with GAP alone, and also I wouldn't like to learn yet 
> another package ecosystem. The change from old- to new-style Sage 
> packages was painful enough for me. 
>
> > An alternative is to use libGAP factory function facility. 
> > This allows you to embed GAP code into py(x) files. 
> > E.g. 
> > 
> > sage: t=libgap.function_factory("""function(m) 
> > ....: local a,b; 
> > ....: a:=m^2; 
> > ....: return a-1; 
> > ....: end""") 
> > sage: t(5) 
> > 24 
>
> That can also be done in GAP instead of libGAP. But isn't it more 
> elegant to advise (lib)GAP to read functions from a file, rather than 
> to send the function definitions through (lib)GAP's interface? 
>

I did use libgap.function_factory in few places.
One advantage is that you can doctest a bit easier than with GAP code.
Anyway, I guess it depends upon  how much GAP code you have. If its hundreds
of lines it's probably nicer to put them into a file.
Not sure what's faster. Probably function_factory is faster than file I/O
(i.e. GAP's Read()).


> > With Singular, you might look at Normaliz package, that installs a 
> Singular 
> > "library", and do what they do. 
>
> Singular library functions are located in 
> SAGE_ROOT/local/share/singular/, and that's where both an old style and 
> a new style spkg are supposed to put stuff into --- unless one decides 
> to put the files under SageMath's version control. 
>
> Best regards, 
> Simon 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to