neon-bindings / rfcs

RFCs for changes to Neon
Apache License 2.0
14 stars 9 forks source link

Support for N-API #27

Closed ghost closed 5 years ago

ghost commented 5 years ago

As discussed in this issue, I propose making the change to the new N-API.

Supporting N-API has several benefits, the most important being that different node versions can use the same addon without recompiling. It will require some changes to the existing API, but my guess from experience with both projects is it will not be that bad.

amilajack commented 5 years ago

Adding N-API support is already on the roadmap. Also this RFC doesn't follow the RFC format. This seems to be more of a feature request.

ghost commented 5 years ago

Hi @amilajack thanks for the comment. I was going to file an RFC after running some experiments. Given that it is already on the roadmap, does that mean you already accept pull requests that would implement this?

amilajack commented 5 years ago

Yup, that's correct

ghost commented 5 years ago

@amilajack Oh, perfect! I'll give it a try, though I do not make any guarantees.

anurbol commented 4 years ago

Hi everyone. It seems to me that the progress on switching to N-API has halted. Has it?

kjvalencik commented 4 years ago

@anurbol Nope! Some initial refactoring to allow development to occur on master with feature flags has already been merged. Some of the initial patters and implementation is being reviewed here: https://github.com/neon-bindings/neon/pull/458.

Unfortunately, progress can often be slower than we would like in an open source project primarily developed in the maintainers spare time.

anurbol commented 4 years ago

@kjvalencik Good to hear! Thanks! I totally understand why this may be slow. Actually I think open-source developers are heroes because I can't imagine myself spending so much effort on something that will not bring money.

I'd love to help with that, but I think I will consume more time asking questions than actually help...

kjvalencik commented 4 years ago

If you'd like to help, we'd love to have it! There's a quest issue soliciting help and providing some specific tasks that are up for grabs. We know it will be much faster with help from the community.

anurbol commented 4 years ago

@kjvalencik I wanted to ask if you have something like that quest, and you do indeed have it! Looks very nice and organized. I must say though, that in the last 2 hours I've dived into WASM as the alternative to the native binaries, I'll make a trial and see its performance, and if it's comparable to native Rust, then I'll have to go that way (with less and less time, skills and motivation left for Neon), otherwise I'll have to join you in implementing N-Api 😃 Thank you.

kjvalencik commented 4 years ago

Wasm is great and can be an excellent choice if it meets your use case (pure, no system access required). It's somewhat orthogonal to neon.

Wasi, on the other hand, more directly matches the neon use cases, but is very nascent.

anurbol commented 4 years ago

@kjvalencik Funny enough, it's exactly my case 😄 I am doing the files (provided by VSCode) parsing and that's pretty much it, no OS stuff needed.. Thank you for advice!