Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That definitely isn't why Node was created... Node is a standalone programming environment that embeds V8, it doesn't somehow help you embed V8 in one of your projects or make that "feasible". In fact, one of the issues with Node for a long time was that every Node plug-in was expected to directly use the embedding API from V8--in no small part as it is actually a pretty easy-to-use API--and that made the entire ecosystem lock-step on V8 API changes (which got tied to major Node versions).

Much later, Node added two little abstraction layer over V8's APIs: one that is mostly done in some header files (to deal with the occasional backwards compatibility issue) and another which actually wraps V8; and, even then, AFAIK the latter was mostly done to allow entirely replacing V8 with ChakraCore. But neither of these abstractions are designed to be used by others outside of Node's cosebase (something I almost sort of got working once, but not really): they don't help you embed V8... V8 is already easy to embed.

Notably: V8's embedding API isn't particularly more complicated than the API of any other engine: it is simply more templated. If you sit around with SpiderMonkey, JavaScriptCore, or even DukTape, you will find yourself allocating machines, managing handles, converting strings, and checking types of values. This is of course going to be verbose, in the same way that using JNI to call into Java is verbose, or generally accessing any embedded VM from a language like C/C++ is verbose (and for all the same reasons).



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: