zeromq might be a faster option than pexpect. That's what Jupyter is using for communication between the backend and the frontend.
On 15 March 2025 13:05:01 GMT-05:00, Waldek Hebisch <de...@fricas.org> wrote: >On Sat, Mar 15, 2025 at 12:33:40PM -0500, Dima Pasechnik wrote: >> On 15 March 2025 07:32:08 GMT-05:00, Qian Yun <oldk1...@gmail.com> wrote: >> >Hi Dima, >> > >> >About the FriCAS-SageMath interface, and about making >> >FriCAS a standard package in SageMath, could you open >> >a meta bug in GitHub to track the progress? >> > >> >I guess a better interface (C-based or socket-based, >> >more robust and performant than current text-based) >> >is needed. And SageMath needs to support "RootSum", >> >or the interface needs another way to translate >> >the "%%A1" algebraic numbers. >> > >> > >> >Hi Waldek, >> > >> >One of the FriCAS development goals is: >> >"make it easier for external programs to interface with FriCAS" >> > >> >Do you think communication via socket is a good idea, >> >> Currently SageMath communicates with FriCAS via a socket interface (pexpect). >> No files are written or read. > >The big deal is about converting representations. Parsing/unparsing >takes time and is tricky in many cases. Machine oriented representation >should be much faster to transmit/convert. > >When taking about speed one aspect is latency. Socket communication >involves system calls and unfortunately few years ago due to spectre >fixes effective latency of system call got significantly higher. >Function calls within the same process are much cheaper, but calls >between significantly different languages tends to be much more >expensive than calls within a single language. Another aspect >is throughput, that is speed of transmitting data. Here cost is >mainly due to volume and needed transformations. In particular >translation to textual forms tend to be more expensive. > >IIUC pexpect works at tty level, which is different from sockets. >Tty handling may significantly increase cost compared to files >(I do not know if this is significant factor in FriCAS interface). > -- 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 fricas-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/4FE5F627-8B89-4632-823D-3C6BC871F37F%40gmail.com.