Is Hermes Based on V8?

If you’re into web development, then you must have come across Node.js – the popular open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a browser. Node.js is widely used for creating server-side applications and has been built on top of Google’s V8 JavaScript engine.

Now, if you’re familiar with Node.js, then you may have also heard of Hermes – a relatively new JavaScript engine created by Facebook that is designed to improve the performance of React Native apps. But what exactly is Hermes? And is it based on V8?

What is Hermes?

Hermes is an open-source JavaScript engine designed by Facebook specifically for use in React Native mobile apps. It was first introduced in 2019 and has since become an integral part of the React Native ecosystem.

The main goal behind creating Hermes was to improve the performance of React Native apps. Prior to its release, React Native relied on the JavaScriptCore engine which had several limitations when it came to optimizing memory usage and reducing startup times. Hermes aimed to address these issues by providing a lightweight and efficient alternative.

Is Hermes Based on V8?

No, Hermes is not based on V8. In fact, it was built from scratch by Facebook’s engineers specifically for use in mobile environments.

While both engines share some similarities in terms of functionality (they both parse and execute JavaScript code), they are fundamentally different in their design and implementation.

One key difference between the two engines lies in their approach to memory management. V8 uses a garbage collector to automatically free up memory that is no longer being used by an application. In contrast, Hermes uses a technique called static memory allocation which allows for more efficient use of memory resources.

Additionally, unlike V8 which relies heavily on just-in-time (JIT) compilation for optimizing code execution speed, Hermes uses ahead-of-time (AOT) compilation which results in faster startup times and reduced memory overhead.

Conclusion

So, to answer the question – no, Hermes is not based on V8. While both engines are designed to execute JavaScript code, they differ significantly in their implementation and approach to memory management and optimization.

That being said, it’s worth noting that both V8 and Hermes have their strengths and weaknesses depending on the use case. So if you’re working with React Native apps and looking to improve performance, it’s definitely worth considering Hermes as a potential alternative to the default JavaScriptCore engine.