The true history of JavaScript that we know today ~[turn]

Source: Internet
Author: User

Does JavaScript really inherit from the CMM?
How much does JavaScript have to do with Java?
What was the original design of javascirpt?

This article is from a website called Programming life to see. I don't know where it lies.
In many sources, JavaScript's source is traced back to a language called the CMM. Also in this traceability process, people find that "in fact" JavaScript is not the first type of scripting language in the Web page. Now some of the so-called "accepted" cases are:
----------------
Probably in 1992, a company called Nombas began developing an embedded scripting language called C-minus (C-minus-minus, or CMM). This scripting language is bundled in a shared software product called Cenvi, and Nombas developed a version of Cenvi that can be embedded in a Web page when Netscape Navigator is emerging. These early experiments, called espressopage (Espresso-like pages), represent the first client-side scripting language to be used on the World Wide Web. And Nombas didn't expect its idea to be an important cornerstone of the Internet.
----------------

However, is this the real situation? The first "Client scripting language" running in Netscape is really a CMM espresso? Or really, as the wiki describes, Brendan eich the CMM language feature in JavaScript? No, it's not. Although the above information seems authoritative: JavaScript advanced Programming (Professional JavaScript for WEB developers), but he was wrong.


JavaScript and CMM are not related to language characteristics
============
In order to understand the relationship between JavaScript and the CMM, I took about three days to collect multiple CMM versions from the Internet. These versions included both the early CMM (1993) and the CMM at the start of JavaScript (1995), and later, the CMM was renamed the first version of Scriptease (3.0, 1997), and as a reference, I looked at its version on the server side.

Unfortunately, before 1996, before the last version of the CMM 2.x, the CMM was not an object-oriented (or object-based) language, and the CMM was the same as its own name: It was a lite C, not C + + or C + + based variant. So the CMM has "structure", also has # include, etc., the whole system is reference C language.

Because JavaScript references C on basic syntactic attributes such as curly braces, statement keywords, and so on, on the object system (for example, "." As a member of the access) reference to Java, so to some extent, CMM and JavaScript similarities-mainly with the common reference to the part of C. But beyond that, JavaScript has absolutely nothing to do with the CMM in language features.


What was the initial basic design of JavaScript?
============

I need to add a little bit of JavaScript initial design goals. Brendan Eich was hired by Netscape company around April 1995 with the goal of completing a set of language systems. In its original design, the language system was designed to serve the livewire strategy of Netscape. The strategy underscores Netscape's ambition to be a common web development environment for Netscape company, including Netscape
Enterprise, FastTrack server and so on. The livewire architecture also serves as a blueprint for all Web servers to provide SP (server Page) technology. For example, ASP in IIS, and earlier IDC (Internet Database Connect).

This technique uses a set of objects called database, Dbpool, cursor, and so on on the server side to access the livewire database through the LiveScript code embedded in the Web page. As a complete solution, Netscape also provides support for the LiveScript scripting language on the Client Web page, in addition to accessing the built-in objects such as array, string, etc.
The browser object. It is not clear, however, that the initial design of LiveScript is to consider server-side applications or to consider applications in Web pages first. However , the decision-making changes in these application environments are limited to April 1995 to October 1995, as the Netscape 2.0 Beta1 released during the month already contains scripting support. <script> tags are not supported in Netscape 2.0 Beta1, but only events of the onclick type are supported in form elements . The script code is then used on the HTML tag attribute, which is similar to the following:

<input type= "button" onclick= "alert (' Hello, world! ')" >

Soon, three weeks later Netscape released the Beta2. This version formally supports the <script> tag, and can parse the tag code, identifiers, and begin to have the ability to call functions, expression operations and so on. This version already has JavaScript 1.0

The basic nature of the.

--What? Can call function, expression operation is the basic nature of JavaScript 1.0?

