简体   繁体   中英

What is WebIDL and (why) is it important?

The WebIDL spec is in last call and the buzz is that this is a big step for the web. However, I can't find much useful information on it and why it is important.

I understand it defines an interface but an interface for what? How does WebIDL relate to ECMAscript, JavaScript, HTML or the DOM? Will this affect the life of the humble web developer or is it for a different crowd - browser developers perhaps?

Links to articles are welcome.

I would say that it relates to the DOM and ways to manipulate it through languages other than JavaScript. JavaScript already has ways to manipulate the DOM, but that's not a standard, and WebIDL is probably an interface for other languages.

One area where WebIDL is important is typed language compilers targeting JavaScript. I work on a tool called WebSharper that compiles F# to JavaScript; a much better known example is GWT for Java. In these frameworks our users want typed access to available functionality, with code completion and checking. We used to describe F#-JS mappings by hand or in semi-formal semi-automated ways. It sounds like compiling WebIDL will help a whole lot to be more up-to-date with the evolving HTML5 spec. Ideally we could even convince JavaScript library writers to provide or generate WebIDL for their code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM