ECMAScript 4 Language Overview Final Draft
Written by on October 23rd, 2007 in Ajax News.
The final draft for the language overview of ECMAScript 4 has been released. This is not the spec itself, but the starter overview document.
The fourth edition of the ECMAScript language (ES4) represents a significant evolution of the third edition language (ES3), which Ecma approved as the standard ECMA-262 in 1999. ES4 is compatible with ES3 and adds important facilities for programming in the large (classes, interfaces, namespaces, packages, program units, optional type annotations, and optional static type checking and verification), evolutionary programming and scripting (structural types, duck typing, type definitions, and multimethods), data structure construction (parameterized types, getters and setters, and meta-level methods), control abstraction (proper tail calls, iterators, and generators), and introspection (type meta-objects and stack marks).
ES4 also upgrades ES3 in small ways by fixing bugs, improving support for regular expressions and Unicode, supplying richer libraries, and adding lightweight facilities like type-discriminating exception handlers, constant bindings, proper block scoping, destructuring binding and assignment, succinct function expressions and definitions, and array comprehensions.
We first present the goals of the ES4 working group (ECMA TC39-TG1) and discuss the key issue of compatibility between ES4 and programs written for ES3 before we describe ES4 in its entirety1. We omit tedious details. This document is not a tutorial; the reader should be familiar with ES3.
Here you read about the fun new features such as:
- Generic functions: generic function intersect(s1: Rect, s2: Rect) {}
- Let const: let const color = 0xFEFEFE
- Namespaces: namespace ns3 = “www.ecma-international.org”
- “like”: var v: like { x: int, y: int }
- Packages: package org.ecmascript.experiment { internal var v; }
- Program units: use unit URLParser “http://www.mycompany.com/lib/URLParser”
- For in: for ( i in obj ) print(i)
This is just a taste. Excited or scared about ES4?
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/173651580/ecmascript-4-language-overview-final-draft