[Python-ideas] Statements vs Expressions... why?

Guido van Rossum guido at python.org
Fri Sep 12 06:36:40 CEST 2008

On Thu, Sep 11, 2008 at 9:08 PM, Cliff Wells <cliff at develix.com> wrote:
> On Thu, 2008-09-11 at 18:38 -0700, Guido van Rossum wrote:
>> Hey Cliff,
>> I think the only way to move forward in this discussion is if you
>> could write a complete parser for the variant of Python that you'd
>> like to see.
> As I've pointed out, this has already been done (although the project
> appears dead):
> http://www.livelogix.net/logix/index.html
> http://www.livelogix.net/logix/tutorial/3-Introduction-For-Python-Folks.html
> Logix is actually much more than a Python interpreter, but that's
> tangential to this discussion.  Logix also conveniently runs on the
> Python VM.  It also removes the distinction between statements and
> expressions and is nearly code-compatible with Python (it has two
> significant shortcomings and two minor ones, none of which have to do
> with the topic at hand).
> http://www.livelogix.net/logix/tutorial/3-Introduction-For-Python-Folks.html
>> I expect that you'll say "but I don't know enough about parser
>> technology to do so" -- but then my response is "then you don't know
>> to understand the difficulty of the task, so shut up."
>> If you want to continue this discussion you'll have to
>> prove that it is possible.
> Or I can continue to say what I like and you can choose to ignore it.  I
> obviously believe it's a worthwhile discussion and certainly enjoy the
> debate, but anyone who doesn't is best served by not joining it.  I
> don't recall bringing this to python-dev as a serious proposal nor
> submitting it as a PEP, so I think an informal exchange of ideas without
> spending six months on a functional prototype is perfectly acceptable.
> That aside, it's already been proven that the syntax and concept is
> plausible in Logix.  Whether or not it could be implemented in CPython
> is another matter, and whether or not the result would be accepted is
> yet a another matter.
>> That in turn will force you to think about many of the details that
>> you're currently brushing away as irrelevant -- and you'll find that
>> they are actually highly relevant.
> I'm not brushing them away as irrelevant, I'm setting them aside until
> it's decided that it's even worth pursuing.  I don't know about you, but
> I don't bother arguing with my wife about the color of a new cars until
> we're certain we need to buy one.
> I certainly agree that if I decided to move this beyond idle discussion
> that a prototype would be a critical aspect and I fully expect there
> would be many issues to be overcome.  I don't believe such a change
> would be simple, but neither do I believe it's insurmountable.

Well, if you are asking for my personal opinion about the viability of
this idea, I think it's not viable, but would like to be proven wrong
(or right!) just so that this topic can be put to bed for good. I'm
not swayed by the existence of Logix; it appears to be using a
completely different way of interpreting whitespace, which seems
incompatible with current Python, but they don't seem to give the
exact rules, only some hints. Have you used it?

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-ideas mailing list