I’m trying to understand web API
term, used in MDN
and after researches, I realized for defining web APIs
, a language called web IDL
is getting utilized, so I wonder why these objects referred as web APIs, why don’t they get created by JavaScript
itself and why there is a necessity to utilize a language as web IDL
?
and another thing is, is web IDL
only meant for bringing C++
into JavaScript
with its own special semantics or it can turn any other language than C++
, into JavaScript
?
last part was based on text:
Web IDL exposes an interface to JavaScript, which is implemented in C++. Thus its semantics bridge these two languages, though it is not identical to either. Web IDL’s semantics are much closer to C++ than to JavaScript – in practice, it is a relatively thin abstraction layer over C++. Thus C++ implementations are quite close to the IDL spec, though the resulting interface is somewhat unnatural from a JavaScript perspective: it behaves differently from normal JavaScript libraries.
lome is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.