[IPython-dev] From the sage list: thinking about our messaging protocol

Fernando Perez fperez.net at gmail.com
Wed Dec 14 15:57:27 EST 2011


Hi folks,

this conversation started on the sage-dev list, but I'm moving part of
it over here b/c it's really about our messaging protocol...

It would be great if ultimately we have a set of protocol tests that
validate our spec, as others are beginning to rely on the spec and
it's pretty easy to drift if we have no tests telling us what is meant
to stay.  That doesn't mean we can never tweak the spec as we better
understand certain cases, but we'll do it explicitly and not by
accidental code drift.

Cheers,

f
---------- Forwarded message ----------
From: Jason Grout <jason-sage at creativetrax.com>
Date: Wed, Dec 14, 2011 at 12:43 PM
Subject: [sage-devel] Re: Questions about the single-cell server
To: sage-devel at googlegroups.com


On 12/14/11 1:57 PM, Fernando Perez wrote:
>
> At this point we have a spec in the document you
> pointed to, but precious little in the way of independent compliance
> testing, so there's a real danger of the actual implementation
> diverging from the specification simply by accident.



Already I see it's changed from what we implemented.  For example,
your header now contains the msg_type, and the top-level contains the
msg_id, duplicating both pieces of information.  To me, it makes sense
to keep things the way they were (msg_id in header, msg_type at the
top-level), and don't duplicate the information.  This minimizes the
information that has to go back and forth (no need to send back the
msg_type in the parent_header, since the client could just store it,
though I suppose the argument could be made that msg_type really does
belong in the header).

What if the msg_id or msg_type between the header and the top-level is
inconsistent?  Which takes precedence? I presume that the header
information takes precedence, but since the top-level fields are for
convenience, my guess is that in practice, the top-level fields take
precedence, since if you have to compare the top-level fields with the
header fields, you might as well just use the header fields.

A very simple wrapper function on the receiving end can add the
convenience fields if they really need to be at the top-level, and
that would guarantee consistency.

Feel free to CC this message over to the ipython list if you want to
take up the discussion there.

Thanks,

Jason


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



More information about the IPython-dev mailing list