Hacker News new | past | comments | ask | show | jobs | submit login
C++ Add-ons for Node.js v4 (nodesource.com)
26 points by ingve on Jan 2, 2016 | hide | past | favorite | 5 comments



Since NAN basically parrots the v8 API, I find it's easier to just code to the ever-changing v8 API, rather than the ever-changing NAN API. With the former approach you get readable and debuggable code. I'm not sure what NAN isolates you from if it doesn't have a strong API guarantee to protect you from future v8 API changes.


The article we're discussing answers this question - NAN gives you backwards compatibility with old versions of V8 (and therefore Node), while the V8 API doesn't.


Are you aware that NAN2's API is incompatible with NAN1's API? How is that backwards compatible?


The point is that NAN2 is compatible with old versions of Node and io.js, not that NAN2 is compatible with NAN1.

This is bolded in the article we're discussing:

> NAN's promise is to provide a single API to develop against, not a forever-stable API, it was always anticipated that it would change and adapt to V8 but do so in a way that you get to remain compatible with older versions of V8.


I am fully aware of that. I had to port orphaned NAN1 code to the new v8 API which I found easier to work with than NAN2.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: