W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

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

From: Kartikaya Gupta <lists.whatwg@stakface.com>
Date: Fri, 10 Jul 2009 15:01:59 +0000
Message-ID: <20090710150200.1E04192B3@looneymail-mx3.g.dreamhost.com>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC