On Mon, Nov 22, 2010 at 9:00 AM, Simon King <simon.k...@uni-jena.de> wrote:
> Hi Alex and Michael!
>
> On 22 Nov., 14:40, Michael Brickenstein <brickenst...@mfo.de> wrote:
>> Am 22.11.2010 um 14:12 schrieb Alex Leone:
>>
>> > for reference: I'm running Ubuntu 10.10 on a quad core, 2.6.35-22-generic
>>
>> ...
>> > 2. There's nothing wrong with the singular interface.
>
> The commands
> a=gap(1)
> a=gap(2)
> require to wait for a Gap prompt twice.
>
> The commands
> a=singular(1)
> a=singular(2)
> require to wait for a Singular prompt five times.
>
> So, there *is* something wrong with the Singular interface: The
> overhead is considerably more than with the other interfaces!
>
> And I do believe that this is worth a ticket (I think it is the last
> of the three tickets that I opened for this thread).
>
>> > 3.  Possible fix: for singular and gap (and anything else that doesn't 
>> > need a full tty, ie doesn't use fancy screen stuff like top), perhaps we 
>> > should use subprocess.Popen(... stdout=PIPE, stdin=PIPE, stderr=PIPE) and 
>> > then communicate through the pipes.  There shouldn't be any latency.  I'm 
>> > currently modifying pexpect to do this and will report my findings.
>
> Would this be possible without too much effort? This sounds great!
>
> But the Singular interface having more overhead than other interfaces
> is orthogonal to the "pexpect vs. pipes" issue.
>
>> For Singular, there exists the libsingular interface.
>> I would appreciate every help making it the perfect Singular interface, 
>> instead of optimizing
>> the generic pexpect interface.
>
> 1. Sage uses some pexpect interfaces that can not be replaced by C API
> right now, and some will never be replacable by a C API: Maxima and
> GAP belong to the first category IIRC; Maple, Magma and other
> interfaces belong to the second category (unless Magma changes to
> GPL...)
>
> So, optimizing the generic pexpect interface, as suggested by Alex, is
> a *very* interesting  project.
>
> 2. IMHO, making libsingular "the perfect Singular interface" would
> include to re-write any Sage code that currently relies on the pexpect
> interface. And this would certainly be a lot of stuff to re-write.

That's not clear to me.  Maybe the full singular command prompt could
be used via a library interface?  After all, it is just a C++ program.
    The C interface to GAP that I wrote just involves rewriting the
GAP read-eval-print loop (the command line interface) and turning it
into C library calls.  I literally just stick some data in where the
read would put it, then tell GAP that it just read something in, so go
evaluate it, etc.   I mentioned this to Martin Albrecht (author of
libsingular), and he said it would be more difficult to do that with
Singular.  But that doesn't mean it is impossible.  It might be better
to write something like this and not change any of Sage, than to have
to rewrite a lot of Sage.

 -- William

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to