Yes, it's almost there. In contrast, JavaScript 1 only adds a set of object systems to this base. In the subsequent release of Beta 3, the function can be used as a constructor to create the user's own object. Then the window and other global objects are added, and then the "current page" in the table elements such as mapping into a programmable object, JavaScript 1.0 is complete.

Just that. In the age of JavaScript 1.0, there is neither "prototype inheritance" nor "functional programming"--even anonymous functions are not supported, so the following code is enough for the browser to hang out:
----------------
var func = function () {
}
----------------

The design goal of JavaScript 1.0 is to "get the Web page moving", and the initial requirements include three areas:
-The elements in the Web page can be programmed, so objects like forms and links are initialized as global members after the page is loaded-there is no DOM or DHTML at that time.
-Get JavaScript closer to Java because Netscape is strategically working with sun. and sun was pretty hot then. -Make JavaScript available both on the server and on both sides of the client, so it must be embedded. But another feature of JavaScript is that it exists since its first version. This feature is dynamic execution, which is eval (). This is related to the nature of its "script". In earlier "Scripts" are also known as "batch Programs", just like DOS batches or Unix shells, scripts should have the ability to load string literals and "execute dynamically".

So to summarize, JavaScript 1.0 is actually a common procedural language that can create and manipulate objects. At this time, the JS code can not detect the "object-constructor" between the inheritance, there is no prototype inherited such things to build the object system. The function is identical to the normal function except that it assists in passing in a this reference in addition to new MyObject (). And, most interestingly, Brendan Eich did not yet form the most important "type system" concept in JavaScript, when undefined was just a special value in the global system, not a type. The TypeOf keyword also does not exist at all. In other words, what Eich is now going to do is a "programmable, object-ready" scripting language, which he can still look for if it is complete or graceful on the type system.

JavaScript's most important concept of "constructor-prototype inheritance" is proposed in the JavaScript version 1.1, where type systems and important functional language features are not added until v1.2. Now, at the end of January 1996, JavaScript 1.0 was released with the Netscape2.0 official version.


The name of JavaScript
============

To get a sense of the evolution of JavaScript names and language features, I downloaded Netscape 2.0 beta1~6, as well as 2.0~2.02 all versions of the release files, and installed the tests individually. The following explains the evolution of JavaScript names. JavaScript was originally called Mocha (Magic Card), which is the code name for this project. This name has been used until Netscape2.0 Beta 2 was released (95.11.04)--including the error box popped in Beta 1, and the name of Mocha was also visible. However, as early as September 18, Netscape has published a message that will enable a server-side script in Livewire (name not mentioned). And because of the design of the "front-end Generic Script" We mentioned earlier, the language used the internal name LiveScript when it was released in Beta 2 .

But the same messy thing is that, in fact, Netscape has decided to name the language "JavaScript". So in the Beta 2 release memo The language is called JavaScript, and the interface is changed from Mocha to LiveScript. The situation continued until December 4, when Netscape and Sun issued a statement that formally enabled the name JavaScript. Then beta 4
Publish (95.12.20), the interface and documentation are unified. So the fact that the name "LiveScript" can be verified in the life cycle, is only one months (in 95.11.04

-12.04). But Mocha, after all, is only the project code name, not the product name, so later people trace the history of JavaScript, mostly only mentioned livescript.


The first paragraph of the web page script is really espresso (Espresso page)?
============

As mentioned above, script support was formally added to Beta 1 in Netscape 2.0, at the latest before Beta 2. How objects are built, the use of <script> tags, and the use of the OnClick event handle on HTML tags ... These designs have been made clear. These are the ways that continue to the present, our main use of Web pages. Well, this point of time can undoubtedly be determined before 95.11.04 (Beta 2 release).

Now we'll look back at the message that tells Espresso page. This was actually a message from Mr. Brent Noorda (Nombas company president) on the News Group (comp.infosystems.www.authoring.html) on 1995.11.27, " This weekend we will release some espresso pages on our website (this weekend we put up Theespresso pages, at ...) ", then, that is, espresso Pages actually appears after number 11.3th. It's much later than the time.

