JavaScript, for dynamic web pages and beyond

Since Netscape created JavaScript to program dynamic HTML pages, applications have continued to expand.

Its main function and scripting a HTML page or a graphical interface (see Qt, XAML, etc ...). This allows the exchange of data with the server through Ajax, WebSockets, WebRTC.
But it is used also to enable scripting in some applications (Photoshop uses JavaScript) and even for system programming!

JavaScript was successively called Moka, then LiveScript and finally in agreement with Sun, JavaScript.
JScript is a compatible version implemented by Microsoft in 1996, for Windows only.

It has many flaws, but it's an innovative and flexible language, and although it is more than 10 years, it offers more opportunities than most newer languages​​, such as Dart which wants to replace it but whose design is a relic of the past.

An ingenious and innovative language

The format described here is ECMAScript 1.5, the standard defined by the ECMA group in 1999. More recent version exists, but not supported by all browsers.

JavaScript in LightTable
Example of code: loop on a string

Some flaws of the language...

Harmony (ECMAScript 6), for bigger apps

The new version of JavaScript, while preserving the compatibility of this language will be a safer place to develop huge applications.

Some of these new features are already implemented in one or another browser. To see what is implemented, view the test of implementation of new JavaScript features with this browser.
To enable some of these features in Chrome, you must type chrome: flags and Enable Experimental JavaScript.

Reference: ECMA Standard Specification Draft for 6th Edition.

What JavaScript interpreter for each browser?

Browsers compete on JavaScript engines like on renderers... But there are now JIT compilers rather than interpreters...

Nashorn produces bytecode for the JVM. Not integrated to any major browser.

A system language?

With the advent of JavaScript compilers, operating both in the browser or as a standalone tool, new uses are emerging for this C-like language but even freer, and with an automatic memory management, a sandbox.

JavaScript is it slow on mobile?

The controversy was started by an article by Drew Crowford that JavaScript is too slow because mobiles have little memory compared to desktop computers.
But other language specialists do not agree. In this article it is stated that the culprit is not the language, it is the DOM. We know that DOM is slow, which is why some frameworks like Angular have implemented data-binding that allows to update the content without going through it.
The writer adds that in fact, JavaScript can be faster than other languages ​​like Objective-C (used on iOS) in exchanging messages because it is something that works better with a JIT than with a static compilation.
Finally, the author attributes the speed of native iOS apps to the fact that the screen is one size, unlike Android or other systems, which allows you to create interfaces formed of full images.

Documents

Even if the language is relatively easy to learn, it has dark spots, so that there are books specializing in the good parts of the language, others on complex issues.

Tools

You can develop a JavaScript app in an IDE as LighTable (see image above), Eclipse, NetBeans or Aptana, or a simple script with any editor.

JavaScript at command line

It may be used with the V8 engine or Nashborn, a version running on the Java Virtual Machine.

Extensions and frameworks

It is strongly recommanded to use an Ajax framework or an HTML 5 library to build a serious application. There are also frameworks for mobile apps.

Programming and data languages Asm.js - Basic - C - C++ - C# - Dart - Eiffel - Go - Java - JavaScript - Julia - Pascal - PHP - Python - Ruby - Rust - Scala - Scriptol - TypeScript - HTML - XML - XAML - SQL
News and comments

JavaScript is now the language of applications on Linux

February 5, 2013 19:06:01

Linux

More specifically applications for the GNOME desktop environment, which so is following in the footsteps of Windows 8 and its modern interface. Other languages ​​are possible, but the first choice is JavaScript. The advantages are numerous: greater portability, a larger ecosystem, a broader audience of developers because JavaScript is known to almost everyone.
Obviously this causes protests because each developer has his favorite language (C, Python, Ruby, etc.), he would have wanted selected for this role.
The other reference environment, KDE is based on Qt, which also uses JavaScript for the interface and C++ for applications. However, the Plasma interface, which is equivalent to Metro for Linux, allows the rapid creation of JavaScript applications with the IDE Plasmate.