Re: IDL: number types

On Wednesday, 20 March 2013 at 12:33, Domenic Denicola wrote:

> This is kind of a meta-question, but is the purpose of IDL types for C++ implementers or for JavaScript consumers?

Initially I think it was C++, but increasingly these are reflected in JavasScript. Boris can provide details, but I think Moz's WebIDL parser/code generator will generate JS stubs. Also, WebIDL Harness, for conformance testing, is in JavaScript. At the end of the day, these things end up being javascript (and I'm hopeful one day we will just be able to use WebIDL itself *in* JavaScript to define interfaces - but that's another can of worms).   
> 
> The way Boris talks about them, it sounds like they are being used directly for C++ implementations.
Yes, this is done also in WebKit (with a variant of WebIDL): Stubs of C++ code are generated from IDL; and I've also seen IDL used in Android for the same reason (except Java is pumped out). 
> But my impression was that WebIDL was supposed to be specifying JavaScript objects created through the parser, in which case there should only be a single number type (aka "Number").

This is what we are trying to get towards.  
 
> 
> Clarifying the purpose of WebIDL might be a good starting point for any attempts to nail down its type system.

Agree. 

Received on Wednesday, 20 March 2013 16:39:59 UTC