什么是 WebIDL 以及(为什么)它很重要?
WebIDL 规范已在最后一次调用中,嗡嗡声是这对于网络来说是一大进步。但是,我找不到关于它的太多有用信息以及为什么它很重要。
我理解它定义了一个接口,但是接口是用来做什么的? WebIDL 与 ECMAscript、JavaScript、HTML 或 DOM 有何关系?这会影响普通 Web 开发人员的生活还是影响其他人群(也许是浏览器开发人员)的生活?
欢迎链接到文章。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想说它与 DOM 以及通过 JavaScript 以外的语言操作它的方法有关。 JavaScript 已经有了操作 DOM 的方法,但这不是标准,WebIDL 可能是其他语言的接口。
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.
WebIDL 非常重要的一个领域是针对 JavaScript 的类型化语言编译器。我正在开发一个名为 WebSharper 的工具,它将 F# 编译为 JavaScript;一个更广为人知的例子是 Java 的 GWT。在这些框架中,我们的用户希望通过代码完成和检查对可用功能进行类型化访问。我们过去常常手动或以半正式半自动化的方式描述 F#-JS 映射。听起来编译 WebIDL 将有助于跟上不断发展的 HTML5 规范的步伐。理想情况下,我们甚至可以说服 JavaScript 库编写者为其代码提供或生成 WebIDL。
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.