简体   繁体   English

什么是WebIDL和(为什么)重要?

[英]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. WebIDL规范是最后一次调用, 嗡嗡声是这是网络的一大步。 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? WebIDL如何与ECMAscript,JavaScript,HTML或DOM相关联? Will this affect the life of the humble web developer or is it for a different crowd - browser developers perhaps? 这会影响卑微的Web开发人员的生活吗?或者是针对不同的人群 - 浏览器开发者可能会这样吗?

Links to articles are welcome. 欢迎链接到文章。

I would say that it relates to the DOM and ways to manipulate it through languages other than JavaScript. 我会说它与DOM以及通过JavaScript以外的语言操作它的方式有关。 JavaScript already has ways to manipulate the DOM, but that's not a standard, and WebIDL is probably an interface for other languages. JavaScript已经有了操纵DOM的方法,但这不是标准,WebIDL可能是其他语言的接口。

One area where WebIDL is important is typed language compilers targeting JavaScript. WebIDL很重要的一个领域是针对JavaScript的类型化语言编译器。 I work on a tool called WebSharper that compiles F# to JavaScript; 我研究了一个名为WebSharper的工具,它将F#编译为JavaScript; a much better known example is GWT for Java. 一个更为人熟知的例子是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. 我们曾经用手或半正式的半自动方式描述F#-JS映射。 It sounds like compiling WebIDL will help a whole lot to be more up-to-date with the evolving HTML5 spec. 这听起来像编译WebIDL将有助于更多地了解不断发展的HTML5规范。 Ideally we could even convince JavaScript library writers to provide or generate WebIDL for their code. 理想情况下,我们甚至可以说服JavaScript库编写者为其代码提供或生成WebIDL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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