4 ms·
V8 has a C++ GC because if you have shared C++ <-> JS object graphs you either need extra machinery to find cycles in individual code-paths (very error prone) o
by whizzter 20d ago
V8 has a C++ GC because if you have shared C++ <-> JS object graphs you either need extra machinery to find cycles in individual code-paths (very error prone) or let C++ data live in JS objects anyhow (initial V8 interop way).
Writing extensions for a GC'd language is painful or you let your interop code live in a GC world, I'm pretty sure you more or less always end up with the latter unless you add a way for the hosted language to support some way to control the host language (like JS code "understanding" std::shared_ptr's but that probably adds other securiy risks in terms of low-level exposure).
It's an engineering tradeoff, if you're 100% C++ you don't need that.