Chris Newman <Chris(_dot_)Newman(_at_)innosoft(_dot_)com> writes:
Yes. There should be a single canonical format for scripts so they can be
communicated from client to server without ambiguity.
It's an interesting idea.
Currently, CR and LF are treated as "whitespace" - if they're
present, they're only there *solely* for readability and comment
termination. Your viewer could rewrap the lines and comments and come
up with something you could edit on any given platform.
Why not go further?
For instance, should people use tabs or spaces for indentation? Or
a combination? Should indentation be meaningful (if you don't think
so, look at the Python addicts in the CS community - I think they're
wrong, but they have some good points)?
Maybe we should have one true indentation style - one tab per level,
no spaces. Let the editor set tab stops where it wants...
How about line length limits? If we really want scripts to be
editable by all sorts of non-specialized editors, maybe we should
suggest (or impose) an 80-column limit on lines...
Just some ideas - I'm far from wedded to any of these, but I think
they make about as much sense as requiring that lines end with CRLFs.
(I'd argue that if we *really* want a single canonical format, we
should think about what a abstract syntax tree for a program in this
language should look like, write up the canonical way of encoding
those trees as text, and require that all programs be in that form
when returned from the server (since we're worried about
interchangeability, servers should be strict in what they send and
forgiving in what they accept, right? Or should it be strict on both
ends?). Permitting things like "one or more spaces" inbetween tokens
hardly leads to a single canonical form... (interestingly enough, the
grammar currently says that WSP is exactly one whitespace; I suspect
this will be changed :-) )