What is ECMAScript, JavaScript, Node.js, and Bun?
Most of us don’t know the difference between ECMAScript and JavaScript and often think that ECMAScript is part of JavaScript. Let's see the difference.
ECMAScript: ECMAScript serves as a guideline or set of rules for designing scripting languages. These rules are managed by ECMA International. It defines how JavaScript should be structured, and anyone creating a JavaScript engine must ensure it follows the ECMAScript specification. In 2016, a significant ECMAScript update, known as ES6, was introduced. It added features like let
, const
, the spread operator, and rest parameters. These updates were first included in the ECMAScript specification, so JavaScript engines, such as Chrome’s V8 and Firefox’s SpiderMonkey, also needed to be updated to support these new rules.
JavaScript: JavaScript is a scripting language that follows the ECMAScript specifications. In addition to these rules, JavaScript includes extra features not defined by ECMAScript. These features, such as setTimeout
and setInterval
, are provided by the browser.
Node.js: JavaScript was originally designed to run inside web browsers, so it only starts executing when you open a browser. Unlike languages like Java or Golang, JavaScript couldn’t run directly on your computer. In 2009, Ryan Dahl introduced Node.js, a runtime environment for JavaScript. A JavaScript runtime is an environment that can execute JavaScript code.
Node.js allows JavaScript to run on your computer or server and uses the V8 engine from Google Chrome. It also adds features, like the ability to read files from the system, which aren’t available in standard browsers.
Bun: Bun is an alternative to Node.js that aims to do the same things but faster. It’s a JavaScript runtime designed to run JavaScript code quickly and efficiently.