You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2022. It is now read-only.
node-ffi holds a lot of promise for eliminating the need for native code for modules, but there is one aspect that makes it less than ideal: everything is synchronous.
The C/C++ way of doing async programming is typically to spin up a background thread, but we don't have threading in JS. We could use something like cluster, but that approach isn't as efficient as threading.
So let's prototype what an node-ffi would look like with async capabilities baked in.
The text was updated successfully, but these errors were encountered:
I'm also in the process of moving the core, low-level pieces of ref/node-ffi into io.js. It's a slow, tedious process since there's a lot to cover, but see nodejs/node#1750, nodejs/node#1759 and nodejs/node#1762 (and a 4th for libffi itself next) if you want to follow the progress of that (basically the ffi label in the issue tracker).
That's amazing @TooTallNate! I seriously had no idea there was an .async() function. Guess that's what I get for filing this issue before digging through the code 😅
I think this could be a huge win for NodeBots especially since a lot of people doing hardware are beginners, and native modules can be a big barrier to entry.
Thanks for all your work getting ffi into core, I'll certainly be keeping an eye on things. If there's anything the Hardware WG can do to help, let us know!
node-ffi holds a lot of promise for eliminating the need for native code for modules, but there is one aspect that makes it less than ideal: everything is synchronous.
The C/C++ way of doing async programming is typically to spin up a background thread, but we don't have threading in JS. We could use something like cluster, but that approach isn't as efficient as threading.
So let's prototype what an node-ffi would look like with async capabilities baked in.
The text was updated successfully, but these errors were encountered: