Archive for the ‘JAVASCRIPT2’ Category

Thursday, April 9th, 2009

Well it appears ES4 path is dead officially and a new standard has been published replacing it, the ECMAScript Fifth Edition announced in Geneva, Switzerland and will be in place as fully tested and approved by all involved by the end of 2009. ES5 was previously known as ECMAScript 3.1 or an iteration of the ES3 standard that is what most JavaScript is based on in all browsers, and was previously competing with the ES4 newer standard that changed Javascript quite a bit but in many areas much better, in some areas it was bloated.

This revision of ECMA-262 will be known as ECMAScript, Fifth Edition. It was previously developed under the working name ECMAScript 3.1, which will no longer be used. ECMAScript is the scripting language that is used to create web pages with dynamic behavior. ECMAScript, which is more commonly known by the name JavaScript™, is an essential component of every web browser and the ECMAScript standard is one of the core standards that enable the existence of interoperable web applications on the World Wide Web.

ECMAScript Fifth Edition (ES5) was strongly guided by Crockford and Microsoft, which is different than the push for ES4 which is what ActionScript 3 is based on and was supported by Adobe and Mozilla.

However it seems everyone is happy and everyone is supporting this version to get things moving if you go by the ECMA Org quotes:

Industry Reaction

Brendan Eich, Mozilla CTO and creator of the JavaScript language, said “The Fifth Edition of ECMAScript makes real improvements based on browser innovation and collaboration in Ecma, which provides a solid foundation for further work in future editions.” Microsoft’s ECMAScript architect, Allen Wirfs-Brock, commented “We expect the Fifth Edition to benefit all web developers by helping improve browser interoperability and making enhanced scripting features broadly available.”

Peace.

I still have to read further into the ECMAScript 5 specification which was published, but there are some new interesting things.

One nice feature is the JSON object.  Right now you have to eval to use JSON in javascript in a browser but they now have JSON.parse(object) and JSON.stringify(object) which is standard and conveniently already wired into IE8 this way. This is based on the JSON2.js library by Douglas Crockford of Yahoo.

var jsObjString = "{\"memberNull\" : null, \"memberNum\" : 3, \"memberStr\" : \"StringJSON\", \"memberBool\" : true , \"memberObj\" : { \"mnum\" : 1, \"mbool\" : false}, \"memberX\" : {}, \"memberArray\" : [33, \"StringTst\",null,{}]";
var jsObjStringParsed = JSON.parse(jsObjString);
var jsObjStringBack = JSON.stringify(jsObjStringParsed);

Another feature is DOM prototypes which are useful and cool, which allow you to extend dom objects.

If you use javascript or are an actionscripter, not sure if Adobe will have ActionScript 4 go this way or if Alchemy has changed the flash player into a multi language VM now.  It will be fun to watch things progress but also if you are into javascript it seems this standard, ES5, will be it by the end of the year.  And probably since IE8 already supports it, in all new browser by then as well.  It will probably take 1-2 years before browser saturation makes this usable but if you are using standards that mimic this then there will be no change then, such as the JSON2.js library.

Tuesday, July 24th, 2007

Microsoft has been busy pushing the DLR (Dynamic Language Runtime) and there is many interesting developments from C# 3.0 to IronPython and now Microsoft released IronRuby public alpha.

Will these languages be treated like J# and JScript.NET? We shall see.

If they perform better than their counterparts it might make python and ruby coders able to take on more platforms and capabilities.

It is still only pre-alpha and missing much but like mono.net, it can have an impact when platforms and languages merge.

Earlier this year, Microsoft assured developers that it would be continuing to build languages on top of the Dynamic Language Runtime (DLR). Considering that IronPython had been a success in terms of implementation, the company decided that it would make an attempt at bringing Ruby into the world of .NET. With the help of Ruby expert John Lam, today the company announced that a pre-alpha build of IronRuby is now available. You heard it right, this release is pre-alpha—many Ruby features and libraries have not yet been implemented.

One very interesting aspect of all these DLR languages is that Silverlight Alpha 1.1 supports IronPython. Will it support IronRuby? Silverlight is very fun to code in C# and can be coded in Python as well. This over just AS3 in Flash. However, AS3 is very fun and is based very closely to the Javascript2 spec. Javascript can be argued that it is the most dynamic language and functional language there is that is so widespread in, Javascript 2 could be a big thing. Languages seem to be converging on this point.

For IronRuby fun ScottGu has a great blog post on getting started with IronRuby.