2 ms·
I'm glad that someone thought my post to be interesting even though no one found it to be good enough for a direct HN submission. However, I would like to disag
by codexon 17y ago
I'm glad that someone thought my post to be interesting even though no one found it to be good enough for a direct HN submission. However, I would like to disagree with the statement of my hack lacking subtlety.
The way the Node.js method is performed is by changing the binding of a function. This is possible in any dynamic language that has functions as first-class variables such as Python. Because that type of reloading is quite old, programmers have had a lot of time to find many problems with it: which is why people are hesitant to suggest using Python's reload.
One of those problems is consistency. While I can't think of a simple example off the top of my head, the blog author here acknowledges it's presence which I believe he will soon find to be a big problem.
And most importantly, my method allows you to use a new binary. What happens when you want to upgrade the V8 virtual machine because it has a memory leak or a security problem? With function loading you will still need to restart.
I think Node.js will be better off implementing the spawn method I documented.