EMCA script and JavaScript

This is a discussion on EMCA script and JavaScript within the General Discussions forums, part of the Community Boards category; What is the difference between EMCA script and JavaScript? I know JavaScript is a dialect of EMCA but is it ...

  1. #1
    The Registered User Aparavoid's Avatar
    Join Date
    May 2009
    Posts
    74

    EMCA script and JavaScript

    What is the difference between EMCA script and JavaScript? I know JavaScript is a dialect of EMCA but is it still the same languages or no?

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    Javascript is a dialect of ECMAScript. There are many other dialects, like ActionScript, JScript. All slightly different.

  3. #3
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Also C#, I believe. ECMAScript is a specification that deals with things like E4X expressions for working with XML, other language constructs, etc... It's not really a complete language, but all these languages implement that specification.

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Aparavoid View Post
    What is the difference between EMCA script and JavaScript? I know JavaScript is a dialect of EMCA but is it still the same languages or no?
    ECMAScript was (an) early name for javascript. When Sun got involved, they wanted the name Javascript in order to associate it with Java, altho developmentally they had nothing to do with one another (perhaps Sun was too slightly too ambitious about the role Java was to play on the web -- Java would be the server-side*, javascript would be client-side). I believe at various points it time there has been some intention to drop the name and revert to ECMAScript exclusively, but this has never happened.

    The other "dialects" are intentionally based on javascript so I guess the specification can now be used as an umbrella term for a number of things, but some documentation will still explicitly refer to ECMAScript as synonymous for javascript and AFAICT that is a very common use of the term (as a synonym for js).

    * which it often is but not to same same degree that js "dominates" client-side
    Last edited by MK27; 08-11-2009 at 04:48 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    No, ECMAScript isn't old name for JavaScript. JavaScript's old name is LiveScript and if I recall correctly there was one name before that. Name JavaScript came from some sort of Netscape and Sun's marketing deal. ECMAScript is name of standardised version of JavaScript. If you're smart enough, you already guessed that the standard was released by Ecma International.

    Wait, did sean just say C# is some sort of scripting language based on JavaScript?

  6. #6
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Quote Originally Posted by MK27
    ECMAScript was (an) early name for javascript.
    No - that was indeed LiveScript

    Quote Originally Posted by Wikipedia
    JavaScript was originally developed by Brendan Eich of Netscape under the name Mocha, which was later renamed to LiveScript, and finally to JavaScript.
    Wait, did sean just say C# is some sort of scripting language based on JavaScript?
    No. C# uses many aspects of ECMA-262 (ECMAScript), but has now become it's own separate specfication (ECMA-334). And to be completely clear, ECMA-262 doesn't require that languages be SCRIPTING languages. Flex/ActionScript, for instance is compiled into it's own version of byte code as part of a SWF..

    ECMAScript - Wikipedia, the free encyclopedia

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    Well, I still think your previous post can be understood as C# being dialect of JavaScript.

    Could you point some things where C# was influenced by JavaScript or ECMAScript or what ever? I wouldn't count JavaScript in list of languages that influenced C#. I would say these languages have been influenced by same languages which caused similarities but feel free to point I'm wrong.

  8. #8
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Well, I still think your previous post can be understood as C# being dialect of JavaScript.
    Absolutely not. Cyberfish stated several languages that were dialects of ECMAScript, and I said, "Also C#, I believe". That means I was saying C# is a dialect of ECMAScript. ECMAScript and JavaScript are not the same thing - ECMAScript is merely a specification for certain expressions and language constructs, that has been implemented in, among other languages, JavaScript.

    As I explained in detail in my last post, it's my understanding that C# has been strongly influenced by ECMA-262 (NOT JavaScript) in it's expressions and work with XML/DOM. It is not strictly a dialect of ECMA-262 (I have a feeling it once was, but I can't find that reference), as it ended up becoming it's own Standard (ECMA-334). The use of "Script" in the nickname for ECMA-262 has no implication that the implementers make scripting languages, or use other implementations as influences. If you look at the Wikipedia articles I provided you'll see how much variation can occur in languages that implement the same version of ECMA-262.

    edit:

    I would say these languages have been influenced by same languages which caused similarities but feel free to point I'm wrong.
    If you're referring to the commonality between languages that use a C-style syntax, that was pioneered by Algol. And I would then assume you're referring to the use of parentheses for operands, using curly braces around blocks of code, etc... I'm not even sure ECMA-262 deals with those aspects of the language. I haven't read every page, but have a look through the document, and you'll see that almost all of it deals with methods of specifying data types, expressions, data literals, etc...
    http://www.ecma-international.org/pu...T/ECMA-262.pdf
    It's operators and much of it's syntax isn't original - it serves primarily as a specification for people to work off of to standardize the way people express things, even in different languages.

  9. #9
    Registered User
    Join Date
    Jul 2007
    Posts
    131

    Cool

    Well, in fact the standard says:
    This Standard defines the ECMAScript scripting language.
    And if you skim through the syntax it defines, you will see things like:
    Code:
    Block:
        { StatementList[opt] }

  10. #10
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    This Standard defines the ECMAScript scripting language.
    In any case - ActionScript is as much a scripting language as Java is. So if you recognize that as an official derivitive, then my statement about C#'s influences is hardly calling it a "scripting language based on JavaScript".

    Code:
    Block:
        { StatementList[opt] }
    Ah - then I stand corrected on that. Still, however, I think you're missing my point. My point is not that the fine people who make JavaScript said, "hey - there's this language called ECMAScript - let's copy it!". And the fine people at Adobe said, "hey - there's this language called ECMAScript - let's copy it!" ECMAScript defines certain conventions that are used in expressions. That standard have an enormous influence on JavaScript and ActionScript (and other languages), which are quite different to eachother once you get down to implemtnation details. C# also received some influence, though it has since drifted and become it's own standard.

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,535
    A personal note:

    I find the idea of an ECMAScript dialect somewhat erroneous. I know of no scripting language named ECMAScript. 4. Overview of the above specification reads:

    ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the computational environment of an ECMAScript program will provide not only the objects and other facilities described in this specification but also certain environment-specific host objects, whose description and behaviour are beyond the scope of this specification except to indicate that they may provide certain properties that can be accessed and certain functions that can be called from an ECMAScript program.
    The missing specification are dealt with by compliant scripting languages. ECMAScript, as is, is not a scripting programming language to my knowledge. Only a specification. JavaScript, JScript, ActionScript, etc, are no more ECMAScript dialects as Visual C++ is a dialect of the ISO IEC-14882-2003.

    I'm not a fan of this "ECMAScript dialects" choice of words. But I do see it everywhere.

    EDIT: Oh, and BTW, because of the above point, ECMAScript can indeed originate (support the design of) a fully compliant non-scripting compiled or dynamic programming language. At least that's how I read it.
    Last edited by Mario F.; 08-11-2009 at 11:48 AM.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #12
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    The quote from standard stating it defines scripting language wasn't meant to state that every dialect of ECMAScript must be and every dialect is a scripting language, it was attempt to show that you weren't completely right when you said that the standard doesn't define scripting language but some rules. I agree - the standard doesn't define a completely useful language but building blocks for writers of other languages, but the thing isn't fully like you wrote.

    Well, if you look at the beginning of standard, you'll notice short text titled "Brief history". According to the text things went like this: JavaScript -> JScript -> standard -> JavaScript, JScript and lots of other languages based on the standard, not standard -> JavaScript, JScript and lots of other languages based on the standard.

    Guess I have to believe you when you talk about roots of C#. Most likely someone could find some specs about first version of the language if he wanted, but I'm not sure do I want to do it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-10-2009, 09:36 PM
  2. Javascript Gallery Help
    By Flakster in forum Tech Board
    Replies: 5
    Last Post: 07-21-2005, 05:50 AM
  3. C++ script and needing on conversions
    By Ryan Mosby in forum C++ Programming
    Replies: 0
    Last Post: 10-05-2003, 05:50 PM
  4. JavaScript question
    By HashMonster in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-01-2001, 06:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21