Wednesday, June 29, 2011

Rediscovering JavaScript

I've recently grown an interest on javascript. Having working on a project which uses javascript a fair bit I daily hear my co-developers bitching about it. This is the second time I'm doing javascript after 4-5 years and what I've realized is that the attitude towards javascript by many developers hasn't changed much. But during these 5 years or so a lot of innovation has been happening around javascript.

One milestone of this elevation of javascript as a language is, Douglas Crockford discovering 'Good Parts' of Java Script, which elevated javascript status as a noteworthy language. Around the same time the development world started recognizing a new programming paradigm around dynamic languages and javascript also fit right in. Javascript is a truly dynamic language and its prototype based nature allows it to do some wonderful and wild things.

This realization of JavaScript powers has made javascript to become the target compilation language for several other mainstream languages. This is quite an interesting idea which on the surface protect developers from inherit pitfalls and inefficiens of developing with javascript. GWT which compiles from Java, Script # which 'tries' to compile from C# are two such attempts. GWT is quite mature and been used in main stream applications by Google. 

Google built a great browser, Chrome which relies heavily on a fresh javascript engine (V8) developed in-house to run web sites faster. This has stepped up the benchmark for javascript performance on the web and inspired others to innovate on both javascript engines as well as insanely live and active web applications. The debugging support in modern browsers like Chrome, Firefox and IE9 has helped a lot in this endeavor.
The interesting aspect of V8 is that it can be used independent of the browser inside other contexts as a javascript engine.

V8 and it's capability to live outside the browser has helped a great deal in the development of Node.js, a collection of libraries and a javascript runtime on top of V8. It's a radical way of server side development with javascript which utilizes the callback event model of javascript to write highly efficient server side code.  Currently the Node.js libraries are focused on Network and Filesystem. There's a lot of interest around Node.js and Microsoft is actively working with Joyent Software to release Node.js for Microsoft-Azure platform.

So looking at all these innovations and potential around javascript it's time we developers take it seriously and give it the respect that it deserves. A good way to go about this is to (re)learn it and I strongly suggest the work of David Crockford. Here's a good resource for Node.js.
Post a Comment