How Bun supports V8 APIs without using V8 (part 1) | Bun Blog
16-Oct-2024 221
When packages work in Node.js but don't work in Bun, we consider that a bug in Bun.
Native C & C++ APIs are often used in the JavaScript ecosystem for performance-critical libraries like 2D Canvas, database drivers, CPU detection, and more. Bun and Node.js implement Node-API (napi), which is the recommended engine-independent C API for interfacing with JavaScript.
But, a number of popular native modules directly use the V8 engine APIs exposed by Node.js. At the time of writing, the issue requesting V8 API support is the 11th-highest open issue on Bun's tracker when sorted by thumbs-up.
This is challenging for Bun because we use JavaScriptCore as the JavaScript engine (used in Safari), unlike Node.js which uses V8 (used in Chrome). JavaScriptCore is an entirely different JavaScript engine implementation with different design choices.
How Bun supports V8 APIs without using V8 (part 1) | Bun Blog #js #javascript #supports #without #using #(part #apis #blog https://javascript.ba/link/how-bun-supports-v8-apis-without-using-v8-part-1-bun-blog