Re: [heycam/webidl] Conversion from specification values to IDL values to ECMAScript values (#674)

I'm not sure I understand the specific problem. Is this about what conventions to use when writing specs?

I think this could be an interesting case of where the implementation via C++ vs. implementation via JavaScript comes up. In a C++ implementation of a feature, it helps to have the spec be clear about the type of data you are using, and it does seem like WebIDL is written for this implementation audience--in other words, that the IDL types are the data structures that would be used and manipulated in spec prose and algorithms. Does this happen in practice?

For an implementation authored in JavaScript itself, the conversions to IDL types are meaningless because there's no language boundary to cross, in terms of where the public API meets the internal implementation. The JavaScript langauge itself defines all the rules for type converting among it's different var representations (for example when concatenating two different types). Per my understanding, the Infra spec strongly implies that the core structures for spec development are based on JavaScript itself with some slightly more strongly typed conversions, such as the scalar value string which are available for specific scenarios. If implementing in JavaScript and trying to conform to WebIDL, the type-validation code for the various IDL type converstions would need to be coded explicitly, pretty much following the conversion algorithms defined in WebIDL for EcmaScript -> IDL.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/674#issuecomment-469816125

Received on Tuesday, 5 March 2019 19:03:47 UTC