Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #33485

Re: x === x

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: x === x
Date Thu, 01 Jun 2017 21:54:08 +0100
Organization A noiseless patient Spider
Lines 74
Message-ID <8737bjtonj.fsf@bsb.me.uk> (permalink)
References <JavaScript-20170530123255@ram.dialup.fu-berlin.de> <874lw231ui.fsf@bsb.me.uk> <context-20170530144535@ram.dialup.fu-berlin.de> <2872662.aeNJFYEL58@PointedEars.de> <87inkh28sf.fsf@bsb.me.uk> <19437984.EfDdHjke4D@PointedEars.de> <87efv4zr3k.fsf@bsb.me.uk> <2276977.Lt9SDvczpP@PointedEars.de> <87k24wy1pw.fsf@bsb.me.uk> <dab78138-0ac1-453d-b147-131b9892da04@googlegroups.com> <s4ovicpq2ied8sob9vgso7i68gdj1ar7pt@4ax.com> <1496e413-37d6-4ff2-ba03-09d853438559@googlegroups.com> <n5l0jctntopf9dkqpvb95m91jdqcon45jb@4ax.com> <semantics-20170601191801@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="b8cfcc8b3b6248419b3e2a0831823cf6"; logging-data="15906"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xDgEBx0SE/66ziASL05irVhNyGBwefrM="
Cancel-Lock sha1:LbgDymNW4nHzXNZ+q+WPgxgtd+s= sha1:Zqbf35W4Ehtf/9jSjo+7AO8TnVU=
X-BSB-Auth 1.68f72c49a6980255510f.20170601215408BST.8737bjtonj.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:33485

Show key headers only | View raw


ram@zedat.fu-berlin.de (Stefan Ram) writes:

> John G Harris <niam@jghnorth.org.uk.invalid> writes:
>>It seems I have to say it again :
>>Some ignorant people think that if it isn't in BNF then it isn't a
>>syntax rule. They are wrong.
>
>   Depending on the definition of »syntax rule«, you might
>   be right with this.

Most languages have two grammars -- a simple grammar for tokens (it is
often "regular" in the technical sense) and a more complex grammar of
tokens that describes the syntax of the larger units -- programs in
effect.

ECMAScript is one of these.  The semicolon insertion rules operate at
the lexical level.  The tokens seen by the parser will, logically,
already include any added semicolons.

Finally, ECMAscript also has lookahead conditions that direct the
parse.  These are a convenience (just like its labeled EBNF) that means
the EBNF rules can be much shorter.

There may also be rules that are written out only in English.  C and C++
have these, and ECMAScript /might/ have -- I've not checked the whole
document.

All of these contribute to "the syntax".

>>That's why the behaviour of newline after 'return' isn't an ambiguity.
>
>   But the behavior clearly is part of the semantics 
>   (not of the syntax) of a programming language.
>
>   (Also, I am not aware of a definition of »ambiguity«
>   in this thread. When does one say that a behavior is
>   an ambiguity? [intended as a rhetorical question - 
>   so it would not be considered impolite by me if you
>   do not respond to it.])

No, that is a problem.  I'd like to see examples because that would help
clarify what people mean, both by "the syntax" and "ambiguous".
Obviously no serious programming language has an ambiguous syntax when
all the parts above are considered.

None the less it's not unreasonable to say that C's grammar (note the
term) is ambiguous, because

  x(y);

could be a function call or declaration if f is a typedef name.  The
EBNF grammar is not enough to resolve the ambiguity.

>   By your spelling of »behavior« you seem to indicate
>   that you might come from England. I used to believe
>   that englishmen always try to be extraordinarily
>   courteous. In this case the following hint might help:
>
>   The paragraph 
>
>       »Some ignorant people think that if it isn't in 
>       BNF then it isn't a syntax rule. They are wrong.«
>
>   can be reworded (removing "ignorant people") as
>
>       »Not all syntax rules are expressed in BNF.«

True.  I suspect John G Harris is simply fed up with Julio Di Egidio
habit of spinning off into abuse at the first sign of disagreement.  I
try to remain civil, but that in itself probably comes over as rude
since it can appear to be passive-aggressive.

-- 
Ben.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-30 14:34 +0100
  Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-30 15:02 +0100
  Re: x === x Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-30 16:22 +0200
    Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-31 01:02 +0100
      Re: x === x Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-31 12:39 +0200
        Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-31 21:52 +0100
          Re: x === x Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-31 23:39 +0200
            Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-01 01:46 +0100
              Re: x === x Julio Di Egidio <julio@diegidio.name> - 2017-06-01 00:14 -0700
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-01 10:39 +0100
                Re: x === x Julio Di Egidio <julio@diegidio.name> - 2017-06-01 03:37 -0700
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-01 18:54 +0100
                Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-01 21:54 +0100
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-02 11:06 +0100
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-02 11:08 +0100
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-02 10:56 +0100
                Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-04 12:50 +0100
                Re: x === x John G Harris <niam@jghnorth.org.uk.invalid> - 2017-06-04 14:30 +0100
                Re: x === x Dr J R Stockton <J.R.Stockton@physics.org> - 2017-06-04 09:03 -0700
                Re: x === x Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-01 14:45 +0100
                Re: x === x Julio Di Egidio <julio@diegidio.name> - 2017-06-01 07:00 -0700
        Re: x === x Julio Di Egidio <julio@diegidio.name> - 2017-06-01 00:00 -0700

csiph-web