Search code examples
javascriptv8

Does the v8 engine update only new features whenever ECMAScript language specification is new?


As far as I know, the v8 engine is based on ECMAScript language specifications, do you develop it with a new ECMAScript whenever a new ECMAScript is released?

Or do we add only the newly added functions?

For example, if you look at ES5 -> ES6, in the case of Execution Context, the components change, but do you change all of them?


Solution

  • (V8 developer here.)

    Both the ECMAScript standard itself and engines' implementations of it evolve by adding individual features one by one.

    The "TC39" committee discusses new proposed features. Once a feature has been agreed upon, it is added to the standard (see the "Process" document @Bergi linked in his comment for more details). The yearly "releases" of ECMAScript are just snapshots of this continuous process.

    Engines typically implement a new feature either shortly before it is finalized (so that implementation feedback can inform the standardization discussion) or shortly after.

    Rewriting an entire JavaScript engine from scratch every year would be a huge waste of effort: most of the language doesn't change. Also, rewriting an entire JavaScript engine from scratch would take many years. (In fact, rewriting any software from scratch is almost always a bad idea, because you'll spend a huge amount of time just catching up with what the old version was able to do. Incremental improvements are almost always the better strategy.)

    The majority of engine developers' time is typically spent on improving support for existing features and subsystems (compilers, garbage collectors, internal object model, ...), such as making them faster or more memory efficient.