Using non-ascii symbols
bokr at oz.net
Wed Jan 25 12:28:18 CET 2006
On Tue, 24 Jan 2006 04:09:00 +0100, Christoph Zwerschke <cito at online.de> wrote:
>On the page http://wiki.python.org/moin/Python3%2e0Suggestions
>I noticed an interesting suggestion:
>"These operators â¤ â¥ â should be added to the language having the
> <= >= !=
>this should improve readibility (and make language more accessible to
>This should be an evolution similar to the digraphe and trigraph
>(digramme et trigramme) from C and C++ languages."
>How do people on this group feel about this suggestion?
>The symbols above are not even latin-1, you need utf-8.
Maybe we need a Python unisource type which is abstract like unicode,
and through encoding can be rendered various ways. Of course it would have
internal representation in some encoding, probably utf-16le, but glyphs
for operators and such would be normalized, and then could be rendered
as multi-glyphs or special characters however desired. This means that
unisource would not just be an encoding resulting from decoding just
a character encoding like latin-1, but would be a result of decoding
source in a Python-syntax-sensitive way, differentiating between <=
as a relational operator vs '<=' in a string literal or comment etc.
>(There are not many usefuls symbols in latin-1. Maybe one could use Ã
>for cartesian products...)
>And while they are better readable, they are not better typable (at
>least with most current editors).
>Is this idea absurd or will one day our children think that restricting
>to 7-bit ascii was absurd?
I think it's important to have readable ascii representations available for
programming elements at least.
>Are there similar attempts in other languages? I can only think of APL,
>but that was a long time ago.
>Once you open your mind for using non-ascii symbols, I'm sure one can
>find a bunch of useful applications. Variable names could be allowed to
>be non-ascii, as in XML. Think class names in Arabian... Or you could
>use Greek letters if you run out of one-letter variable names, just as
>Mathematicians do. Would this be desirable or rather a horror scenario?
I think there are pros and cons. What if the "href" in HTML could be spelled in
any characters? I.e., some things are part of a standard encoding and representation
system. Some of python is like that. "True" should not be spelled "Vrai" or "Sant," except
in localized messages, IMO, unless perhaps there is a unisource type that normalizes
these things too, and can render in localized formats. ... I guess China is a
pretty big market, so I wonder what they will do.
Someone has to get really excited about it, and have the expertise or willingness
to slog their way to expertise, and the persistence to get something done. And all
that in the face of the fact that much of the problem will be engineering consensus,
not engineering technical solutions. So are you excited? Good luck ;-)
Probably the best anyone with any excitement to spare could do is ask Martin
what he could use help with, if anything. He'd probably not like muddying any
existing clear visions and plans with impractical ramblings though ;-)
More information about the Python-list