Is JavaScript an open source programming language? I want to know how some objects and methods work.
I mean, is the compiler, interpreter, or parser for JavaScript open source?
-
You can have a look at the specification ecma-international.org/publications/standards/Ecma-262.htmFelix Kling– Felix Kling2011年07月23日 08:39:46 +00:00Commented Jul 23, 2011 at 8:39
-
4Is there any closed source programming language?ypercubeᵀᴹ– ypercubeᵀᴹ2011年07月23日 08:42:11 +00:00Commented Jul 23, 2011 at 8:42
-
6@Kermia: learn the difference between a language and an implementation. Python is a language, with multiple implementations (CPython, pypy, Jython, IronPython, for example). JavaScript is a language, with multiple implementations (V8, SpiderMonkey, etc.)Chris Morgan– Chris Morgan2011年07月23日 08:43:45 +00:00Commented Jul 23, 2011 at 8:43
-
1your question should rather be, "is compiler/interpreter/parser for Javascript open source?"Tarun– Tarun2011年07月23日 08:44:40 +00:00Commented Jul 23, 2011 at 8:44
3 Answers 3
There are numerous open source JavaScript engines (V8, Rhino and SpiderMonkey spring to mind) as well as closed source implementations (I assume that whatever Opera and Microsoft use are not open source).
The language is fairly tightly based on the ECMAScript specification, which is freely available.
Comments
What do you mean by open source language?
JavaScript is interpreted by the browser and depends upon the vendor and developer which engine it uses. Some of the popular engines are listed in List of ECMAScript engines .
Comments
In addition to the answer given above, there is also an open source .NET implementation of JavaScript available: Its name is Jurassic, and it is available on CodePlex:
Examples:
Execute an expression:
var engine = new Jurassic.ScriptEngine();Console.WriteLine(engine.Evaluate<int>("1.5 + 2.4"));Execute a script:
var engine = new Jurassic.ScriptEngine();engine.ExecuteFile(@"c:\test.js");
Features of version 2.2 (taken from web site):
- Supports all ECMAScript 3 and ECMAScript 5 functionality, including ES5 strict mode
- Simple yet powerful API
- Compiles JavaScript into .NET bytecode (CIL); not an interpreter
- Deployed as a single .NET assembly (no native code)
- Basic support for integrated debugging within Visual Studio
- Uses light-weight code generation, so generated code is fully garbage collected
- Tested on .NET 3.5, .NET 4 and Silverlight
Comments
Explore related questions
See similar questions with these tags.