JavaScript 是一个开源项目吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5520245/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is JavaScript an open source project?
提问by Charles
While I know that it was created by Brendan Eich at Netscape, is JavaScript an open source project? If not, who owns the source code?
虽然我知道它是由 Netscape 的 Brendan Eich 创建的,但 JavaScript 是一个开源项目吗?如果没有,谁拥有源代码?
Also, what compiled language was used to develop JavaScript?
另外,JavaScript 是用什么编译语言开发的?
回答by Kerem Baydo?an
JavaScript is not a "project".
JavaScript 不是一个“项目”。
Rather, there is the 'specification' of the language (the ECMAScript standard), and then there are many 'implementations' of that standard. These are generally quite separate projects made by separate people. Many popular programming languages are developed in a similar way, having a variety of implementations of a single standard.
相反,有语言的“规范”(ECMAScript 标准),然后有许多该标准的“实现”。这些通常是由不同的人制作的非常独立的项目。许多流行的编程语言都是以类似的方式开发的,具有单一标准的多种实现。
It's possible that a language may have an open source implementation, but the standard may not be "open" -- it's changes may be controlled by a single corporate entity for its profit. Or, the standard may be "open" and developed collaboratively, but there may be only one implementation which is not open source, or, the only "good" implementations may be proprietary.
一种语言可能具有开源实现,但标准可能不是“开放的”——它的更改可能由单个公司实体控制以获取利润。或者,标准可能是“开放的”并且是协作开发的,但可能只有一个实现不是开源的,或者,唯一的“好”实现可能是专有的。
JavaScript, in particular, is an implementation of the ECMAScript language standard and is primarily used in the form of client-side JavaScript, implemented as part of a web browser in order to provide enhanced user interfaces and dynamic websites. This enables programmatic access to computational objects within a host environment.
特别是 JavaScript,它是 ECMAScript 语言标准的实现,主要以客户端 JavaScript 的形式使用,作为 Web 浏览器的一部分实现,以提供增强的用户界面和动态网站。这使得能够以编程方式访问宿主环境中的计算对象。
Because of its open standard, ECMAScript is open but not open source. (A language standard can not be open-source -- it is not a program, it is a document describing the expected behavior of a program -- but an implementation of itcan be.)
由于其开放标准,ECMAScript 是开放的但不是开源的。(语言标准不能是开源的——它不是程序,而是描述程序预期行为的文档——但它的实现可以是。)
For example, the V8 engine, which is what Google Chrome uses is available, and so is the SpiderMonkey source code, which is used in Mozilla Firefox. There are more JavaScript engines, if you're interested.
例如,Google Chrome 使用的 V8 引擎可用,Mozilla Firefox 中使用的SpiderMonkey 源代码也可用。如果您有兴趣,还有更多JavaScript 引擎。
回答by Sergey
Javascript is a language. There are many different engines that interpret javascript, and each would be subject to its own license agreement.
JavaScript 是一种语言。有许多不同的引擎可以解释 javascript,每个引擎都受自己的许可协议的约束。
More about different engines: http://en.wikipedia.org/wiki/JavaScript_engine
有关不同引擎的更多信息:http: //en.wikipedia.org/wiki/JavaScript_engine
First JavaScript engine: SpiderMonkeyis written in C++ and is an open source project maintained by Mozilla Foundation.
第一个 JavaScript 引擎:SpiderMonkey是用 C++ 编写的,是一个由 Mozilla 基金会维护的开源项目。
回答by Oliver Moran
JavaScript is programming language initially developed by a company called Netscape. It is standardised under the name of ECMAScript http://www.ecmascript.org. This deviation in name is owing to disagreements between different companies over what to call it at the time that it became standardised.
JavaScript 是最初由一家名为 Netscape 的公司开发的编程语言。它以 ECMAScript http://www.ecmascript.org的名义标准化。这种名称上的偏差是由于不同公司在标准化时对其名称的不同意见。
There are various "engines" that interpret JavaScript when it is run in a browser. Some of these are open source (for example "Rhino" used in Firefox or "V8" used in Chrome).
当 JavaScript 在浏览器中运行时,有各种“引擎”可以解释 JavaScript。其中一些是开源的(例如 Firefox 中使用的“Rhino”或 Chrome 中使用的“V8”)。
However, the question of whether JavaScript itself is open source is a little off the mark. "Open source" refers to programs, whereas JavaScript is a programming language. It is an open standard, which is a close approximation in some ways - at least in the sense that it is not a "propriety" language that is owned and controlled by one company.
然而,JavaScript 本身是否开源的问题有点离题。“开源”是指程序,而 JavaScript 是一种编程语言。它是一种开放标准,在某些方面非常接近——至少在某种意义上,它不是由一家公司拥有和控制的“专有”语言。
--
——
Update: I suppose the answer to your question is that, because JS is an open standard, there are lots of implementations of it, including open source ones. These implementations are in all kinds of compiled languages and even some non-compiled ones.
更新:我想你的问题的答案是,因为 JS 是一个开放标准,它有很多实现,包括开源的。这些实现有各种编译语言,甚至一些非编译语言。
回答by Matt H
JavaScript has a language specification: ECMAScriptthat can and does have various implementations, open or closed source. I don't believe implementation of the language is encumbered by anything like patents, but I could be wrong.
JavaScript 有一个语言规范:ECMAScript,它可以并且确实有各种实现,开源或闭源。我不相信该语言的实现会受到专利之类的东西的阻碍,但我可能是错的。