Simple syntax proposal: "not is"

I'm writing a source code editor that translates identifiers and keywords on-screen into a different natural language. This tool will do no transformations except at the reversible word level. There is one simple, avoidable case where this results in nonsense in many languages: "is not". I propose allowing "not is" as an acceptable alternative to "is not". Obviously English syntax has a deep influence on python syntax, and I would never propose deeper syntactical changes for natural-language-compatibility. This is a trivial change, one that is still easily parseable by an English-native mind (and IMO actually makes more sense logically, since it does not invite confusion with the nonsensical "is (not ...)"). The use-cases where you have to grep for "is not" are few, and the "(is not)|(not is)" pattern that would replace it is still pretty simple.

On Jan 25, 2008 9:13 AM, Jameson Chema Quinn <jquinn@cs.oberlin.edu> wrote:
-1. There should be one obvious way to do it. And honestly, if you're dealing with natural language, and your system is not able to change word order words between languages, you're in a lot of trouble already. STeVe -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy

Jameson "Chema" Quinn wrote:
Your editor is going to have to deal with code written the normal way anyway - given that this is a pretty special case, the special handling should stay in the tool that needs it (your editor) not in the programming language. As you say, Python is heavily influenced by English, and in English "a not is b" is out-and-out nonsense (there is no way to build a coherent parse tree with that word order), while "not a is b" and "a is not b" both make sense (although you are correct in pointing out that the latter is technically ambiguous as an English phrase). "is not" and "not in" are just normal binary operators that happen to consist of two words in the concrete syntax - your editor is going to need to be able to deal with that (even if that means having to handle translations that span multiple words). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org

On Jan 25, 2008 8:13 AM, Jameson Chema Quinn <jquinn@cs.oberlin.edu> wrote:
Sorry, but this use case just doesn't sound strong enough to change a programming language's grammar. While I promise you I will remain -1 on the proposal simply because it doesn't serve any programmer's goals, you've piqued my curiosity -- can you give an example of what your tool does? From your description I actually have no clue. -- --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
It not does sound like a very good idea to me. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/

"Jameson "Chema" Quinn" <jquinn@cs.oberlin.edu> wrote in message news:faf2c12b0801250813n5b0b38eepe71944b6016224db@mail.gmail.com... | I'm writing a source code editor that translates identifiers and keywords | on-screen into a different natural language. This tool will do no | transformations except at the reversible word level. There is one simple, | avoidable case where this results in nonsense in many languages: "is not". I | propose allowing "not is" as an acceptable alternative to "is not". I an rather sure that the tokenizer outputs "is not" as a single token. Otherwise 'a is not b' would likely be parsed as 'a is (not b)', which is something quit different. So your translater should recognize it as such also and output, for instance (en Espanol), 'no es'. | Obviously English syntax has a deep influence on python syntax, and I would | never propose deeper syntactical changes for natural-language-compatibility. | This is a trivial change, one that is still easily parseable by an | English-native mind (and IMO actually makes more sense logically, since it | does not invite confusion with the nonsensical "is (not ...)"). The | use-cases where you have to grep for "is not" are few, and the "(is | not)|(not is)" pattern that would replace it is still pretty simple. 'a not is b' is much worse in English than I believe 'a es no b' in Espanol. -1 tjr

On Jan 25, 2008 10:50 PM, Terry Reedy <tjreedy@udel.edu> wrote:
Sorry to burst your bubble, but 'is' and 'not' are two separate tokens; the grammar handles this by giving unary 'not' a priority lower than comparison operators.
This proposal not is going to happen... -- --Guido van Rossum (home page: http://www.python.org/~guido/)

On Jan 25, 2008 9:13 AM, Jameson Chema Quinn <jquinn@cs.oberlin.edu> wrote:
-1. There should be one obvious way to do it. And honestly, if you're dealing with natural language, and your system is not able to change word order words between languages, you're in a lot of trouble already. STeVe -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy

Jameson "Chema" Quinn wrote:
Your editor is going to have to deal with code written the normal way anyway - given that this is a pretty special case, the special handling should stay in the tool that needs it (your editor) not in the programming language. As you say, Python is heavily influenced by English, and in English "a not is b" is out-and-out nonsense (there is no way to build a coherent parse tree with that word order), while "not a is b" and "a is not b" both make sense (although you are correct in pointing out that the latter is technically ambiguous as an English phrase). "is not" and "not in" are just normal binary operators that happen to consist of two words in the concrete syntax - your editor is going to need to be able to deal with that (even if that means having to handle translations that span multiple words). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org

On Jan 25, 2008 8:13 AM, Jameson Chema Quinn <jquinn@cs.oberlin.edu> wrote:
Sorry, but this use case just doesn't sound strong enough to change a programming language's grammar. While I promise you I will remain -1 on the proposal simply because it doesn't serve any programmer's goals, you've piqued my curiosity -- can you give an example of what your tool does? From your description I actually have no clue. -- --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
It not does sound like a very good idea to me. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/

"Jameson "Chema" Quinn" <jquinn@cs.oberlin.edu> wrote in message news:faf2c12b0801250813n5b0b38eepe71944b6016224db@mail.gmail.com... | I'm writing a source code editor that translates identifiers and keywords | on-screen into a different natural language. This tool will do no | transformations except at the reversible word level. There is one simple, | avoidable case where this results in nonsense in many languages: "is not". I | propose allowing "not is" as an acceptable alternative to "is not". I an rather sure that the tokenizer outputs "is not" as a single token. Otherwise 'a is not b' would likely be parsed as 'a is (not b)', which is something quit different. So your translater should recognize it as such also and output, for instance (en Espanol), 'no es'. | Obviously English syntax has a deep influence on python syntax, and I would | never propose deeper syntactical changes for natural-language-compatibility. | This is a trivial change, one that is still easily parseable by an | English-native mind (and IMO actually makes more sense logically, since it | does not invite confusion with the nonsensical "is (not ...)"). The | use-cases where you have to grep for "is not" are few, and the "(is | not)|(not is)" pattern that would replace it is still pretty simple. 'a not is b' is much worse in English than I believe 'a es no b' in Espanol. -1 tjr

On Jan 25, 2008 10:50 PM, Terry Reedy <tjreedy@udel.edu> wrote:
Sorry to burst your bubble, but 'is' and 'not' are two separate tokens; the grammar handles this by giving unary 'not' a priority lower than comparison operators.
This proposal not is going to happen... -- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (7)
-
Collin Winter
-
Guido van Rossum
-
Jameson "Chema" Quinn
-
Nick Coghlan
-
Steve Holden
-
Steven Bethard
-
Terry Reedy