> Dima Pasechnik wrote:
> ...
>> running Maxima in ECL,
>> which is embedded in Python; for the latter the code is in
>> src/sage/libs/ecl.pyx
>>
>> In the latter one sees an example of calling CL functions from Sage:
>>
>>         sage: from sage.libs.ecl import *
>>         sage: ecl_eval("(defun fibo (n)(cond((= n 0) 0)((= n 1) 1)(T (+
>> (fibo (- n 1)) (fibo (- n 2))))))")
>>         <ECL: FIBO>
>>         sage: ecl_eval("(mapcar 'fibo '(1 2 3 4 5 6 7))")
>>         <ECL: (1 1 2 3 5 8 13)>
>>
>> That is, one would just need to adapt src/sage/interfaces/maxima_lib.py to
>> loading/running FriCAS instead.
>> For this one needs to know some parts of FriCAS, that is, how to load it in
>> a running CL instance, etc etc...


On 13 August 2016 at 07:08, Waldek Hebisch <[email protected]> wrote:
>
> With the following patch applied to FriCAS trunk:
> ...
> I can use the following to produce fricas as shared library:
> ...

That is excellent.

> Once FriCAS shared library is created in ECL you can do:
>
> (load "src/interp/fricas_lib.fas")
> (in-package "BOOT")
> (fricas-init)
>
> and then use FriCAS functions.  Presumably in Sage it will look
> like:
>
> ecl_eval("(load \"src/interp/fricas_lib.fas\")")
> ecl_eval("(in-package \"BOOT\")")
> ecl_eval("(fricas-init)")
>

What is the best way to interact with FriCAS once the shared library
is loaded and FriCAS in initialized?  For example, what would be
required to call FriCAS with a command string from Python and return
the result as a string?

I think that the gains from running FriCAS as a library will out
weight the difference in performance between ECL and SBCL for most
Sage users.

Bill Page.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" 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/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to