InfoQ

News

Web IDL: W3C Language Bindings for DOM Specifications Gets a New Name

Posted by Han Xu on Sep 07, 2008 11:14 AM

Community
SOA
Topics
Specifications
Tags
W3C ,
AJAX
The W3C Web Applications Working Group recently published the working draft of Web IDL which was formerly known as the Language Bindings for DOM Specifications. The working draft defines a syntactic subset of OMG IDL version 3.0 for use by specifications that define interfaces. InfoQ spoke to the specification editor to learn more about the specification and its impact on the Web development community.

The interface definition language defined by the working draft is called Web IDL which can be used to describe interfaces that are intended to be implemented in web browsers. Web IDL is an IDL variant with a number of features that allow the behavior of common script objects in the web platform to be specified more readily. A number of extensions are given to theIDL to support common functionality that previously must have been written in prose. In addition, precise language bindings for ECMAScript 3rd Edition and Java are given. The Introduction part of the document explains the reason for having such a specification:
Technical reports published by the W3C that include programming language interfaces have typically been described using the Object Management Group’s Interface Definition Language (IDL) [OMGIDL]. The IDL provides a means to describe these interfaces in a language independent manner. Usually, additional language binding appendices are included in such documents which detail how the interfaces described with theIDL correspond to constructs in the given language.

However, the bindings in these specifications for the language most commonly used on the web, ECMAScript, are consistently specified with low enough precision as to result in interoperability issues. In addition, each specification must describe the same basic information, such as DOM interfaces described inIDL corresponding to properties on the ECMAScript global object, or the unsigned long IDL type mapping to the Number type in ECMAScript.
Web IDL is intended to specify in detail the language used by W3C specifications to define interfaces, and to provide precise conformance requirements for ECMAScript and Java bindings of such interfaces.
It is expected that the document acts as a guide to implementors of already-published specifications, and that newly published specifications reference this document to ensure conforming implementations of interfaces are interoperable. "It is proving unbelievably helpful in the construction of HTML5." says Ian Hickson, one of the HTML 5 editors. And another specification that will reference Web IDL is XMLHttpRequest Level 2, which was first published in February 25 this year.

Besides some changes in the content, a major change made in this revision is that the title of the document is changed to "Web IDL", which is "a more accurate name for what the document defines (an IDL language and its mapping to two languages), as the document’s previous name gives people an impression that it was applicable only to DOM specifications, not any specification defining an interface with IDL," according to Cameron McCormack, the editor of Web IDL.

Cameron also tells InfoQ how Web IDL would be useful for the Web development community indirectly:
Most DOM-related specifications at the moment have quite high level descriptions of how host objects in ECMAScript that implement particular interfaces should behave. For example, the ECMAScript Language Binding appendix of DOM Level 3 Core describes the ECMAScript binding for DOM Level 3 Core, yet it does not say that Node prototype object is in the prototype chain for an Element object. Various AJAX toolkits rely on this, yet it has not been standardised.

Another example is that it’s not explained how types are coerced when calling functions on host objects. For example, when you do:

circleElement.setAttributeNS(null, 'cx', 2 * 50);

then it’s expected that this behaves like:

circleElement.setAttributeNS(null, 'cx', '100');

since the third argument to setAttributeNS() is a DOMString. This isn’t defined anywhere, but it is widely interoperable behaviour. Web IDL defines how type coercion works like this.
So with Web IDL "imposing stricter requirements on language bindings for other specifications", the Web development community will see a more interoperable world as far as the coherence between standards and between products developed against the same standards is concerned.
do any interpreters support this? by Patrick Mueller Posted Sep 8, 2008 10:57 PM
  1. Back to top

    do any interpreters support this?

    Sep 8, 2008 10:57 PM by Patrick Mueller

    Seems like this would be most useful if I could get a JS interpreter to read it, and verify the IDL against runtime behaviour. Maybe just in a test mode or something, even. I suppose you could do that via monkey-patch'ing the living daylights out of the code, at runtime. Not sure I'm going to trust someone to just write this stuff by hand, assume they've done it all correctly. Especially if there's a lot of it.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.