On 10/17/24 8:24 AM, Qian Yun wrote:
On 10/16/24 11:49 PM, Waldek Hebisch wrote:
Functions handling those streams need to be changes so that they
perform formatting without using Lisp stream functions. Then we
can redirect result to use sockets.
The "direct stream to socket" puzzled me.
Now looks like we should use "socket-stream", which is not a part
of CL standard, we may need to use external Lisp library like
usocket. We will not use the sock_send/get_Int/String
FFI C functions on the Lisp side.
To clarify things up:
1. Currently we have stuff like "(PRINC STR *standard-output*)".
2. The above propose is like "(PRINC STR *spad-output*)" where
*spad-output* is bound to a socket-stream and can be switched
at runtime.
3. The following propose uses "(SPRINC STR *spad-output*)",
where SPRINC can do ")spool", and use FFI to print to
*spad-output*, which might be a socket file descriptor.
The usocket Lisp library does not support unix domian socket,
also this higher abstraction differs from our current idiom.
I plan to use the FFI for C functions instead. (Add new
wrappers for "select", "accept", etc.)
Very preliminary tests show that this approach is workable.
Also with this redesigned architecture, it would be very
easy for SageMath to communicate with FriCAS through socket.
This method should be more stable and support more Lisps
than the call-lisp-from-c method.
- Qian
Now the architecture looks like this:
FRICASsys opens SpadServer, many spadclients can connect to it,
for each client, FRICASsys creates a socket-stream for it,
for the active client, we assign its socket-stream to *spad-stream*,
so that output goes via socket automatically.
- Qian
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/ace1d2e5-ab5c-48de-b813-430b3d8da8b5%40gmail.com.