Bun faces challenges in supporting Node.js native modules that use V8 APIs because Bun uses JavaScriptCore instead of V8. Despite these differences, Bun has begun to implement many of V8's C++ APIs using JavaScriptCore, allowing popular Node.js native modules to work in Bun. The differences in garbage collection, value representation, and value lifetime between JavaScriptCore and V8 are significant. The post provides a detailed look into JavaScriptCore and V8 API examples, value representations, and the complexities of implementing V8 functions with JavaScriptCore. It also delves into the representation of JavaScript values in both engines and the concept of tagged pointers in V8.

22m read timeFrom bun.sh
Post cover image
Table of contents
JavaScriptCore vs. V8 API exampleImplementing V8 Functions, First AttemptValue Representation, part 2Coming upLinks

Sort: