On 8/15/07, William Stein <[EMAIL PROTECTED]> wrote: > ... > Maxima should never ever fail due to communication between SAGE and > Maxima. I spent a lot of time making sure of that a few months ago, when > we were rolling out the calculus functionality, which uses the maxima > interface > very very heavily. > When you doctest the SAGE_ROOT/devel/sage/sage/calculus directory, there > are literally hundreds of different and subtle interactions between SAGE and > maxima via the interface -- some involving expecting interactive questions > about input, etc., and it all happens very very quickly, but it works > perfectly > every time now.
Wonderful. > It just took a lot of work refining how the maxima interface works -- > it resynchronizes itself before every interaction by putting > "random number + 1" in the input and waits for the result of that > arithmetic, etc. I'm sure the axiom interface could do something > similar. Yes, I saw your new resynchronization code in 'maxima.py' and I was **amazed** ! :-) It seems to me that you have gone to heroic lengths to ensure that there is a way to recover from these sort of communications problems. (At least Axiom never tries to ask the console user a question!) I would be very interested to know how often communications with Maxima have to be resynchronized during an intensive interaction. If the need for resynchronization is occurring often even when Maxima is not asking questions, and *if* this is due to readline/pexpect interactioin - as I am now sure it is in the case of Axiom - then it seems to me that preventing communications problems in the first place and eliminating the (possible) spurious need for resynchronization might make things more efficient. I was thinking about how to do this resynchronization in 'axiom.py' but then I realized that in my tests this was actually happening because pexpect was (sometimes) returning a matched prompt string in 'expect.after' even though the contents of 'expect.before' did not contain the complete output that leads up to that prompt and then it would return the same buffer a second (and sometimes third) time, each time a little more complete before. As a result the communications get out of sync. This problem entirely disappears when I rebuild with readline disabled. Maybe it is a bug in pexpect. But as you implied, these problems seem to be exceeding difficult to debug. It is easier to work around them. I think that to really do this right we need better syntactical markup in the Axiom output like is possible in Maxima. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---