简体   繁体   English

什么时候将在jQuery,mootools等库中构建JavaScript引擎(如Spidermonkey),并且有人可以帮助实现这一点?

[英]When is a javascript engine (like Spidermonkey) going to build in a library like jquery, mootools, etc.. and how can anyone help this to come about?

We all know the great benefits that js libraries such as jquery and mootools etc. have contributed to web browsers and web development. 我们都知道js库(例如jquery和mootools等)对Web浏览器和Web开发的巨大好处。 These libraries are now included in a lot if not most of all websites. 现在,即使不是大多数网站,这些图书馆也包含在很多网站中。

So, I was wondering why none of the current javascript engines just include these functionalities inside the javascript engine itself . 因此,我想知道为什么当前的javascript引擎都没有在javascript引擎本身中包含这些功能 No doubt this has even more benefits such as performance, no need for external loading, standardisation (and its own benefits), etc. 毫无疑问,这将带来更多好处,例如性能,无需外部加载,标准化(及其自身的好处)等。

I realize that this would probably only benefit web browsers and alike, though there must be also many uses beyond just web browsers, but for the sake of argument, one could just add such engine built in functionalities in an optional engine / ECMASCript -and I am guessing the word here- component (with emphasis on optional), that could then be enabled or added only in the engines inside web browsers. 我意识到这可能只会有益于Web浏览器等,尽管除了Web浏览器之外还必须有许多其他用途,但是为了争辩,可以只在可选引擎/ ECMASCript中添加这种内置功能的引擎-我我猜这里组件这个词(强调可选),然后只能在Web浏览器的引擎中启用或添加。

Does anyone know this or has more info on this all? 有谁知道这或有与所有的详细信息?

My second questions is: If we, the community, would decide this to be a great progress for the future, where can we propose/ask such a thing and what else can we do to make this happen? 我的第二个问题是:如果我们作为社区,将决定这是未来的重大进步, 我们在哪里可以提出/询问这样的事情,以及我们还可以做些什么来实现这一目标?

(Some of you must realize the trouble that some feature cost to be included in some projects, such as the years to decade old feature requests voted on by zillion users and never got through because of ...well..let's not be ungrateful to developers and leave these dots for your own imagination. So I'd rather have that the community focus this wish on 1 place only nad maybe the answer to this second question is the start of it?) (你们中的有些人必须意识到麻烦,有些功能要包含在某些项目中,例如数十亿用户对数十年之久的功能请求进行投票,却由于……而未能通过。好吧。开发人员并将这些点留给您自己的想象。因此,我希望社区仅将此愿望集中在一个地方,也许第二个问题的答案是它的开始?)

ECMAScript only intends to standardize the minimum amount of language and support library necessary to build these higher level libraries you're describing. ECMAScript中只打算规范语言,需要建立你所描述的这些高层的库支持库的最低金额。 Also, things like jQuery work on the Document Object Model provided by the browser code, which isn't even part of the ECMAScript standard -- ECMAScript just knows about DOM nodes in the general category of "foreign objects". 同样,jQuery之类的东西也可以在浏览器代码提供的文档对象模型上运行,而该对象对象甚至都不是ECMAScript标准的一部分-ECMAScript只知道“外来对象”类别中的DOM节点。 The SpiderMonkey engine implements just the JavaScript language and its small standard library, which is then embedded into the larger Firefox browser environment. 该SpiderMonkey的引擎仅仅实现了JavaScript语言和它的小标准库,然后将其嵌入到更大的Firefox浏览器的环境。

So, to answer the question more directly: is it possible to give the JavaScript engine intimate knowledge (and perhaps an implementation) of a user-level library like jQuery? 因此,可以更直接地回答这个问题:是否可以让JavaScript引擎对诸如jQuery之类的用户级库有深入的了解(也许是一种实现)? Yes, although you'd be breaking a lot of componentization in the browser, as you mention. 是的,尽管您提到过,尽管您将破坏浏览器中的许多组件化。 Will anybody actually do it? 有人真的会这样做吗? Most likely not, because JavaScript engines just implement the core of what's necessary to build higher level libraries, like jQuery. 很有可能不是,因为JavaScript引擎只是实现了构建高级库(如jQuery)所必需的核心。 Everybody is happy with them living outside of the JS engine, and a nice property of JavaScript is that you can just load the library in as you need it -- the source is freely available. 每个人都对他们生活在JS引擎之外感到满意,并且JavaScript的一个不错的特性是您可以根据需要加载该库-源是免费的。

In fact, as a further note, JS engines are doing more and more to push ECMAScript standard library code out of C++-implementation land and into something called "self-hosted builtins", which enables functions like Array.indexOf to be implemented in JavaScript itself (ie, with a for loop and comparisons). 实际上,需要进一步说明的是,JS引擎正在做越来越多的工作,以将ECMAScript标准库代码从C ++实现领域推入“自我托管的内置程序”,这使Array.indexOf功能可以在JavaScript中实现。本身(即带有for循环和比较)。 This exposes more JavaScript code to the natural process of optimizing JIT compilers, instead of having to deal specially with calls into native C++ implementation code. 这使更多JavaScript代码暴露于优化JIT编译器的自然过程中,而不必专门处理对本机C ++实现代码的调用。

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

相关问题 我如何比较Array.find和foreach等迭代器? - How can i compare Array.find with iterators like for foreach etc..? javascript或mootools的方式来动画scrollTop像jQuery - javascript or mootools way to animate scrollTop like jQuery javascript(和 jquery,如果它可以提供帮助)中的控制台类似地震 - quake like console in javascript (and jquery if it can help) JavaScript Mootools Facebook类似链接预览(抓取器)库 - JavaScript Mootools facebook like link preview (grabber) library 量角器-是否可以将$$(elementLocator).first()用于更多元素,例如第二,第三等等。 - Protractor - Can I use $$(elementLocator).first() for more elements like the second, third and etc..? 学习高级 javascript 的资源,比如为 jquery 编写的东西,mootools? - Resources for learning advanced javascript like the stuff written for jquery , mootools? 如何在任何带有 Jasmine 的 Angular 应用程序中测试 RXJS 实用程序,如管道、跳过、点击、重试等 - How to test RXJS utils like pipe,skip,tap,retry etc.. inside any angular app with Jasmine 在分析JavaScript时,如何忽略像jQuery这样的库? - How can I ignore libraries like jQuery when profiling JavaScript? 如何构建 jQuery 之类的事件? - How can I build jQuery like events? Javascript类似JQuery的库 - Javascript JQuery-like library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM