Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What language is JavaScript written in?

Tags:

javascript

If it's a scripting language as the name implies it must be written in a lower level language right? Like how PHP is written in C what language is JavaScript written in?

like image 621
Sergio Avatar asked Aug 10 '11 03:08

Sergio


People also ask

Is JavaScript written in C++?

Yes, you guessed it — JavaScript is written in C++. To be precise, the engines that drive the most popular JavaScript engines (V8 within Google Chrome and Node, Chakra for Microsoft and SpiderMonkey for Mozilla products) are mainly compiled from a C++ code base.

Is JS written in Java?

The JavaScript programming language, developed by Netscape, Inc., is not part of the Java platform.

Is JavaScript an actual language?

JavaScript was developed at Netscape. It was originally called LiveScript, but that name wasn't confusing enough. The -Script suffix suggests that it is not a real programming language, that a scripting language is less than a programming language. But it is really a matter of specialization.

Is JavaScript based on Python?

Python object-based is nearly equal to JavaScript, and python supports a programming style that uses simple functions and variables. JavaScript is the most complex modern programming language compared to python. Python and JavaScript both use a lexical scope with small differences.


2 Answers

Javascript is just a standard, more formally known as ECMAScript. It can be implemented in any language, just like any standard.

Chrome's Javascript engine, V8, is written in C++.

From the project page:

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 implements ECMAScript as specified in ECMA-262, 5th edition, and runs on Windows (XP or newer), Mac OS X (10.5 or newer), and Linux systems that use IA-32, x64, or ARM processors.

Firefox's Javascript engine, SpiderMonkey (and now TraceMonkey) is also written in C++. And as maerics below said, Rhino is written in Java.

like image 66
Seth Carnegie Avatar answered Oct 31 '22 08:10

Seth Carnegie


All the answers so far are correct, but since it hasn't been mentioned yet, JavaScript can be written in JavaScript.

like image 44
Matthew Crumley Avatar answered Oct 31 '22 10:10

Matthew Crumley