August 18, 2011

WebIL - the future Assembly language for the Web?

Some people have expressed their opinion of JavaScript being the Assembly language for the web. I actually partially agree with the statement. It is far from being close to the Assembly language neither syntactically nor functionally, but "Javascript is as low-level as a web programming language goes."
Despite the fact that especially in last few years it became much more developer-friendly (thank you John Resig for the wonderful jQuery library!) and faster with the improved browser engines, it still has many flaws (http://c2.com/cgi/wiki?JavaScriptFlaws). Just to name a few:
  • Dynamically-typed variables often cause run-time errors
  • Language syntax and implementation of many data types (e.g. arrays, date/time, numeric types) often do not follow most common programming language conventions (C-like languages like C/C++, C#, Java)
  • Very limited number of built-in functions. There is no common framework that is supported by all browsers. In most cases, you need to download external libraries or create your own to implement commonly-used functionality.
  • Browsers may interpret the same script differently. It is necessarily caused by non-conformance to ECMA specification, but by different ways of manipulating the DOM.
  • No ways or, rather awkward ways to manage performance, memory utilization and garbage collection
  • No easy ways to log and report scripting errors
  • No easy ways to ensure source code protection, code trust and security
  • JavaScript is not a true object-oriented programming language. People that can script JavaScript classes are often considered JavaScript gurus :-)
So, how can we solve it? My idea is to implement a browser engine that would execute WebIL - Web Intermediate Language, just like C# or VB.Net code is first compiled into MSIL (Microsoft Intermediate Language) and then compiled into OS-specific code at run-time (JIT - Just In-Time compiling). Here are a few advantages of this concept:
  • The WebIL is not language-agnostic. The code can be written in JavaScript, C#, Java,VB, F#, Python, Ruby, UNI (yoU Name It :-)), and then compiled into the WebIL by a compiler/interpretor. So, the existing JavaScript libraries can be relatively easily converted into the WebIL libraries.
  • No need to maintain client and server code bases. A common library can be compiled into platform-specific code and WebIL with very little or no modifications.
  • The WebIL should be standardized and should not be browser-agnostic. The same WebIL code should execute identically in any Browser, whether it is runs on a desktop or a mobile device.
  • Core libraries (frameworks) can be delivered with the browsers with updates and extensions hosted in centralized locations and cached by the Browser.
  • WebIL libraries can be potentially even smaller than the current JavaScript libraries because core frameworks will implement most common functionality.
  • Common coding and design patterns now can be implemented in WebIL.
  • Developer productivity can potentially increase significantly. Learning and transition for programmers and web developers is going to be easier.
  • Solutions can be coded more efficiently.

ECMA published CLI (Common Language Infrastructure) specification ECMA-335 rev 5 in December of 2010 (http://www.ecma-international.org/publications/standards/Ecma-335.htm). Even though it is most likely the specification for .Net 5.0, I do not see a reason why its sub-set cannot be used for the WebIL. In fact, in version 4 of the Framework Microsoft already created Client profiles.

So, I am wondering, is Microsoft already working on something that is similar to the WebIL concept? They have the power to revolutionize the web. 

1 comment:


  1. DIGITAL MARKETING AGENCY provides Digital Solutions to clients spread across the globe. Our services provide ethical Digital Marketing Services which offer innovative solutions From the past 6 years. We are providing different types of Digital Marketing Services like Search Engine Optimization (SEO), Social Media Marketing (SMM), Pay Per Click (PPC), Content Marketing (CM), Email Marketing (EM), Web Designing. The team of DIGITAL MARKETING AGENCY is informing that, Every kind of Digital Marketing Service will be available with a good commitment for all types of business holders in Dubai, UAE.
    Advertising agencies in dubai

    ReplyDelete