Replies: 8 comments 5 replies
-
That’s going to increase the API surface a lot, but I do agree that it would be nice to provide APIs in the style of N-API that would be suitable for building Node.js core parts. I don’t think you could demand indefinite API or ABI stability in that case, and only have that between major Node.js versions. |
Beta Was this translation helpful? Give feedback.
-
if realized, would like to nominate @mapbox's sqlite3 for official status. this would simplify node-devops by allowing me to write stateful-apps with zero [npm] dependencies. |
Beta Was this translation helpful? Give feedback.
-
I am in favour of this. I am also in favour of this for JavaScript addons and packages. Landing things in core makes iterations sometimes needlessly long/hard. |
Beta Was this translation helpful? Give feedback.
-
Which ABI stability timeframe do you have in mind here? Per major version like v8 or longer like NAPI? Do you have a C or C++ API in mind? C++ adds quite some pitfalls. The long term stability of NAPI is nice. But if you distribute a native addon which should also work on older nodejs version it forces you to stick on old NAPI version (in special if distribution is via precompile binary). Alternative is to ship one binary per major version like before NAPI existed and benefit from NAPI only because of less maintenance effort. One important point is in my opinion the interoperability between NAPI and this new, extended API. E.g. conversions between NAPI types and v8 types should be cheap and easy to allow use of v8 features not available via NAPI. |
Beta Was this translation helpful? Give feedback.
-
And here's a key problem, nicely illustrated almost immediately! What's the limiting principle for what addons get to be "official"? Who's gating this? What are the rules? Is there some new body managing this? Is the TSC willing to handle this list? Does core then need to take over security responsibility, reporting and handling for these addons? What happens when these addons fall behind, who's doing this work to keep them updated? |
Beta Was this translation helpful? Give feedback.
-
For those of us following along at home, how does separating quic from core fix the unreleased openssl issue? |
Beta Was this translation helpful? Give feedback.
-
It seems that there's an intent to make TSC approval a prerequisite for a module to use a particular set of APIs. I'm a little confused as to how this mechanism would work. If the modules are to be distributed separately from Node.js itself, what stops arbitrary userland modules from using these APIs? If there is no such mechanism, why bother making this apparent distinction? |
Beta Was this translation helpful? Give feedback.
-
for me, there's value in being able to hack together a stateful webserver in 400-lines or less and deploy it with zero-config and zero-dependencies. you can do that in python but not nodejs, b/c python comes with sqlite3 included. i group javascript similarly with languages like perl/python/php -- its a "scripting" tool, enabling the masses (less-technical lay-people like me) to productize our ux-ideas with minimal tooling and just a few hundred lines of throwaway code -- as opposed to 1000's of lines of needlessly-distracting-machine-level c#/c/c++/rust code. sqlite3 is the only external-dependency i need in 90% of nodejs-scripting use-cases that require state-management, and i would be happy if it was the only exception ever made by TSC to include as an external addon. mapbox/node-sqlite3's codebase is also mostly stable. since 2014, only 63 lines have been added/removed to its core /lib/ (git-changelog). |
Beta Was this translation helpful? Give feedback.
-
@nodejs/tsc @nodejs/n-api @nodejs/collaborators
I've been working on QUIC for a while now. Unfortunately, further development on it is largely stalled due to OpenSSL refusing to land the necessary support before the 3.1 timeframe. So while we have something that currently works, we can't actually ship it.
I've been considering the possibility of re-implementing the QUIC stuff as a separate native addon. However, doing so is going to be difficult because it currently relies on a number of internal bits that are not exposed via N-API currently, which means I'd just end up having to duplicate a bunch of code that already exists in core, which sucks.
Currently, the only layering we have is: Something is either implemented natively in core directly against the Node.js internal or V8 APIs or is implemented against the limited N-APIs and potentially duplicates core or has to "reach in" to Node.js internals in unsupported ways.
What I'd like is to have are Node.js official native addons that (a) are distributed separately from the Node.js core binary, (b) supported and maintained as part of the Node.js project in that when a new version of Node.js is published they are guaranteed to work, and (c) use an extended ABI stable API that goes beyond what N-API does today to allow more reuse of existing Node.js internals.
For example, the kinds of existing internals I want to be able to make use of are utilities such as node-sockaddr.h, async_wrap.h, debug_utils.h, etc.
Beta Was this translation helpful? Give feedback.
All reactions