That is, the real first client script to be used in Netscape is still JavaScript written by Brendan Eich. This script uses the "<script>" tab (using <server> tags on the server side), supports five basic types (except undefined), supports basic features such as custom objects and constructors, and can manipulate links embedded in the Web page, Forms and other objects.

However, it is important to note that since Nombas has implemented the CMM language and its development environment early on, it is not necessary for him to be able to transplant them into a Web page and demonstrate its rich capabilities. So Mr. Brent Noorda in the news above that the demo (released on the weekends) will demonstrate
-A Bouncy-button game,
-Real-time verification of user input into forms,
-An animated Stick-figure,
-and a-to-cool flashback into the Psychadellic sixties.
Indeed, the functionality of these demos is probably something that JavaScript (LiveScript) did not achieve. But the features required for the same functionality, and its basic implementation, are actually included in the version that Netscape was released at the time. So there is no question of Netscape plagiarism Nombas here at all. However, in a different perspective, Nombas may be looking at the Netscape release
Feature can be done with a cenvi embedded in the browser, so a demo version is released. from a chronological analysis, we can be sure that:

-Netscape embedding scripts in Web pages is a concept long before espresso pages appeared;
-JavaScript (LiveScript) is really the first client-side scripting language to be used on the World Wide Web.

In any case, Espresso pages is a good demonstration of what Netscape was plotting at the time-whether Nombas was with Netscape, or Nombas to help Netscape unfold the blueprint (designed by Netscape). At the time (before JavaScript 1.0 was released), the CMM in Cenvi was quite complete and the development environment was mature. So admittedly, Nombas's espresso pages did a better job of showing the end of the web. However, the idea of becoming "an important cornerstone of the Internet"-in this case, the script within the page-is by no means a nombas idea. Because these ideas have been shown in Netscape Beta1~3.


Other
============
There is a Java compiler named Mocha, but it has nothing to do with this article.

The CMM is also known as c--, but there is also a language called Sphinx c--, which is designed to resemble a CMM, but not in the same language. in the era of the Java heat, there were a lot of products named Espresso (Espresso), but none of the Espresso Pages here. Espresso pages is just some demo pages that need to be downloaded and installed specifically for a specific version of Cenvi to view. But this particular version has been extinct on the internet.

JavaScript does not look for much inspiration from Java, Brendan Eich himself to say "my influences were awk, C, Hypertalk,and Self", which neither includes Java nor the shadow of a CMM. But Brendan Eich also said that the other effect was "combined with management orders to" make it look like Java. " This emphasizes a kind of likeness, not the succession relation on the source of the language.

In February 1996, Cenvi released its last version of 2.x. This version is a few fixes to the previous version. But then, after about 1.5, Cenvi released the next version (v3.0). This version was renamed Scriptease, discarding the old CMM specifications and using the syntax under the JavaScript specification. And since this release, Scriptease has released many different versions of desktop and Web server-previously Cenvi only for different OS versions. So in fact, not only Brendan Eich was affected by Nombas, but is nombas by JavaScript and gave up the whole original language design, and in product strategy, also copied Netscape livewire strategy.

Nombas was later acquired, Scriptease and other products are no longer maintained. Nombas.com site can still access, but only a farewell page, but the corresponding, Netscape is not where to go.

Mozilla is the internal code name of an early Java development team in Netscape. This flag is already visible in the Java code package included in Netscape 2.0 beta. But the team is truly independent of the open source organization, and eventually take over Netscape unfinished business, it is late to January 1998 after the matter.

mozilla and Mozilla Firefox use two sets of version numbers. So "Mozilla 2" was launched 2006.1 months ago, when Mozilla firefox 2.0b1 was released-it was based on the maintenance version of "Mozilla 1". It is also interesting that Mozilla Firefox 3.x was developed on the basis of the "Mozilla 2" project, and probably released its official version in mid-2008.  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.