Restore the true history of JavaScript ~

Source: Internet
Author: User

question ============ does JavaScript really inherit from the CMM? How much does JavaScript have to do with Java? What was the original design of javascirpt?
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. What is now known as "recognition" Is this:---------------- 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 Espresso page (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. Although the above information seems authoritative: JavaScript advanced Programming (Professional JavaScript for WEB developers), but he was wrong.

JavaScript and CMM have nothing to do with the language features ============ 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 to the initial design goal. 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 highlights the ambition of Netscape, a common web development environment for Netscape Company, including Netscape Enterprise, FastTrack server, etc. 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, and other browser objects such as window.

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 the basic nature of JavaScript 1.0.

--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 up:----------------var func = function () {}--- -------------

The design goal of JavaScript 1.0 is to "make the Web page move", the initial requirements include three aspects:-so that the elements of the Web page can be programmed, so like forms, links these objects, after the end of the page loading is initialized to a global member--  There was 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 Netscape 2.0 official version.

JavaScript name ============ in order to understand the evolution of JavaScript name and language features, I downloaded Netscape 2.0 beta1~6, and 2.0~2.02 all versions of the release files, and install the tests. 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 Netscape 2.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 the beta 4 release (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 described above, the Beta 1 in Netscape 2.0 formally joined script support, up to 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 the Espresso 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 message above that the demo (released on the weekends) will demonstrate-a Bouncy-button game, -Real-time verification of user input into for MS,-an animated stick-figure, -and a-means cool flashback into the Psychadellic Sixties. Indeed, the functions of these demos are probably the javascrip of the time. T (LiveScript) is not possible. 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 have seen the Netscape release version of the features, in fact, can be used in a browser embedded in the Cenvi to complete, so the release of such a model version.

From a chronological analysis, we can be sure that:-Netscape embedding scripts in Web pages is a concept that predates espresso pages;-JavaScript (LiveScript) is the real first client-side scripting language 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 "Mozilla 1" maintenance version. 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.

Restore the true history of JavaScript ~

Related Article

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.