best practice: programming language & sage interaction

56 views
Skip to first unread message

Michael Wagner

unread,
Jan 27, 2021, 5:04:37 AM1/27/21
to sage-devel
Dear All,

What is the recommended way to use SageMath in for example Scala? 

At the moment I am using a python tcp socket, which I am running via the "sage -python name.py" command. It receives functions, casts them and calls "simplify_full()" on them.


(Context: the goal is a program, which can find relations between the generating functions of the sequences in the OEIS.)

In kind regards, 
Michael

Dima Pasechnik

unread,
Jan 27, 2021, 6:11:38 AM1/27/21
to sage-devel
On Wed, Jan 27, 2021 at 10:04 AM Michael Wagner
<michael.wag...@gmail.com> wrote:
> What is the recommended way to use SageMath in for example Scala?

Given that SageMath is just a Python library (the only Python
implementation supported is usual one, CPython, though), anything that
works for (C)Python should work for you.

HTH

>
> At the moment I am using a python tcp socket, which I am running via the "sage -python name.py" command. It receives functions, casts them and calls "simplify_full()" on them.
>
>
> (Context: the goal is a program, which can find relations between the generating functions of the sequences in the OEIS.)
>
> In kind regards,
> Michael
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/7b3ab63f-d16d-41d3-b922-085276ad6870n%40googlegroups.com.

Vincent Delecroix

unread,
Jan 27, 2021, 6:43:38 AM1/27/21
to sage-...@googlegroups.com
Dear Michael,

The SageMath software has a long startup time. "sage -python name.py" is
likely to be too slow. I would suggest that you use it in a more
interactive fashion. As Dima said, anything that works with CPython
will work here.

Though, if your goal is to find relations between the OEIS sequences
I would rather
* use Python directly (then Sage will be available)
* or write all in Scala (and ignore Sage)

Best
Vincent
Reply all
Reply to author
Forward
0 new messages