Replies: 1 comment
-
AaronO talked about a possibly implementing plugins so that FFI can be used for low-level things and plugins can be used for higher-level things in rust. I'm not sure if this will actually happen. But I remember people talking about this idea |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It was recently announced that in Q3 2021, the Plugin API will be removed entirely and replaced with a new FFI API. I'm wondering if that's really the best solution? The current plugin API is broken, no doubt, but I'm not sure FFI will be a suitable replacement. It works for calling functions from shared libraries, but for more complex cases like C++ header-only libraries, it will be very difficult to use.
It's also version-specific, which means if the user is accidentally using the wrong shared library, it could take a while to figure out the source of the problem.
My suggestion for a replacement API would be something like having Deno.openPlugin act as a dynamic import() behind the scenes. Basically, openPlugin would create a new V8 Module via InstantiateModule, and the plugin would act as the ResolveCallback. The plugin is handed a name and a Module and a Context and told "resolve this name and populate this module."
Does this sound feasible? If not, does anyone else have any other proposals, or is FFI the only way to go now?
Beta Was this translation helpful? Give feedback.
All reactions