nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
105.21k stars 28.5k forks source link

Documentation (Diagram) for C++ internals #53690

Open jdiaz-dev opened 5 days ago

jdiaz-dev commented 5 days ago

I am trying to contribute with C++ internals. I am reading C++ internals documentation, it is great but I would like to know if there is a diagram for it? I think that will be good to have one graphic doc. In case that match with me. What is required to create it?

joyeecheung commented 5 days ago

I had some diagrams for the structure of internal embedder objects in a talk I did for NodeConf EU: https://github.com/joyeecheung/talks/blob/master/nodeconfeu_2023/javaScript-and-cpp-in-nodejs-core.pdf

And there are some diagrams about the more macro part of the project (process & thread architecture) for a talk in 2019 https://github.com/joyeecheung/talks/blob/master/node_js_interactive_2019/how-node-js-bootstraps-itself-2019-edition.pdf (not sure if it's still fully accurate now, from a glance I think it still is).

I think the problem with the diagrams is that they can get outdated a bit more easily because we keep changing the references. For example I know the diagrams in the first link can soon get outdated when we migrate to Oilpan. Some structures in there only appeared in less than a year and can be changed at any time. But it would be a lot of churn to ask whoever changing a reference in src to also update the diagram, then there needs to be some shared tooling in creating a diagram etc. otherwise it gets out of date quickly (even with shared tooling it can still add a lot of friction to contributions). There is a similar problem with textual descriptions but updating texts is a lot easier to manage IMO.