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


Groups > comp.lang.javascript > #26801 > unrolled thread

Re: Definition of a script in JavaScript

Started byDenis McMahon <denismfmcmahon@gmail.com>
First post2015-02-04 22:39 +0000
Last post2015-02-05 17:47 +0100
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Definition of a script in JavaScript Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-04 22:39 +0000
    Re: Definition of a script in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-05 17:40 +0100
      Re: Definition of a script in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-05 17:47 +0100

#26801 — Re: Definition of a script in JavaScript

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2015-02-04 22:39 +0000
SubjectRe: Definition of a script in JavaScript
Message-ID<mau73u$dd9$1@dont-email.me>
On Wed, 04 Feb 2015 19:36:08 +0000, Stefan Ram wrote:

>   Where does the MDN give the syntax for what one can write in the file
>   »javascript.js«?

Perhaps this is the page you are looking for?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
Lexical_grammar

Or maybe this one is:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
Statements

Also see: http://www.w3.org/standards/webdesign/script.html

"What is scripting?

A script is program code that doesn’t need pre-processing (e.g. 
compiling) before being run. In the context of a Web browser, scripting 
usually refers to program code written in JavaScript that is executed by 
the browser when a page is downloaded, or in response to an event 
triggered by the user."

In the normal sense, "program code" is generally expected to conform to 
some syntax specified for the computer language it is written in. In the 
case of Javascript, to paraphrase W3C:

"The most common scripting language ECMAscript (more widely known as 
JavaScript) which is developed by Ecma."

So whether you like it or not, your journey probably ends at the 
ECMAScript language specification.

http://www.ecma-international.org/publications/standards/Ecma-262.htm

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [next] | [standalone]


#26802

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-02-05 17:40 +0100
Message-ID<3245202.Gazq5g0FQ0@PointedEars.de>
In reply to#26801
Denis McMahon wrote:

> On Wed, 04 Feb 2015 19:36:08 +0000, Stefan Ram wrote:
>>   Where does the MDN give the syntax for what one can write in the file
>>   »javascript.js«?
> 
> Perhaps this is the page you are looking for?
> 
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
> Lexical_grammar

Doubtful, since the *syntactical* grammar was sought after.

> Or maybe this one is:
> 
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
> Statements

Closer, but still not a grammar as in the Specification, unfortunately.
It should not be too difficult to use the grammars in the Specification
as template for a (Mozilla) JavaScript grammar.

> [W3C definition of “script”]
> In the normal sense, "program code" is generally expected to conform to
> some syntax specified for the computer language it is written in. In the
> case of Javascript, to paraphrase W3C:

There is no “Javascript”.

> "The most common scripting language ECMAscript (more widely known as
> JavaScript) which is developed by Ecma."

Except for “ECMAscript”, that statement is correct.  The ECMAScript Language 
Specification (all Editions) also includes a definition for “scripting 
language”.  I have quoted and cited it in the ECMAScript Support Matrix and 
in my thesis (see sig).  A script then is a computer program written in a 
scripting language.

> So whether you like it or not, your journey probably ends at the
> ECMAScript language specification.

It is just beginning there, and so is yours, since you are still talking 
about your “Javascript” fantasy.  The ECMAScript Language Specification 
makes it clear that and how conforming implementations are allowed to differ 
from one another.  Once one has accepted that basic fact, one can readily 
observe the differences between implementations, making it foolish to use 
one term *other* than “ECMAScript implementations” for all those 
implementations.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#26803

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-02-05 17:47 +0100
Message-ID<1691354.mRLztSKfvQ@PointedEars.de>
In reply to#26802
Thomas 'PointedEars' Lahn wrote:

> Denis McMahon wrote:
>> "The most common scripting language ECMAscript (more widely known as
>> JavaScript) which is developed by Ecma."
> 
> Except for “ECMAscript”, that statement is correct.

Ah well, I was too fast.  No, it is not correct at all.  In fact, most 
people talking about JavaScript are not even aware that it is neither the 
name of only one programming language nor that the programming languages in 
question are implementations of ECMAScript.  And certainly ECMAScript and 
JavaScript are not the same, as this so-called “paraphrased” statement 
suggests.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web