On Thu, 11 Jan 2018, Berkeley Churchill wrote:
I'll look into using a pipe, that's a good suggestion and might be easier than the embedded interpreter.
There are many ways to do this. Sage could read a pipe and write to files, another program could busy-wait to see for a file with given name to apper (of course Sage should first write to temporary file and then rename it). Or instead of busy-wait loop Sage could write to pipe when it's done. Also inotify is one possible solution.
In any case, after you get rid of the startup time I suppose the next slowest part is converting data structures between Python and C.
-- Jori Mäntysalo