[whatwg] Non-ecmascript bindings (was Re: Serving up Theora <video> in the real world)

James Graham wrote:
> Is there any good reason to worry about languages other than javascript? 
>   Writing APIs that work well in the one language implemnented in web 
> browsers seems better than writing mediocre APIs that can be used in 
> many other languages. I'm not sure what is needed for IDL to cope with 
> this though.

I've noticed this question come up frequently (happened for XHR as well). All the "major" browsers don't care about other languages, but please keep in mind that some other browsers do. For instance, the BlackBerry browser, which I work on, is written almost entirely in Java. We allow the rendering engine to be embedded inside other applications written for our devices, and for those apps, make the DOM available via both Java and ECMAScript interfaces so that client apps can manipulate it as they wish. Having APIs that are Java-friendly is critical to this.

Really, it's not that much work to make sure the API can have bindings in other languages. As long as you can write WebIDL for it (and provide relevant DOM feature strings wherever necessary), you should get it for free. I would also argue that considering other languages forces you to think more about how the API may be (ab)used and therefore results in a better and more robust API, even if it is never actually implemented in other languages.

Cheers,
kats

Received on Friday, 10 July 2009 08:01:59 UTC